Sha256: 12eb1f9b039d2f62e576652af29746166f60026159fee38fab45c88973bd727f

Contents?: true

Size: 750 Bytes

Versions: 5

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true

module RubyFly
  module Commands
    module Mixins
      module Environment
        def initialize(opts = {})
          super
          @environment = opts[:environment]
        end

        def for_environment(environment)
          @environment = environment
          self
        end

        def configure_command(initial_builder, parameters)
          builder = super
          environment = parameters[:environment] || @environment
          if environment
            builder =
              environment.to_a.inject(builder) do |b, environment_variable|
                b.with_environment_variable(*environment_variable)
              end
          end
          builder
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby_fly-0.42.0.pre.2 lib/ruby_fly/commands/mixins/environment.rb
ruby_fly-0.42.0.pre.1 lib/ruby_fly/commands/mixins/environment.rb
ruby_fly-0.41.0 lib/ruby_fly/commands/mixins/environment.rb
ruby_fly-0.40.0.pre.6 lib/ruby_fly/commands/mixins/environment.rb
ruby_fly-0.40.0.pre.5 lib/ruby_fly/commands/mixins/environment.rb