diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-19 00:34:13 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-19 00:34:13 +0000 |
commit | a7fa4d5d9aab150ad4b0c3f3217fe444df69f527 (patch) | |
tree | 88ab96d22f7228b556337aa7c34042d4fd279394 /lib/rubygems.rb | |
parent | e7ec3dad907f2c77f17faddb40a98b2ef4523222 (diff) | |
download | ruby-a7fa4d5d9aab150ad4b0c3f3217fe444df69f527.tar.gz |
* lib/rubygems: Update to RubyGems master 6a3d9f9. Changes include:
Compatibly renamed Gem::DependencyResolver to Gem::Resolver.
Added support for git gems in gem.deps.rb and Gemfile.
Fixed resolver bugs.
* test/rubygems: ditto.
* lib/rubygems/LICENSE.txt: Updated to license from RubyGems trunk.
[ruby-trunk - Bug #9086]
* lib/rubygems/commands/which_command.rb: RubyGems now indicates
failure when any file is missing. [ruby-trunk - Bug #9004]
* lib/rubygems/ext/builder: Extensions are now installed into the
extension install directory and the first directory in the require
path from the gem. This allows backwards compatibility with msgpack
and other gems that calculate full require paths.
[ruby-trunk - Bug #9106]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r-- | lib/rubygems.rb | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb index 1c84356bd7..2e8ad7bba1 100644 --- a/lib/rubygems.rb +++ b/lib/rubygems.rb @@ -8,7 +8,7 @@ require 'rbconfig' module Gem - VERSION = '2.2.0' + VERSION = '2.2.0.preview.2' end # Must be first since it unloads the prelude from 1.9.2 @@ -302,7 +302,6 @@ module Gem # The path where gem executables are to be installed. def self.bindir(install_dir=Gem.dir) - # TODO: move to Gem::Dirs return File.join install_dir, 'bin' unless install_dir.to_s == Gem.default_dir.to_s Gem.default_bindir @@ -362,16 +361,21 @@ module Gem Zlib::Deflate.deflate data end - # DOC: needs doc'd or :nodoc'd + # Retrieve the PathSupport object that RubyGems uses to + # lookup files. + def self.paths @paths ||= Gem::PathSupport.new end - # DOC: needs doc'd or :nodoc'd + # Initialize the filesystem paths to use from +env+. + # +env+ is a hash-like object (typically ENV) that + # is queried for 'GEM_HOME', 'GEM_PATH', and 'GEM_SPEC_CACHE' + def self.paths=(env) clear_paths @paths = Gem::PathSupport.new env - Gem::Specification.dirs = @paths.path # FIX: home is at end + Gem::Specification.dirs = @paths.path end ## @@ -380,12 +384,10 @@ module Gem # FIXME deprecate these once everything else has been done -ebh def self.dir - # TODO: raise "no" paths.home end def self.path - # TODO: raise "no" paths.path end @@ -552,42 +554,30 @@ module Gem private_class_method :find_home + # FIXME deprecate these in 3.0 + ## # Zlib::GzipReader wrapper that unzips +data+. def self.gunzip(data) - # TODO: move to utils - require 'stringio' - require 'zlib' - data = StringIO.new data - - unzipped = Zlib::GzipReader.new(data).read - unzipped.force_encoding Encoding::BINARY if Object.const_defined? :Encoding - unzipped + require 'rubygems/util' + Gem::Util.gunzip data end ## # Zlib::GzipWriter wrapper that zips +data+. def self.gzip(data) - # TODO: move to utils - require 'stringio' - require 'zlib' - zipped = StringIO.new - zipped.set_encoding Encoding::BINARY if Object.const_defined? :Encoding - - Zlib::GzipWriter.wrap zipped do |io| io.write data end - - zipped.string + require 'rubygems/util' + Gem::Util.gzip data end ## # A Zlib::Inflate#inflate wrapper def self.inflate(data) - # TODO: move to utils - require 'zlib' - Zlib::Inflate.inflate data + require 'rubygems/util' + Gem::Util.inflate data end ## @@ -693,7 +683,6 @@ module Gem file = $1 lineno = $2.to_i - # TODO: it is ALWAYS joined! STUPID! [file, lineno] end @@ -974,7 +963,6 @@ module Gem paths = nil if paths == [nil] paths = paths.first if Array === Array(paths).first self.paths = { "GEM_HOME" => home, "GEM_PATH" => paths } - # TODO: self.paths = home, paths end ## @@ -1169,7 +1157,8 @@ module Gem autoload :ConfigFile, 'rubygems/config_file' autoload :Dependency, 'rubygems/dependency' autoload :DependencyList, 'rubygems/dependency_list' - autoload :DependencyResolver, 'rubygems/dependency_resolver' + autoload :Resolver, 'rubygems/resolver' + autoload :DependencyResolver, 'rubygems/resolver' autoload :PathSupport, 'rubygems/path_support' autoload :Platform, 'rubygems/platform' autoload :RequestSet, 'rubygems/request_set' |