diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-14 03:30:02 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-14 03:30:02 +0000 |
commit | 4de117a61517e839f2c45eaf45d56fc243d6d5b2 (patch) | |
tree | 7cb5af7a7eb513e5dddf5e343746b1611e628387 /lib/rubygems/basic_specification.rb | |
parent | e548c09d429a5136285ea81aed418685359ed124 (diff) | |
download | ruby-4de117a61517e839f2c45eaf45d56fc243d6d5b2.tar.gz |
* 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
Diffstat (limited to 'lib/rubygems/basic_specification.rb')
-rw-r--r-- | lib/rubygems/basic_specification.rb | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/rubygems/basic_specification.rb b/lib/rubygems/basic_specification.rb index 470a6ebc8b..f9eb193fb4 100644 --- a/lib/rubygems/basic_specification.rb +++ b/lib/rubygems/basic_specification.rb @@ -15,6 +15,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. attr_reader :loaded_from @@ -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? - - relative_extension_dir = - File.join '..', '..', 'extensions', Gem::Platform.local.to_s, - Gem.extension_api_version, full_name + return raw_require_paths if @extensions.nil? || @extensions.empty? - [relative_extension_dir].concat @require_paths + [extension_dir].concat raw_require_paths end ## |