Class: Holodekk::Image::Instructions::Shell

Inherits:
Builder::Instruction show all
Defined in:
lib/holodekk/image/instructions/shell.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Builder::Instruction

#as_json, instruction_tag, tag, #tag, #to_json

Instance Attribute Details

#shellObject

Returns the value of attribute shell.



7
8
9
# File 'lib/holodekk/image/instructions/shell.rb', line 7

def shell
  @shell
end

Class Method Details

.build(*shell) ⇒ Object



11
12
13
# File 'lib/holodekk/image/instructions/shell.rb', line 11

def self.build(*shell)
  new(shell: shell)
end

Instance Method Details

#to_dockerfileObject



15
16
17
18
19
# File 'lib/holodekk/image/instructions/shell.rb', line 15

def to_dockerfile
  builder = Docker::Dockerfile::InstructionBuilder.new(self)
  builder.value_array(*shell.map { |s| Docker::Dockerfile::InstructionBuilder::QuotedString.new(s) })
  builder.output
end