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

385 Коммитов

Автор SHA1 Сообщение Дата
Rhys Powell e99d2d066f [ruby/psych] fix: use git repository link for LibYAML in docs
LibYAML has moved from their previous Mercurial based hosting on BitBucket to a git repository on GitHub. This commit updates the `Psych` module's documentation to point to this new repository, instead of the old one which is now a 404.

https://github.com/ruby/psych/commit/947a84d0dd
2021-07-29 15:54:41 +09:00
Hiroshi SHIBATA 85b94144f2
[ruby/psych] Bump version to 4.0.1
https://github.com/ruby/psych/commit/4049939006
2021-06-07 19:15:14 +09:00
Jean Boussier fd6225c7a9
[ruby/psych] Implement YAML.safe_dump to make safe_load more usable.
In case where Psych is used as a two way serializers,
e.g. to serialize some cache or config, it is preferable
to have the same restrictions on both load and dump.

Otherwise you might dump and persist some objects payloads
that you later won't be able to read.

https://github.com/ruby/psych/commit/441958396f
2021-06-07 19:15:14 +09:00
Yusuke Endoh 430883158f
[ruby/psych] Make YAML.load_file use YAML.load instead of safe_load
YAML.load and YAML.safe_load are different a little; the former allows
Symbol by default but the latter doesn't. So YAML.load_file and
YAML.safe_load_file should reflect the difference.

Fixes #490

https://github.com/ruby/psych/commit/f8a5e512a1
2021-06-07 19:15:14 +09:00
Aaron Patterson 42b20bdbfe
[ruby/psych] remove deprecated interface
https://github.com/ruby/psych/commit/0767227051
2021-05-17 11:20:46 +09:00
Aaron Patterson b0e21197ce
[ruby/psych] Bump version
https://github.com/ruby/psych/commit/1df86a2e81
2021-05-17 11:20:46 +09:00
Aaron Patterson fbb4e3f96c
[ruby/psych] Use Psych.safe_load by default
Psych.load is not safe for use with untrusted data.  Too many
applications make the mistake of using `Psych.load` with untrusted data
and that ends up with some kind of security vulnerability.

This commit changes the default `Psych.load` to use `safe_load`.  Users
that want to parse trusted data can use Psych.unsafe_load.

https://github.com/ruby/psych/commit/176494297f
2021-05-17 11:20:45 +09:00
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
Jean Boussier a3ceed50b8
[ruby/psych] Fix symabolize_name with non-string keys
https://github.com/ruby/psych/commit/1c5c29e81f
2021-05-17 11:20:45 +09:00
Jeremy Ebler 830778db95
[ruby/psych] feat: allow scalars and sequences to be styled when dumped
https://github.com/ruby/psych/commit/546154ddb7
2021-05-17 11:20:45 +09:00
Ryuta Kamizono 73136ebbde
[ruby/psych] Fix some typos [ci skip]
https://github.com/ruby/psych/commit/98617e55a1
2021-05-10 19:19:35 +09:00
Aaron Patterson b7250026dd
[ruby/psych] bump version
https://github.com/ruby/psych/commit/091cd46b1f
2021-05-10 19:19:35 +09:00
Tim Gates 954970162c
[ruby/psych] docs: fix simple typo, expessed -> expressed
There is a small typo in ext/psych/yaml/yaml.h.

Should read `expressed` rather than `expessed`.

https://github.com/ruby/psych/commit/1150d669cb
2021-05-10 19:19:35 +09:00
Charles Oliver Nutter 1563de5997
[ruby/psych] Update to latest SnakeYAML
Fixes jruby/jruby#6365

