lib/bundler.rb in bundler-1.1.pre.2 vs lib/bundler.rb in bundler-1.1.pre.3

- old
+ new

@@ -183,15 +183,30 @@ def settings @settings ||= Settings.new(app_config_path) end - def with_clean_env + def with_original_env bundled_env = ENV.to_hash ENV.replace(ORIGINAL_ENV) yield ensure ENV.replace(bundled_env.to_hash) + end + + def with_clean_env + with_original_env do + ENV.delete_if { |k,_| k[0,7] == 'BUNDLE_' } + yield + end + end + + def clean_system(*args) + with_clean_env { Kernel.system(*args) } + end + + def clean_exec(*args) + with_clean_env { Kernel.exec(*args) } end def default_gemfile SharedHelpers.default_gemfile end