From effdbf5936cc090a618e13c8f9a1b5412ebab2fa Mon Sep 17 00:00:00 2001 From: hsbt Date: Wed, 1 Jul 2015 21:50:14 +0000 Subject: * 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 --- lib/rubygems/stub_specification.rb | 39 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'lib/rubygems/stub_specification.rb') diff --git a/lib/rubygems/stub_specification.rb b/lib/rubygems/stub_specification.rb index b184d29d5e..ed07e8011f 100644 --- a/lib/rubygems/stub_specification.rb +++ b/lib/rubygems/stub_specification.rb @@ -15,35 +15,32 @@ class Gem::StubSpecification < Gem::BasicSpecification end class StubLine # :nodoc: all - attr_reader :parts + attr_reader :name, :version, :platform, :require_paths def initialize(data) - @parts = data[PREFIX.length..-1].split(" ") - end - - def name - @parts[0] - end - - def version - Gem::Version.new @parts[1] + parts = data[PREFIX.length..-1].split(" ") + @name = parts[0] + @version = Gem::Version.new parts[1] + @platform = Gem::Platform.new parts[2] + @require_paths = parts.drop(3).join(" ").split("\0") end + end - def platform - Gem::Platform.new @parts[2] - end + def self.default_gemspec_stub filename + new filename, true + end - def require_paths - @parts[3..-1].join(" ").split("\0") - end + def self.gemspec_stub filename + new filename, false end - def initialize(filename) + def initialize filename, default_gem self.loaded_from = filename @data = nil @extensions = nil @name = nil @spec = nil + @default_gem = default_gem end ## @@ -57,6 +54,10 @@ class Gem::StubSpecification < Gem::BasicSpecification end end + def default_gem? + @default_gem + end + def build_extensions # :nodoc: return if default_gem? return if extensions.empty? @@ -135,14 +136,14 @@ class Gem::StubSpecification < Gem::BasicSpecification # Name of the gem def name - @name ||= data.name + data.name end ## # Platform of the gem def platform - @platform ||= data.platform + data.platform end ## -- cgit v1.2.3