Class: Kuby::Docker::CopyPhase
- Defined in:
- lib/kuby/docker/copy_phase.rb
Constant Summary collapse
- DEFAULT_PATHS =
extend T::Sig
['./'].freeze
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
T::Sig::WithoutRuntime.sig { returns(T::Array) }.
Attributes inherited from Layer
Instance Method Summary collapse
-
#<<(path) ⇒ Object
T::Sig::WithoutRuntime.sig { params(path: String).void }.
-
#apply_to(dockerfile) ⇒ Object
T::Sig::WithoutRuntime.sig { params(dockerfile: Dockerfile).void }.
-
#initialize(environment) ⇒ CopyPhase
constructor
T::Sig::WithoutRuntime.sig { params(environment: Environment).void }.
Constructor Details
#initialize(environment) ⇒ CopyPhase
T::Sig::WithoutRuntime.sig { params(environment: Environment).void }
14 15 16 17 |
# File 'lib/kuby/docker/copy_phase.rb', line 14 def initialize(environment) super @paths = [] end |
Instance Attribute Details
#paths ⇒ Object (readonly)
T::Sig::WithoutRuntime.sig { returns(T::Array) }
11 12 13 |
# File 'lib/kuby/docker/copy_phase.rb', line 11 def paths @paths end |
Instance Method Details
#<<(path) ⇒ Object
T::Sig::WithoutRuntime.sig { params(path: String).void }
20 21 22 |
# File 'lib/kuby/docker/copy_phase.rb', line 20 def <<(path) paths << path end |
#apply_to(dockerfile) ⇒ Object
T::Sig::WithoutRuntime.sig { params(dockerfile: Dockerfile).void }
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 |