mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: Update to RubyGems 1.8.22 plus r33517 and r35337 which
were ported to the rubygems git repository. See https://github.com/rubygems/rubygems/blob/1.8/History.txt for changes since 1.8.11. * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5ab11990cb
commit
6c1da63bd7
36 changed files with 1084 additions and 153 deletions
|
|
@ -1,35 +1,18 @@
|
|||
require "rubygems/version"
|
||||
|
||||
# :stopdoc:
|
||||
|
||||
# Hack to handle syck's DefaultKey bug with psych
|
||||
#
|
||||
# Quick note! If/when psych loads in 1.9, it will redefine
|
||||
# YAML to point to Psych by removing the YAML constant.
|
||||
# Thusly, over in Gem.load_yaml, we define DefaultKey again
|
||||
# after proper yaml library has been loaded.
|
||||
#
|
||||
# All this is so that there is always a YAML::Syck::DefaultKey
|
||||
# class no matter if the full yaml library has loaded or not.
|
||||
#
|
||||
module YAML
|
||||
if !defined? Syck
|
||||
module Syck
|
||||
class DefaultKey
|
||||
def to_s
|
||||
'='
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# :startdoc:
|
||||
|
||||
##
|
||||
# A Requirement is a set of one or more version restrictions. It supports a
|
||||
# few (<tt>=, !=, >, <, >=, <=, ~></tt>) different restriction operators.
|
||||
|
||||
# REFACTOR: The fact that a requirement is singular or plural is kind of
|
||||
# awkward. Is Requirement the right name for this? Or should it be one
|
||||
# [op, number] pair, and we call the list of requirements something else?
|
||||
# Since a Requirement is held by a Dependency, maybe this should be made
|
||||
# singular and the list aspect should be pulled up into Dependency?
|
||||
|
||||
require "rubygems/version"
|
||||
require "rubygems/deprecate"
|
||||
|
||||
class Gem::Requirement
|
||||
include Comparable
|
||||
|
||||
|
|
@ -147,6 +130,18 @@ class Gem::Requirement
|
|||
fix_syck_default_key_in_requirements
|
||||
end
|
||||
|
||||
def yaml_initialize(tag, vals) # :nodoc:
|
||||
vals.each do |ivar, val|
|
||||
instance_variable_set "@#{ivar}", val
|
||||
end
|
||||
|
||||
fix_syck_default_key_in_requirements
|
||||
end
|
||||
|
||||
def init_with coder # :nodoc:
|
||||
yaml_initialize coder.tag, coder.map
|
||||
end
|
||||
|
||||
def prerelease?
|
||||
requirements.any? { |r| r.last.prerelease? }
|
||||
end
|
||||
|
|
@ -188,9 +183,11 @@ class Gem::Requirement
|
|||
private
|
||||
|
||||
def fix_syck_default_key_in_requirements
|
||||
Gem.load_yaml
|
||||
|
||||
# Fixup the Syck DefaultKey bug
|
||||
@requirements.each do |r|
|
||||
if r[0].kind_of? YAML::Syck::DefaultKey
|
||||
if r[0].kind_of? Gem::SyckDefaultKey
|
||||
r[0] = "="
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue