Class: Gem::PathSupport
- Inherits:
-
Object
- Object
- Gem::PathSupport
- Defined in:
- lib/rubygems/path_support.rb
Overview
Gem::PathSupport facilitates the GEM_HOME and GEM_PATH environment settings to the rest of RubyGems.
Instance Attribute Summary collapse
-
#home ⇒ Object
readonly
The default system path for managing Gems.
-
#path ⇒ Object
readonly
Array of paths to search for Gems.
Instance Method Summary collapse
-
#initialize(env = ENV) ⇒ PathSupport
constructor
Constructor.
Constructor Details
#initialize(env = ENV) ⇒ PathSupport
Constructor. Takes a single argument which is to be treated like a hashtable, or defaults to ENV, the system environment.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rubygems/path_support.rb', line 19 def initialize(env=ENV) @env = env # note 'env' vs 'ENV'... @home = env["GEM_HOME"] || ENV["GEM_HOME"] || Gem.default_dir if File::ALT_SEPARATOR then @home = @home.gsub(File::ALT_SEPARATOR, File::SEPARATOR) end self.path = env["GEM_PATH"] || ENV["GEM_PATH"] end |
Instance Attribute Details
#home ⇒ Object
The default system path for managing Gems.
8 9 10 |
# File 'lib/rubygems/path_support.rb', line 8 def home @home end |
#path ⇒ Object
Array of paths to search for Gems.
12 13 14 |
# File 'lib/rubygems/path_support.rb', line 12 def path @path end |