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.


1068
1069
1070
1071
1072
1073
1074
# File 'lib/rubygems.rb', line 1068

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