Class: Drydock::Instructions::Copy
- Defined in:
- lib/drydock/instructions/copy.rb
Overview
The concrete implementation of the COPY instruction. Do not use this class directly.
Instance Attribute Summary collapse
-
#chain ⇒ Object
readonly
Returns the value of attribute chain.
-
#chmod ⇒ Object
Returns the value of attribute chmod.
-
#ignorefile ⇒ Object
Returns the value of attribute ignorefile.
-
#no_cache ⇒ Object
Returns the value of attribute no_cache.
-
#recursive ⇒ Object
Returns the value of attribute recursive.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
-
#target_path ⇒ Object
readonly
Returns the value of attribute target_path.
Instance Method Summary collapse
Instance Attribute Details
#chain ⇒ Object (readonly)
Returns the value of attribute chain.
14 15 16 |
# File 'lib/drydock/instructions/copy.rb', line 14 def chain @chain end |
#chmod ⇒ Object
Returns the value of attribute chmod.
12 13 14 |
# File 'lib/drydock/instructions/copy.rb', line 12 def chmod @chmod end |
#ignorefile ⇒ Object
Returns the value of attribute ignorefile.
12 13 14 |
# File 'lib/drydock/instructions/copy.rb', line 12 def ignorefile @ignorefile end |
#no_cache ⇒ Object
Returns the value of attribute no_cache.
12 13 14 |
# File 'lib/drydock/instructions/copy.rb', line 12 def no_cache @no_cache end |
#recursive ⇒ Object
Returns the value of attribute recursive.
12 13 14 |
# File 'lib/drydock/instructions/copy.rb', line 12 def recursive @recursive end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
14 15 16 |
# File 'lib/drydock/instructions/copy.rb', line 14 def source_path @source_path end |
#target_path ⇒ Object (readonly)
Returns the value of attribute target_path.
14 15 16 |
# File 'lib/drydock/instructions/copy.rb', line 14 def target_path @target_path end |
Instance Method Details
#run! ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/drydock/instructions/copy.rb', line 29 def run! if source_path.start_with?('/') Drydock.logger.warn("#{source_path.inspect} is an absolute path; we recommend relative paths") end fail InvalidInstructionError, "#{source_path} does not exist" unless File.exist?(source_path) buffer = build_tar_from_source! digest = calculate_digest(buffer) write_to_container(buffer, digest) end |