summaryrefslogtreecommitdiff
path: root/lib/bundler/gem_path_manipulation.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/gem_path_manipulation.rb')
-rw-r--r--lib/bundler/gem_path_manipulation.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bundler/gem_path_manipulation.rb b/lib/bundler/gem_path_manipulation.rb
new file mode 100644
index 0000000000..628d954c35
--- /dev/null
+++ b/lib/bundler/gem_path_manipulation.rb
@@ -0,0 +1,8 @@
+module Bundler
+ def self.preserve_gem_path
+ original_gem_path = ENV["_ORIGINAL_GEM_PATH"]
+ gem_path = ENV["GEM_PATH"]
+ ENV["_ORIGINAL_GEM_PATH"] = gem_path if original_gem_path.nil? || original_gem_path == ""
+ ENV["GEM_PATH"] = original_gem_path if gem_path.nil? || gem_path == ""
+ end
+end