Class: Etna::Filesystem::GeneAsperaCliFilesystem

Inherits:
AsperaCliFilesystem show all
Defined in:
lib/etna/filesystem.rb

Overview

Genentech’s aspera deployment doesn’t support modern commands, unfortunately…

Instance Method Summary collapse

Methods inherited from AsperaCliFilesystem

#exist?, #initialize, #run_ascli_cmd, #with_readable

Methods included from WithPipeConsumer

#mkio

Methods inherited from Etna::Filesystem

#exist?, #with_readable

Constructor Details

This class inherits a constructor from Etna::Filesystem::AsperaCliFilesystem

Instance Method Details

#mkcommand(rd, wd, file, opts, size_hint: nil) ⇒ Object



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/etna/filesystem.rb', line 216

def mkcommand(rd, wd, file, opts, size_hint: nil)
  if opts.include?('w')
    super.map do |e|
      if e.instance_of?(String) && e.start_with?("stdio://")
        "stdio-tar://"
      elsif e == file
        ::File.dirname(file)
      else
        e
      end
    end.insert(2, "-d")
  else
    super
  end
end

#mkdir_p(dest) ⇒ Object



207
208
209
# File 'lib/etna/filesystem.rb', line 207

def mkdir_p(dest)
  # Pass through -- this file system creates containing directories by default, womp womp.
end

#mvObject



211
212
213
# File 'lib/etna/filesystem.rb', line 211

def mv
  raise "mv is not supported"
end

#rm_rfObject



203
204
205
# File 'lib/etna/filesystem.rb', line 203

def rm_rf
  raise "rm_rf is not supported"
end

#tmpdirObject



199
200
201
# File 'lib/etna/filesystem.rb', line 199

def tmpdir
  raise "tmpdir is not supported"
end

#with_writeable(dest, opts = 'w', size_hint: nil, &block) ⇒ Object



232
233
234
235
236
237
238
239
240
241
# File 'lib/etna/filesystem.rb', line 232

def with_writeable(dest, opts = 'w', size_hint: nil, &block)
  raise "#{self.class.name} requires size_hint in with_writeable" if size_hint.nil?

  super do |io|
    io.write("File: #{::File.basename(dest)}\n")
    io.write("Size: #{size_hint}\n")
    io.write("\n")
    yield io
  end
end