mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: Update to RubyGems 2.4.1 master(713ab65)
Complete history at: https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e548c09d42
commit
4de117a615
153 changed files with 5400 additions and 981 deletions
|
@ -14,6 +14,11 @@ class Gem::BasicSpecification
|
|||
|
||||
attr_writer :extension_dir # :nodoc:
|
||||
|
||||
##
|
||||
# Is this specification ignored for activation purposes?
|
||||
|
||||
attr_writer :ignored # :nodoc:
|
||||
|
||||
##
|
||||
# The path this gemspec was loaded from. This attribute is not persisted.
|
||||
|
||||
|
@ -53,7 +58,16 @@ class Gem::BasicSpecification
|
|||
# Return true if this spec can require +file+.
|
||||
|
||||
def contains_requirable_file? file
|
||||
build_extensions
|
||||
if instance_variable_defined?(:@ignored) or
|
||||
instance_variable_defined?('@ignored') then
|
||||
return false
|
||||
elsif missing_extensions? then
|
||||
@ignored = true
|
||||
|
||||
warn "Ignoring #{full_name} because its extensions are not built. " +
|
||||
"Try: gem pristine #{full_name}"
|
||||
return false
|
||||
end
|
||||
|
||||
suffixes = Gem.suffixes
|
||||
|
||||
|
@ -120,11 +134,11 @@ class Gem::BasicSpecification
|
|||
# activated.
|
||||
|
||||
def full_require_paths
|
||||
full_paths = @require_paths.map do |path|
|
||||
full_paths = raw_require_paths.map do |path|
|
||||
File.join full_gem_path, path
|
||||
end
|
||||
|
||||
full_paths.unshift extension_dir unless @extensions.empty?
|
||||
full_paths.unshift extension_dir unless @extensions.nil? || @extensions.empty?
|
||||
|
||||
full_paths
|
||||
end
|
||||
|
@ -176,7 +190,7 @@ class Gem::BasicSpecification
|
|||
end
|
||||
|
||||
def raw_require_paths # :nodoc:
|
||||
@require_paths
|
||||
Array(@require_paths)
|
||||
end
|
||||
|
||||
##
|
||||
|
@ -197,13 +211,9 @@ class Gem::BasicSpecification
|
|||
# spec.require_path = '.'
|
||||
|
||||
def require_paths
|
||||
return @require_paths if @extensions.empty?
|
||||
return raw_require_paths if @extensions.nil? || @extensions.empty?
|
||||
|
||||
relative_extension_dir =
|
||||
File.join '..', '..', 'extensions', Gem::Platform.local.to_s,
|
||||
Gem.extension_api_version, full_name
|
||||
|
||||
[relative_extension_dir].concat @require_paths
|
||||
[extension_dir].concat raw_require_paths
|
||||
end
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue