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.



1010
1011
1012
1013
1014
1015
1016
# File 'lib/rubygems.rb', line 1010

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