Class: Holodekk::Image::Instructions::Copy
- Inherits:
-
Builder::Instruction
- Object
- Builder::Instruction
- Holodekk::Image::Instructions::Copy
- Defined in:
- lib/holodekk/image/instructions/copy.rb
Instance Attribute Summary collapse
-
#chown ⇒ Object
Returns the value of attribute chown.
-
#from ⇒ Object
Returns the value of attribute from.
-
#link ⇒ Object
(also: #link?)
Returns the value of attribute link.
-
#sources ⇒ Object
Returns the value of attribute sources.
-
#target ⇒ Object
Returns the value of attribute target.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Builder::Instruction
#as_json, instruction_tag, tag, #tag, #to_json
Instance Attribute Details
#chown ⇒ Object
Returns the value of attribute chown.
7 8 9 |
# File 'lib/holodekk/image/instructions/copy.rb', line 7 def chown @chown end |
#from ⇒ Object
Returns the value of attribute from.
7 8 9 |
# File 'lib/holodekk/image/instructions/copy.rb', line 7 def from @from end |
#link ⇒ Object Also known as: link?
Returns the value of attribute link.
7 8 9 |
# File 'lib/holodekk/image/instructions/copy.rb', line 7 def link @link end |
#sources ⇒ Object
Returns the value of attribute sources.
7 8 9 |
# File 'lib/holodekk/image/instructions/copy.rb', line 7 def sources @sources end |
#target ⇒ Object
Returns the value of attribute target.
7 8 9 |
# File 'lib/holodekk/image/instructions/copy.rb', line 7 def target @target end |
Class Method Details
.build(sources, target, **kwargs) ⇒ Object
16 17 18 19 |
# File 'lib/holodekk/image/instructions/copy.rb', line 16 def self.build(sources, target, **kwargs) s = *sources new({ sources: s, target: target }.merge(kwargs)) end |
Instance Method Details
#to_dockerfile ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/holodekk/image/instructions/copy.rb', line 21 def to_dockerfile builder = Docker::Dockerfile::InstructionBuilder.new(self) builder.flag('link', link) add_option(builder, 'chown') add_option(builder, 'from') builder.value_list(*sources.map do |s| Docker::Dockerfile::InstructionBuilder::QuotedString.new(s) end) builder.quoted_string(target) builder.output end |