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, #mv, #rm_rf, #run_ascli_cmd, #tmpdir, #with_readable

Methods included from WithPipeConsumer

#mkio

Methods inherited from Etna::Filesystem

#exist?, #ls, #mv, #rm_rf, #stat, #tmpdir, #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



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/etna/filesystem.rb', line 244

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
        dir = ::File.dirname(file)
        dir[0] == '/' ? dir : "/#{dir}"
      else
        e
      end
    end.insert(2, "-d")
  else
    super
  end
end

#mkdir_p(dest) ⇒ Object



240
241
242
# File 'lib/etna/filesystem.rb', line 240

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

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



261
262
263
264
265
266
267
268
269
270
# File 'lib/etna/filesystem.rb', line 261

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