summaryrefslogtreecommitdiff
path: root/lib/mixlib
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-08-28 16:19:25 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-08-28 16:19:25 -0700
commit767ea4fc19cb29a55a81a55d1a13643ae3108f4c (patch)
tree811674aa726c2478352e2d87744ad5105db26da8 /lib/mixlib
parent3b389790688adb1007b33476ec2e2b6111e26d76 (diff)
downloadmixlib-shellout-767ea4fc19cb29a55a81a55d1a13643ae3108f4c.tar.gz
remove LC_ALL default environment variable
now that we no longer support ruby 1.8.7 its time to retire this
Diffstat (limited to 'lib/mixlib')
-rw-r--r--lib/mixlib/shellout.rb19
-rw-r--r--lib/mixlib/shellout/windows.rb1
2 files changed, 4 insertions, 16 deletions
diff --git a/lib/mixlib/shellout.rb b/lib/mixlib/shellout.rb
index 6261c21..a379ee8 100644
--- a/lib/mixlib/shellout.rb
+++ b/lib/mixlib/shellout.rb
@@ -27,7 +27,6 @@ module Mixlib
READ_WAIT_TIME = 0.01
READ_SIZE = 4096
DEFAULT_READ_TIMEOUT = 600
- DEFAULT_ENVIRONMENT = {'LC_ALL' => 'C'}
if RUBY_PLATFORM =~ /mswin|mingw32|windows/
require 'mixlib/shellout/windows'
@@ -84,7 +83,7 @@ module Mixlib
# Environment variables that will be set for the subcommand. Refer to the
# documentation of new to understand how ShellOut interprets this.
- attr_reader :environment
+ attr_accessor :environment
# The maximum time this command is allowed to run. Usually set via options
# to new
@@ -125,11 +124,7 @@ module Mixlib
# subprocess. This only has an effect if you call +error!+ after
# +run_command+.
# * +environment+: a Hash of environment variables to set before the command
- # is run. By default, the environment will *always* be set to 'LC_ALL' => 'C'
- # to prevent issues with multibyte characters in Ruby 1.8. To avoid this,
- # use :environment => nil for *no* extra environment settings, or
- # :environment => {'LC_ALL'=>nil, ...} to set other environment settings
- # without changing the locale.
+ # is run.
# * +timeout+: a Numeric value for the number of seconds to wait on the
# child process before raising an Exception. This is calculated as the
# total amount of time that ShellOut waited on the child process without
@@ -154,7 +149,7 @@ module Mixlib
@input = nil
@log_level = :debug
@log_tag = nil
- @environment = DEFAULT_ENVIRONMENT
+ @environment = {}
@cwd = nil
@valid_exit_codes = [0]
@terminate_reason = nil
@@ -315,13 +310,7 @@ module Mixlib
when 'log_tag'
self.log_tag = setting
when 'environment', 'env'
- # Set the LC_ALL from the parent process if the user wanted
- # to use the default.
- if setting && setting.has_key?("LC_ALL") && setting['LC_ALL'].nil?
- setting['LC_ALL'] = ENV['LC_ALL']
- end
- # passing :environment => nil means don't set any new ENV vars
- @environment = setting.nil? ? {} : @environment.dup.merge!(setting)
+ self.environment = setting || {}
else
raise InvalidCommandOption, "option '#{option.inspect}' is not a valid option for #{self.class.name}"
diff --git a/lib/mixlib/shellout/windows.rb b/lib/mixlib/shellout/windows.rb
index 2ae0256..137aaa9 100644
--- a/lib/mixlib/shellout/windows.rb
+++ b/lib/mixlib/shellout/windows.rb
@@ -200,7 +200,6 @@ module Mixlib
end
end
-
# cmd does not parse multiple quotes well unless the whole thing is wrapped up in quotes.
# https://github.com/opscode/mixlib-shellout/pull/2#issuecomment-4837859
# http://ss64.com/nt/syntax-esc.html