https://github.com/ruby/psych/commit/a88ff77f02
2021-05-10 19:19:35 +09:00
Jean Boussier c110ade0d2
[ruby/psych] Fix custom marshalization with symbolize_names: true
https://github.com/ruby/psych/commit/ee26f26ab5
2021-05-10 19:17:32 +09:00
Jean Boussier 155cd7fd2a
[ruby/psych] Cache dispatch cache in an instance variable
https://github.com/ruby/psych/commit/285c461cd2
2021-05-10 19:17:32 +09:00
Jean Boussier 3ab41acd36
[ruby/psych] Cache access to Psych.load_tags in Visitor::ToRuby
https://github.com/ruby/psych/commit/58223f0426
2021-05-10 19:17:32 +09:00
Benoit Daloze 0764d323d8 Fix -Wundef warnings for patterns `#if HAVE`
* See [Feature #17752]
* Using this to detect them:
  git grep -P 'if\s+HAVE' | grep -Pv 'HAVE_LONG_LONG|/ChangeLog|HAVE_TYPEOF'
2021-05-04 14:56:55 +02:00
卜部昌平 6413dc27dc dependency updates 2021-04-13 14:30:21 +09:00
Nobuyoshi Nakada 94d564077c
Text files should end with a newline 2021-03-30 23:41:21 +09:00
Samuel Williams 5f69a7f604
Expose scheduler as public interface & bug fixes. (#3945)
* Rename `rb_scheduler` to `rb_fiber_scheduler`.

* Use public interface if available.

* Use `rb_check_funcall` where possible.

* Don't use `unblock` unless the fiber was non-blocking.
2021-02-09 19:39:56 +13:00
Hiroshi SHIBATA 684649ea05 [ruby/psych] Bump version to 3.3.0
https://github.com/ruby/psych/commit/0abce07b90
2020-12-23 19:53:21 +09:00
Marc-Andre Lafortune daec109f42 [ruby/psych] Optimize cache with `compare_by_identity`
Using `compare_by_identity` gives a 4x performance boost on cache hits.
Benchmark in https://github.com/JuanitoFatas/fast-ruby/issues/189
2020-12-23 01:08:38 -05:00
Marc-Andre Lafortune c5a445d577 [ruby/psych] Make Ractor-ready.
Config is Ractor-local.

Benchmarking reveals that using `Ractor.local_storage` for storing cache
is similar to accessing a constant (~15% slower).
2020-12-23 01:08:38 -05:00
Marc-Andre Lafortune 3ee0ad9190 [ruby/psych] Don't use instance variables directly for config 2020-12-23 01:08:38 -05:00
Marc-Andre Lafortune d1963adae8 [ruby/psych] Avoid methods depending on bindings
Improves Ractor-readiness.
2020-12-23 01:08:38 -05:00
Marc-Andre Lafortune 0eb94dae4a [ruby/psych] Freeze constants.
Improves Ractor-readiness.
2020-12-23 01:08:38 -05:00
Nobuyoshi Nakada 5c9d6ea6b4
Strip trailing spaces [ci skip] 2020-12-19 15:34:37 +09:00
Hiroshi SHIBATA c2a60fec2f
Merge Psych-3.2.1 from ruby/psych 2020-12-14 20:13:12 +09:00
Nobuyoshi Nakada 21b199bb24
Appended a newline to suppress newline-eof warning 2020-10-06 23:18:42 +09:00
Jean Boussier b72f9200ac
[ruby/psych] Forward keyword arguments in load_file and load_stream
https://github.com/ruby/psych/commit/4e1dd37f09
2020-09-25 13:11:33 +09:00
Hiroshi SHIBATA 8ea1021f19
[ruby/psych] Bump version to 3.2.0
https://github.com/ruby/psych/commit/181a727c90
2020-09-25 13:11:33 +09:00
SzymonKowalczyk 263c43487f
[ruby/psych] Revert psych version
https://github.com/ruby/psych/commit/55a294fcd0
2020-09-25 13:11:33 +09:00
SzymonKowalczyk f794c928a0
[ruby/psych] Update SNAKEYAML CVE-2017-18640
to version 1.26
https://github.com/ruby/psych/commit/b2802135e7
2020-09-25 13:11:32 +09:00
Charles Oliver Nutter 33641e00cd
Remove private_iv_get
The only remaining use of this function was to get the internal
message object from an exception's hidden `mesg` instance
variable to allow it to be dumped wiithout converting to a string.

As discussed in #103, this exposes internal implementation details
of CRuby, and ultimately does not provide any real utility to the
user since they can't directly inspect this hidden variable. The
test change here is to reflect CRuby behavior that denies equality
if the internal message objects do not match, as is the case after
the exception has been loaded and now has a simple String value.

The impact to users is that exceptions with special hidden message
objects will convert those objects to String during marshaling
through YAML. I believe this only affects NameError and its
descendants, since users can't set this field directly on their
own exception types.

Fixes #103.
2020-09-25 13:11:32 +09:00
卜部昌平 490010084e sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
卜部昌平 756403d775 sed -i '/r_cast.h/d' 2020-08-27 15:03:36 +09:00
卜部昌平 0da2a3f1fc sed -i '\,2/extern.h,d' 2020-08-27 14:07:49 +09:00
Nobuyoshi Nakada 9a78e24f7d
Removed nonsense `rubygems_version` in input gemspec files
As it is ignored and set at building packages automatically, it is
just nonsense to set in gemspec file for input.
2020-06-25 15:44:56 +09:00
Hiroshi SHIBATA 078e94106d
[ruby/psych] Fixup 05d7e818a6abe3ee1c56b6be92f086647d73141c
https://github.com/ruby/psych/commit/4e7794fc2c
2020-06-23 15:26:29 +09:00
Hiroshi SHIBATA 7cdfc2b5fc
[ruby/psych] Bump version strings for header file
https://github.com/ruby/psych/commit/68da645c7e
2020-06-23 15:26:29 +09:00
Hiroshi SHIBATA 70a4599869
[ruby/psych] Bump libyaml version to 0.2.5
https://github.com/ruby/psych/commit/39996192cc
2020-06-23 15:26:29 +09:00
Jean Boussier 666c077691
[ruby/psych] Fix anchor lookup with symbolized names
https://github.com/ruby/psych/commit/ef74fc01e2
2020-06-23 15:26:29 +09:00
Yusuke Endoh a3cc9b3c8e Avoid requiring "psych/versions"
This leads to double requiring "ext/psych/lib/psych/versions.rb" and
".ext/common/psych/versions.rb", which produces doxens of warnings
during `make test-all`.

http://rubyci.s3.amazonaws.com/ubuntu2004/ruby-master/log/20200608T123004Z.log.html.gz
```
[15092/20234]
TestRDocOptions#test_init_with_encoding/home/chkbuild/chkbuild/tmp/build/20200608T123004Z/ruby/ext/psych/lib/psych.rb:233: warning: already initialized constant Psych::LIBYAML_VERSION
/home/chkbuild/chkbuild/tmp/build/20200608T123004Z/ruby/.ext/common/psych.rb:233: warning: previous definition of LIBYAML_VERSION was here
/home/chkbuild/chkbuild/tmp/build/20200608T123004Z/ruby/ext/psych/lib/psych.rb:235: warning: already initialized constant Psych::NOT_GIVEN
/home/chkbuild/chkbuild/tmp/build/20200608T123004Z/ruby/.ext/common/psych.rb:235: warning: previous definition of NOT_GIVEN was here
/home/chkbuild/chkbuild/tmp/build/20200608T123004Z/ruby/ext/psych/lib/psych.rb:271: warning: method redefined; discarding old load
/home/chkbuild/chkbuild/tmp/build/20200608T123004Z/ruby/.ext/common/psych.rb:271: warning: previous definition of load was here
...
```

The same issue happened in fiddle.gemspec, and this change applies the
same fix as [fiddle](https://github.com/ruby/fiddle/issues/34).
2020-06-09 00:27:04 +09:00
Po-Chuan Hsieh 6b9e363aa0 [ruby/psych] Add LICENSE to the gem
https://github.com/ruby/psych/commit/02919596fa
2020-06-05 11:49:56 +09:00
David Rodríguez cd3d035e8a [ruby/psych] Remove unnecessary version guard from versions.rb
Removing it triggers the following warnings when running `bundle` under
jruby from the root of the `psych` repo prints the following warnings:

```
/path/to/jruby-9.2.9.0/lib/ruby/gems/shared/gems/psych-3.1.0-java/lib/psych/versions.rb:7: warning: already initialized constant VERSION
/path/to//jruby-9.2.9.0/lib/ruby/gems/shared/gems/psych-3.1.0-java/lib/psych/versions.rb:10: warning: already initialized constant DEFAULT_SNAKEYAML_VERSION
```

This is because bundler loads the versions file relatively from the
local gemspec, and then internally loads the psych gem, causing the
redefinition warnings.

Instead, we modify the $LOAD_PATH so that when working locally on the
`psych` repo, the local version of `psych` gets used.

https://github.com/ruby/psych/commit/a3fc8191a7
2020-06-05 11:49:56 +09:00
Mark Thorn f245976386 [ruby/psych] Fix ArgumentError with leading and trailing underscores in number strings.
https://github.com/ruby/psych/commit/ac2d2c9b1b
2020-06-05 11:49:56 +09:00
David Rodríguez 5ed58b90d1 [ruby/psych] Fix gem installation
Current version is not installable because the gemspec is invalid, since
it includes a `.travis.yml` file that no longer exists, so `rake
install` fails like this:

```
$ rake install
rake aborted!
WARNING:  See https://guides.rubygems.org/specification-reference/ for help
ERROR:  While executing gem ... (Gem::InvalidSpecificationException)
    [".travis.yml"] are not files
```

https://github.com/ruby/psych/commit/32b18ca7ca
2020-06-05 11:49:56 +09:00
Jean Boussier f641d78a6f [ruby/psych] Implement `freeze` option for Pysch.load
https://github.com/ruby/psych/commit/7dae24894d
2020-06-05 11:49:56 +09:00
Jean Boussier 4085c51a51 [ruby/psych] Implement a freeze load option
https://github.com/ruby/psych/commit/04f97f7a56
2020-06-05 11:49:56 +09:00