summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems.rb48
1 files changed, 35 insertions, 13 deletions
@@ -6,9 +6,10 @@
#++
require 'rbconfig'
module Gem
- VERSION = '2.2.2'
end
# Must be first since it unloads the prelude from 1.9.2
@@ -56,8 +57,8 @@ require 'rubygems/errors'
# RubyGems defaults are stored in rubygems/defaults.rb. If you're packaging
# RubyGems or implementing Ruby you can change RubyGems' defaults.
#
-# For RubyGems packagers, provide lib/rubygems/operating_system.rb and
-# override any defaults from lib/rubygems/defaults.rb.
#
# For Ruby implementers, provide lib/rubygems/defaults/#{RUBY_ENGINE}.rb and
# override any defaults from lib/rubygems/defaults.rb.
@@ -83,7 +84,7 @@ require 'rubygems/errors'
# * Chad Fowler -- chad(at)chadfowler.com
# * David Black -- dblack(at)wobblini.net
# * Paul Brannan -- paul(at)atdesk.com
-# * Jim Weirich -- jim(at)weirichhouse.org
#
# Contributors:
#
@@ -156,6 +157,7 @@ module Gem
@configuration = nil
@loaded_specs = {}
@path_to_default_spec_map = {}
@platforms = []
@ruby = nil
@@ -298,7 +300,7 @@ module Gem
end
##
- # The path the the data directory specified by the gem name. If the
# package is not available as a gem, return nil.
def self.datadir(gem_name)
@@ -544,9 +546,9 @@ module Gem
# Fetching: minitest-3.0.1.gem (100%)
# => [#<Gem::Specification:0x1013b4528 @name="minitest", ...>]
- def self.install name, version = Gem::Requirement.default, **options
require "rubygems/dependency_installer"
- inst = Gem::DependencyInstaller.new(**options)
inst.install name, version
inst.installed_gems
end
@@ -995,19 +997,31 @@ module Gem
end
##
- # Looks for gem dependency files (gem.deps.rb, Gemfile, Isolate) from the
- # current directory up and activates the gems in the first file found.
#
# You can run this automatically when rubygems starts. To enable, set
# the <code>RUBYGEMS_GEMDEPS</code> environment variable to either the path
- # of your Gemfile or "-" to auto-discover in parent directories.
#
# NOTE: Enabling automatic discovery on multiuser systems can lead to
# execution of arbitrary code when used from directories outside your
# control.
- def self.use_gemdeps
- return unless path = ENV['RUBYGEMS_GEMDEPS']
path = path.dup
if path == "-" then
@@ -1025,7 +1039,11 @@ module Gem
path.untaint
- return unless File.file? path
rs = Gem::RequestSet.new
rs.load_gemdeps path
@@ -1035,6 +1053,10 @@ module Gem
sp.activate
sp
end
end
class << self