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.
1024 1025 1026 1027 1028 1029 1030 |
# File 'lib/rubygems.rb', line 1024 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 |