aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/stub_specification.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-16 00:14:16 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-16 00:14:16 +0000
commit28918eac58eb6e2681d10839ac0d1430b2a4f1f9 (patch)
tree3c2c9e36118efe1d9406acdd14c186788879bea3 /lib/rubygems/stub_specification.rb
parentcfe1458078b8cf36e490c516977c52e1faa9e88a (diff)
downloadruby-28918eac58eb6e2681d10839ac0d1430b2a4f1f9.tar.gz
* lib/rubygems: Update to RubyGems master commit 2a74263. This fixes
several bugs in RubyGems 2.2.0.preview.1. * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/stub_specification.rb')
-rw-r--r--lib/rubygems/stub_specification.rb51
1 files changed, 50 insertions, 1 deletions
diff --git a/lib/rubygems/stub_specification.rb b/lib/rubygems/stub_specification.rb
index 08102b48ef..ffa2d3f964 100644
--- a/lib/rubygems/stub_specification.rb
+++ b/lib/rubygems/stub_specification.rb
@@ -41,6 +41,7 @@ class Gem::StubSpecification < Gem::BasicSpecification
def initialize(filename)
self.loaded_from = filename
@data = nil
+ @extensions = nil
@spec = nil
end
@@ -52,17 +53,31 @@ class Gem::StubSpecification < Gem::BasicSpecification
loaded && loaded.version == version
end
+ def build_extensions # :nodoc:
+ return if default_gem?
+ return if extensions.empty?
+
+ to_spec.build_extensions
+ end
+
##
# If the gemspec contains a stubline, returns a StubLine instance. Otherwise
# returns the full Gem::Specification.
def data
unless @data
+ @extensions = []
+
open loaded_from, OPEN_MODE do |file|
begin
file.readline # discard encoding line
stubline = file.readline.chomp
- @data = StubLine.new(stubline) if stubline.start_with?(PREFIX)
+ if stubline.start_with?(PREFIX) then
+ @data = StubLine.new stubline
+
+ @extensions = $'.split "\0" if
+ /\A#{PREFIX}/ =~ file.readline.chomp
+ end
rescue EOFError
end
end
@@ -74,6 +89,38 @@ class Gem::StubSpecification < Gem::BasicSpecification
private :data
##
+ # Extensions for this gem
+
+ def extensions
+ return @extensions if @extensions
+
+ data # load
+
+ @extensions
+ end
+
+ ##
+ # If a gem has a stub specification it doesn't need to bother with
+ # compatibility with original_name gems. It was installed with the
+ # normalized name.
+
+ def find_full_gem_path # :nodoc:
+ path = File.expand_path File.join gems_dir, full_name
+ path.untaint
+ path
+ end
+
+ ##
+ # Full paths in the gem to add to <code>$LOAD_PATH</code> when this gem is
+ # activated.
+
+ def full_require_paths
+ @require_paths ||= data.require_paths
+
+ super
+ end
+
+ ##
# Name of the gem
def name
@@ -92,6 +139,8 @@ class Gem::StubSpecification < Gem::BasicSpecification
def require_paths
@require_paths ||= data.require_paths
+
+ super
end
##