1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rubygems: Import RubyGems 2.1

* test/rubygems:  Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2013-07-09 23:21:36 +00:00
parent cd9f9e4719
commit 47f0248b08
113 changed files with 4964 additions and 2610 deletions

View file

@ -42,6 +42,20 @@ class Gem::NameTuple
new nil, Gem::Version.new(0), nil
end
##
# Returns the full name (name-version) of this Gem. Platform information is
# included if it is not the default Ruby platform. This mimics the behavior
# of Gem::Specification#full_name.
def full_name
case @platform
when nil, 'ruby', ''
"#{@name}-#{@version}"
else
"#{@name}-#{@version}-#{@platform}"
end
end
##
# Indicate if this NameTuple matches the current platform.
@ -59,12 +73,7 @@ class Gem::NameTuple
# Return the name that the gemspec file would be
def spec_name
case @platform
when nil, 'ruby', ''
"#{@name}-#{@version}.gemspec"
else
"#{@name}-#{@version}-#{@platform}.gemspec"
end
"#{full_name}.gemspec"
end
##
@ -74,10 +83,12 @@ class Gem::NameTuple
[@name, @version, @platform]
end
def to_s
def inspect # :nodoc:
"#<Gem::NameTuple #{@name}, #{@version}, #{@platform}>"
end
alias to_s inspect # :nodoc:
def <=> other
to_a <=> other.to_a
end