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:
parent
9c4ef4b191
commit
effdbf5936
90 changed files with 2489 additions and 1159 deletions
|
@ -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]
|
||||
end
|
||||
|
||||
def platform
|
||||
Gem::Platform.new @parts[2]
|
||||
end
|
||||
|
||||
def require_paths
|
||||
@parts[3..-1].join(" ").split("\0")
|
||||
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 initialize(filename)
|
||||
def self.default_gemspec_stub filename
|
||||
new filename, true
|
||||
end
|
||||
|
||||
def self.gemspec_stub filename
|
||||
new filename, false
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue