Class: Kuby::Docker::CopyPhase
- Extended by:
- T::Sig
- Defined in:
- lib/kuby/docker/copy_phase.rb
Constant Summary collapse
- DEFAULT_PATHS =
T.let(['./'].freeze, T::Array[String])
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Attributes inherited from Layer
Instance Method Summary collapse
- #<<(path) ⇒ Object
- #apply_to(dockerfile) ⇒ Object
-
#initialize(environment) ⇒ CopyPhase
constructor
A new instance of CopyPhase.
Constructor Details
#initialize(environment) ⇒ CopyPhase
Returns a new instance of CopyPhase.
14 15 16 17 |
# File 'lib/kuby/docker/copy_phase.rb', line 14 def initialize(environment) super @paths = T.let([], T::Array[String]) end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
11 12 13 |
# File 'lib/kuby/docker/copy_phase.rb', line 11 def paths @paths end |
Instance Method Details
#<<(path) ⇒ Object
20 21 22 |
# File 'lib/kuby/docker/copy_phase.rb', line 20 def <<(path) paths << path end |
#apply_to(dockerfile) ⇒ Object
25 26 27 28 |
# File 'lib/kuby/docker/copy_phase.rb', line 25 def apply_to(dockerfile) to_copy = paths.empty? ? DEFAULT_PATHS : paths to_copy.each { |path| dockerfile.copy(path, '.') } end |