Sha256: 857d03cca0c6551a207481628032e6772aead7477686075e94e09b0bd5c74f36
Contents?: true
Size: 689 Bytes
Versions: 11
Compression:
Stored size: 689 Bytes
Contents
module Nixenvironment class BuildEnvVarsLoader def self.load cmd_output = %x[ source \"#{LOAD_BUILD_ENV_VARS_SCRIPT_PATH}\" ].strip! build_env_vars = {} vars_list = cmd_output.split(/\n/).reject(&:empty?) if vars_list.present? vars_to_strip = Hash[vars_list.map { |it| it.split('=', 2) }] vars_to_strip.each do |key, value| if key.present? && value.present? stripped_key = key.strip stripped_value = value.strip puts "#{stripped_key} : #{stripped_value}" build_env_vars[stripped_key] = stripped_value end end end build_env_vars end end end
Version data entries
11 entries across 11 versions & 1 rubygems