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_tools-0.46.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.45.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.45.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.45.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.107.1 lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.44.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.43.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.107.0 lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.42.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.41.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.40.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.39.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.106.1 lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.106.0 lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.38.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.37.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_ruby_utils-0.105.0 lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.37.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.37.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb
eac_tools-0.36.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/command/envvars.rb