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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ResourceBase

#to_s

Constructor Details

#initialize(appender, command) ⇒ TarOutputCommand

Returns a new instance of TarOutputCommand.



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

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

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



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

def command
  @command
end

Instance Method Details

#to_s_attributesEnumerable<Symbol>

Returns:

  • (Enumerable<Symbol>)


24
25
26
# File 'lib/avm/files/appendable/tar_output_command.rb', line 24

def to_s_attributes
  [:command]
end

#write_on(target_dir) ⇒ Object



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

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