Method: Gem.use_paths

Defined in:
lib/rubygems.rb

.use_paths(home, *paths) ⇒ Object

Use the home and paths values for Gem.dir and Gem.path. Used mainly by the unit tests to provide environment isolation.


1015
1016
1017
1018
1019
1020
1021
# File 'lib/rubygems.rb', line 1015

def self.use_paths(home, *paths)
  paths.flatten!
  paths.compact!
  hash = { "GEM_HOME" => home, "GEM_PATH" => paths.empty? ? home : paths.join(File::PATH_SEPARATOR) }
  hash.delete_if {|_, v| v.nil? }
  self.paths = hash
end