Граф коммитов

16 Коммитов

Автор SHA1 Сообщение Дата
Aaron Patterson c7c2ad5749
[ruby/psych] Introduce `Psych.unsafe_load`
In future versions of Psych, the `load` method will be mostly the same
as the `safe_load` method.  In other words, the `load` method won't
allow arbitrary object deserialization (which can be used to escalate to
an RCE).  People that need to load *trusted* documents can use the
`unsafe_load` method.

This commit introduces the `unsafe_load` method so that people can
incrementally upgrade.  For example, if they try to upgrade to 4.0.0 and
something breaks, they can downgrade, audit callsites, change to
`safe_load` or `unsafe_load` as required, and then upgrade to 4.0.0
smoothly.

https://github.com/ruby/psych/commit/cb50aa8d3f
2021-05-17 11:20:45 +09:00
Hiroshi SHIBATA bae9a21e40 [ruby/psych] Use pend instead of skip
https://github.com/ruby/psych/commit/efd2a62c9a
2021-05-10 18:53:56 +09:00
Jean Boussier 6ca7dc69ef [ruby/psych] Deduplicate hash keys if they're strings
https://github.com/ruby/psych/commit/0414982ffd
2019-07-25 07:52:16 +09:00
Jordan Owens 0016edbead Add test to demonstrate issue deserializing hash with ivar
Currently the elements of a hash are revived before any ivar values.
This causes an issue when the `[]=` method references an instance
variable.
2019-06-25 15:56:20 +09:00
hsbt 0b396d5880 Merge psych-3.0.0.beta3 from ruby/psych.
* Rely on encoding tags to determine if string should be dumped as binary.
    8949a47b8c
  * Specify "frozen_string_literal: true".
  * Support to binary release for mingw32 platform.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-14 06:15:58 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
tenderlove 6ce27adabe * ext/psych/lib/psych/visitors/to_ruby.rb: fix parsing hashes with
instance variables when it is referenced multiple times.
* ext/psych/lib/psych.rb: bump version
* ext/psych/psych.gemspec: bump version
* test/psych/test_hash.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-28 17:37:09 +00:00
tenderlove fe0414b547 * ext/psych/lib/psych/visitors/yaml_tree.rb: only dump hash
subclasses. Thanks Joe Eli McIlvain <joe.eli.mac@gmail.com>

* test/psych/test_hash.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-16 06:39:13 +00:00
tenderlove 5dabead187 * ext/psych/lib/psych/visitors/to_ruby.rb: call `allocate` on hash
subclasses.  Fixes github.com/tenderlove/psych/issues/196

* test/psych/test_hash.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-08 22:15:20 +00:00
tenderlove 8c08c8298a * ext/psych/lib/psych/visitors/to_ruby.rb: revive hashes with ivars
* ext/psych/lib/psych/visitors/yaml_tree.rb: dump hashes with ivars.
  Fixes github.com/psych/issues/43

* test/psych/test_hash.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-08 22:00:54 +00:00
tenderlove 0b392535df * ext/psych/lib/psych/visitors/to_ruby.rb: backwards compatibility for
hashes emitted by Syck. Github #198
* test/psych/test_hash.rb: test for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-05 18:41:46 +00:00
xibbar d85bf93776 * test/psych/test_*.rb: use require_relative to require local library
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-26 14:55:04 +00:00
tenderlove 8cd2bf0721 * ext/psych/lib/psych/visitors/to_ruby.rb: Hash subclasses can be read
from YAML files.
* ext/psych/lib/psych/visitors/yaml_tree.rb: Hash subclasses can be
  dumped to YAML files.
* test/psych/test_hash.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09 01:58:07 +00:00
tenderlove 9e448999a0 converting require_relative to just regular requires
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-30 03:38:53 +00:00
tenderlove 03399d9001 * test/psych/*: switching tests to use relative require.
[ruby-core:29104]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-29 18:25:57 +00:00
tenderlove b9b923ca94 * ext/psych/*: importing Psych to trunk
* test/psych/*: ditto
* lib/psych/*: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-28 21:49:37 +00:00