Class | Gem::PathSupport |
In: |
lib/rubygems/path_support.rb
|
Parent: | Object |
Gem::PathSupport facilitates the GEM_HOME and GEM_PATH environment settings to the rest of RubyGems.
home | [R] | The default system path for managing Gems. |
path | [R] | Array of paths to search for Gems. |
Constructor. Takes a single argument which is to be treated like a hashtable, or defaults to ENV, the system environment.
# File lib/rubygems/path_support.rb, line 19 19: def initialize(env=ENV) 20: @env = env 21: 22: # note 'env' vs 'ENV'... 23: @home = env["GEM_HOME"] || ENV["GEM_HOME"] || Gem.default_dir 24: 25: if File::ALT_SEPARATOR then 26: @home = @home.gsub(File::ALT_SEPARATOR, File::SEPARATOR) 27: end 28: 29: self.path = env["GEM_PATH"] || ENV["GEM_PATH"] 30: end