Sha256: 9045a1d040c861387d50f040a964cba5c7f952383997e460bdc20d498ff4e908

Contents?: true

Size: 693 Bytes

Versions: 23

Compression:

Stored size: 693 Bytes

Contents

# typed: strict

module Kuby
  module Docker
    class CopyPhase < Layer
      extend T::Sig

      DEFAULT_PATHS = T.let(['./'].freeze, T::Array[String])

      sig { returns(T::Array[String]) }
      attr_reader :paths

      sig { params(environment: Environment).void }
      def initialize(environment)
        super
        @paths = T.let([], T::Array[String])
      end

      sig { params(path: String).void }
      def <<(path)
        paths << path
      end

      sig { params(dockerfile: Dockerfile).void }
      def apply_to(dockerfile)
        to_copy = paths.empty? ? DEFAULT_PATHS : paths
        to_copy.each { |path| dockerfile.copy(path, '.') }
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
kuby-core-0.11.2 lib/kuby/docker/copy_phase.rb
kuby-core-0.11.1 lib/kuby/docker/copy_phase.rb
kuby-core-0.11.0 lib/kuby/docker/copy_phase.rb