Class: Kuby::Docker::CopyPhase
- Defined in:
- lib/kuby/docker/copy_phase.rb
Constant Summary collapse
- DEFAULT_PATHS =
['./'].freeze
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Attributes inherited from Phase
Instance Method Summary collapse
- #<<(path) ⇒ Object
- #apply_to(dockerfile) ⇒ Object
-
#initialize(*args) ⇒ CopyPhase
constructor
A new instance of CopyPhase.
Constructor Details
#initialize(*args) ⇒ CopyPhase
Returns a new instance of CopyPhase.
8 9 10 11 |
# File 'lib/kuby/docker/copy_phase.rb', line 8 def initialize(*args) super @paths = [] end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
6 7 8 |
# File 'lib/kuby/docker/copy_phase.rb', line 6 def paths @paths end |
Instance Method Details
#<<(path) ⇒ Object
13 14 15 |
# File 'lib/kuby/docker/copy_phase.rb', line 13 def <<(path) paths << path end |
#apply_to(dockerfile) ⇒ Object
17 18 19 20 |
# File 'lib/kuby/docker/copy_phase.rb', line 17 def apply_to(dockerfile) to_copy = paths.empty? ? DEFAULT_PATHS : paths to_copy.each { |path| dockerfile.copy(path, '.') } end |