diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-12-05 19:03:20 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-07-27 09:25:56 +0900 |
commit | 88e46cf6b83e2ca701cf122756fef9bc2550e845 (patch) | |
tree | 7ae3b612120e82cf36d78ce691bd8c7463a31bc7 /lib/rubygems/requirement.rb | |
parent | 6bcedabfdde74a21b8e1c93ec639afbb9698474b (diff) | |
download | ruby-88e46cf6b83e2ca701cf122756fef9bc2550e845.tar.gz |
[rubygems/rubygems] Remove all `syck` traces from `rubygems`
After reading [this blog
post](https://blog.rubygems.org/2011/08/31/shaving-the-yaml-yak.html),
published almost 10 years ago already, my understanding is that this
problem could come up in two ways:
* Rubygems.org serving corrupted gemspecs". As far as I understand this
was fixed in rubygems.org a lot time ago, since
https://github.com/rubygems/rubygems.org/pull/331.
* Clients having a ten years old gemspec cache with some of these bad
gemspecs. In this case, there's no easy solution but I think ten years
is enough and rebuilding the cache should do the trick.
So, I think it's time we remove this.
https://github.com/rubygems/rubygems/commit/afcb15d556
Diffstat (limited to 'lib/rubygems/requirement.rb')
-rw-r--r-- | lib/rubygems/requirement.rb | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/rubygems/requirement.rb b/lib/rubygems/requirement.rb index 6721de4055..0067f6304a 100644 --- a/lib/rubygems/requirement.rb +++ b/lib/rubygems/requirement.rb @@ -194,24 +194,17 @@ class Gem::Requirement end def marshal_dump # :nodoc: - fix_syck_default_key_in_requirements - [@requirements] end def marshal_load(array) # :nodoc: @requirements = array[0] - - fix_syck_default_key_in_requirements end def yaml_initialize(tag, vals) # :nodoc: vals.each do |ivar, val| instance_variable_set "@#{ivar}", val end - - Gem.load_yaml - fix_syck_default_key_in_requirements end def init_with(coder) # :nodoc: @@ -246,8 +239,7 @@ class Gem::Requirement def satisfied_by?(version) raise ArgumentError, "Need a Gem::Version: #{version.inspect}" unless Gem::Version === version - # #28965: syck has a bug with unquoted '=' YAML.loading as YAML::DefaultKey - requirements.all? {|op, rv| (OPS[op] || OPS["="]).call version, rv } + requirements.all? {|op, rv| OPS[op].call version, rv } end alias :=== :satisfied_by? @@ -289,19 +281,6 @@ class Gem::Requirement def _tilde_requirements @_tilde_requirements ||= _sorted_requirements.select {|r| r.first == "~>" } end - - private - - def fix_syck_default_key_in_requirements # :nodoc: - Gem.load_yaml - - # Fixup the Syck DefaultKey bug - @requirements.each do |r| - if r[0].kind_of? Gem::SyckDefaultKey - r[0] = "=" - end - end - end end class Gem::Version |