Class: Avm::Files::Appendable::TarOutputCommand

Inherits:
ResourceBase show all
Defined in:
lib/avm/files/appendable/tar_output_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(appender, command) ⇒ TarOutputCommand

Returns a new instance of TarOutputCommand.



13
14
15
16
# File 'lib/avm/files/appendable/tar_output_command.rb', line 13

def initialize(appender, command)
  super(appender)
  @command = command
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



11
12
13
# File 'lib/avm/files/appendable/tar_output_command.rb', line 11

def command
  @command
end

Instance Method Details

#write_on(target_dir) ⇒ Object



18
19
20
21
22
# File 'lib/avm/files/appendable/tar_output_command.rb', line 18

def write_on(target_dir)
  command.pipe(
    ::EacRubyUtils::Envs.local.command('tar', '-xf', '-', '-C', target_dir)
  ).execute!
end