1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rubygems: Update to RubyGems HEAD(c202db2).

this version contains many enhancements see http://git.io/vtNwF
* test/rubygems: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2015-07-01 21:50:14 +00:00
parent 9c4ef4b191
commit effdbf5936
90 changed files with 2489 additions and 1159 deletions

View file

@ -22,13 +22,17 @@ class Gem::BasicSpecification
##
# The path this gemspec was loaded from. This attribute is not persisted.
attr_reader :loaded_from
attr_accessor :loaded_from
##
# Allows correct activation of git: and path: gems.
attr_writer :full_gem_path # :nodoc:
def initialize
internal_init
end
def self.default_specifications_dir
File.join(Gem.default_dir, "specifications", "default")
end
@ -141,7 +145,7 @@ class Gem::BasicSpecification
@full_require_paths ||=
begin
full_paths = raw_require_paths.map do |path|
File.join full_gem_path, path
File.join full_gem_path, path.untaint
end
full_paths << extension_dir unless @extensions.nil? || @extensions.empty?
@ -189,13 +193,7 @@ class Gem::BasicSpecification
@gems_dir ||= File.join(loaded_from && base_dir || Gem.dir, "gems")
end
##
# Set the path the Specification was loaded from. +path+ is converted to a
# String.
def loaded_from= path
@loaded_from = path && path.to_s
def internal_init # :nodoc:
@extension_dir = nil
@extensions_dir = nil
@full_gem_path = nil
@ -263,6 +261,30 @@ class Gem::BasicSpecification
paths.uniq
end
##
# Return all files in this gem that match for +glob+.
def matches_for_glob glob # TODO: rename?
# TODO: do we need these?? Kill it
glob = File.join(self.lib_dirs_glob, glob)
Dir[glob].map { |f| f.untaint } # FIX our tests are broken, run w/ SAFE=1
end
##
# Returns a string usable in Dir.glob to match all requirable paths
# for this spec.
def lib_dirs_glob
dirs = if self.require_paths.size > 1 then
"{#{self.require_paths.join(',')}}"
else
self.require_paths.first
end
"#{self.full_gem_path}/#{dirs}"
end
##
# Return a Gem::Specification from this gem