Sha256: 42c36eb4e0fe22ae4efb2705cc6387387eaf51f30bd531b07f886c8d72aa20dc

Contents?: true

Size: 564 Bytes

Versions: 212

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

module EacRubyUtils
  module Envs
    class Command
      module Envvars
        def envvar(name, value)
          duplicate_by_extra_options(envvars: envvars.merge(name => value))
        end

        private

        def append_envvars(command)
          e = envvars.map { |k, v| "#{Shellwords.escape(k)}=#{Shellwords.escape(v)}" }.join(' ')
          e.present? ? "#{e} #{command}" : command
        end

        def envvars
          extra_options[:envvars] ||= {}.with_indifferent_access
        end
      end
    end
  end
end

Version data entries

212 entries across 212 versions & 4 rubygems

Version Path
eac_ruby_utils-0.95.1 lib/eac_ruby_utils/envs/command/envvars.rb
avm-tools-0.117.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.95.0 lib/eac_ruby_utils/envs/command/envvars.rb
avm-tools-0.117.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
avm-tools-0.116.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.94.2 lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.94.1 lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.94.0 lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.93.0 lib/eac_ruby_utils/envs/command/envvars.rb
avm-tools-0.116.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
avm-tools-0.116.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.92.1 lib/eac_ruby_utils/envs/command/envvars.rb
avm-tools-0.115.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.92.0 lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.91.0 lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.90.0 lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.89.0 lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.88.0 lib/eac_ruby_utils/envs/command/envvars.rb
avm-tools-0.114.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
avm-tools-0.114.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb