Hiroshi SHIBATA
b368990ce6
[ruby/psych] Skip BigDecimal tests when it's missing to load
...
https://github.com/ruby/psych/commit/e1dbfae7a6
2023-07-18 02:55:47 +00:00
Nobuyoshi Nakada
10e6626426
[ruby/psych] Prefer `assert_include` for simple strings
...
https://github.com/ruby/psych/commit/33024ce2b0
2023-06-12 03:02:10 +00:00
Charles Oliver Nutter
29133794a3
[ruby/psych] Update for stricter 1.2 syntax
...
This allows these tests to pass on SnakeYAML Engine -- which is a
1.2-only YAML library -- while still passing on libyaml 1.1.
https://github.com/ruby/psych/commit/f44269fc9b
2023-01-31 13:14:05 +09:00
Jean Boussier
8fded5f5d1
[ruby/psych] Fix RestrictedYAMLTree allowing the Symbol class should allow all symbols
...
Ref: https://github.com/ruby/psych/pull/495
That's how it works for `safe_load`:
```ruby
>> YAML.safe_load(':foo', permitted_classes: [Symbol])
=> :foo
```
So `safe_dump` should mirror that.
https://github.com/ruby/psych/commit/592a75a656
2023-01-23 02:07:23 +00:00
Jean Boussier
3161fd4372
[ruby/psych] Get rid of anonymous eval calls
...
Things declared in anonymous eval are always annoying to locate.
https://github.com/ruby/psych/commit/38871ad4e5
2023-01-11 10:08:13 +00:00
Jeremy Evans
7e8fa06022
Always issue deprecation warning when calling Regexp.new with 3rd positional argument
...
Previously, only certain values of the 3rd argument triggered a
deprecation warning.
First step for fix for bug #18797 . Support for the 3rd argument
will be removed after the release of Ruby 3.2.
Fix minor fallout discovered by the tests.
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-12-22 11:50:26 -08:00
Hiroshi SHIBATA
d928ebacb2
Merge Psych-5.0.1
2022-12-09 16:36:22 +09:00
Nobuyoshi Nakada
cbdde8e0c5
[ruby/psych] Dump Date/DateTime as proleptic Gregorian date as well as Time
...
Fix ruby/psych#572
https://github.com/ruby/psych/commit/92304269bc
2022-09-07 09:44:14 +09:00
Alexander Momchilov
9c13a6ce5f
[ruby/psych] Raise specific error when an anchor isn't defined
...
https://github.com/ruby/psych/commit/98fbd5247a
2022-08-09 01:33:34 +09:00
Alexander Momchilov
4b9cdf4e1c
[ruby/psych] Update to squiggly heredocs in the file
...
https://github.com/ruby/psych/commit/42b43de997
2022-08-09 01:33:33 +09:00
Alexander Momchilov
38ea6b30dc
[ruby/psych] Add test for missing anchor
...
https://github.com/ruby/psych/commit/5f08137ae6
2022-08-09 01:33:32 +09:00
Alexander Momchilov
ea1efdf32f
[ruby/psych] Add test for anchor reuse
...
The spec calls this a "reuse" of an anchor
https://yaml.org/spec/1.2.2/#71-alias-nodes
https://github.com/ruby/psych/commit/57e3b70a56
2022-08-09 01:33:31 +09:00
Alexander Momchilov
54219ae8c4
[ruby/psych] Raise specific error when aliases are not enabled
...
https://github.com/ruby/psych/commit/0c11ddcf46
2022-08-09 01:32:47 +09:00
Alexander Momchilov
71f89c2874
[ruby/psych] Don't hardcode expected alias names
...
https://github.com/ruby/psych/commit/b9ab19094f
2022-08-09 01:31:24 +09:00
Alexander Momchilov
0b7cfdca09
[ruby/psych] Test that recursive refs dump as aliases
...
https://github.com/ruby/psych/commit/d9f7289190
2022-08-09 01:31:23 +09:00
Alexander Momchilov
c851bced39
[ruby/psych] Clarify tests about parsing aliases
...
https://github.com/ruby/psych/commit/0bc30cb4cb
2022-08-09 01:31:22 +09:00
Seth Boyles
c1a6ff046d
[ruby/psych] Add strict_integer option to parse numbers with commas as strings
...
Authored-by: Seth Boyles <sethboyles@gmail.com>
https://github.com/ruby/psych/commit/75bebb37b8
2022-01-22 10:00:51 +09:00
Yusuke Endoh
141db4f383
test/psych/test_scalar_scanner.rb: Prevent a warning
...
```
[ 4696/20990] TestAst#test_ranges:test/psych/test_scalar_scanner.rb(none):138: warning: ambiguous first argument; put parentheses or a space even after `-' operator
```
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20210909T123007Z.log.html.gz
2021-09-09 23:35:03 +09:00
jory-graham
db154b20cc
[ruby/psych] Replace A-Za-z with [:alpha:]
...
https://github.com/ruby/psych/commit/8ec36494fb
2021-08-31 19:34:54 +09:00
Aaron Patterson
9ed2cb26de
[ruby/psych] Add quotes to the strings "y" and "n"
...
'y' and 'n' are kind of ambiguous. Syck treated y and n literals in
YAML documents as strings. But this is not what the YAML 1.1 spec says.
YAML 1.1 says they should be treated as booleans. When we're dumping
documents, we know it's a string, so adding quotes will eliminate the
"ambiguity" in the emitted document
Fixes #443
https://github.com/ruby/psych/commit/6a1c30634e
2021-08-31 19:34:46 +09:00
Alexandr Opak
44353d0dee
[ruby/psych] add more tests
...
https://github.com/ruby/psych/commit/8f71222bf3
2021-08-31 19:34:28 +09:00
Alexandr Opak
beffa72c27
[ruby/psych] fix typo
...
https://github.com/ruby/psych/commit/ebb0cbded1
2021-08-31 19:34:21 +09:00
Alexandr Opak
48b50cb4fe
[ruby/psych] fix parsing integer values with '_' at the end
...
https://github.com/ruby/psych/commit/e0bb853014
2021-08-31 19:34:13 +09:00
Tomer Brisker
31ba0921f8
[ruby/psych] Improve float scalar scanner
...
Previously, `+.inf` was not handled correctly. Additionally, the regexp
was checking for inf and NaN, even though these cases are handled earlier
in the condition. Added a few tests to ensure handling some missing
cases.
https://github.com/ruby/psych/commit/6e0e7a1e9f
2021-08-31 19:34:06 +09:00
Pavel Rosický
b11638eed2
[ruby/psych] require 'delegate' explicitly
...
https://github.com/ruby/psych/commit/51a9ce13db
2021-07-29 15:54:34 +09:00
Yusuke Endoh
8c87efaa8a
[ruby/psych] Fix the test that does not work with libyaml-0.1.7
...
https://github.com/ruby/psych/commit/542cf9754f
2021-06-08 08:12:27 +09:00
Hiroshi SHIBATA
bb4a10208c
Do not use YAML module in tests of Psych
2021-06-07 19:24:20 +09:00
Hiroshi SHIBATA
d7146dfd7d
Use assert_raise instead of assert_raises
2021-06-07 19:21:41 +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
Nobuyoshi Nakada
251fafec1b
Suppress debug message
2021-05-26 15:33:25 +09:00
Yusuke Endoh
837cbea64b
test/psych/test_coder.rb: Suppress non-parenthesis warnings
...
http://rubyci.s3.amazonaws.com/debian9/ruby-master/log/20210518T093002Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20210518T093002Z/ruby/test/psych/test_coder.rb:277: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator
```
2021-05-18 19:01:27 +09:00
Yusuke Endoh
31a757a442
Make the test pass with the old libyaml
...
I have no idea what result is right, but it fails with libyaml 0.1.7
(bundled with Ubuntu 18.04) anyway.
2021-05-17 14:31:34 +09:00
Yusuke Endoh
f367b4ffe7
assert_equal accepts an expected value as the first argument
2021-05-17 14:31:34 +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
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
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
Hiroshi SHIBATA
ab785b28e2
[ruby/psych] Use assert_raise instead of assert_raises
...
https://github.com/ruby/psych/commit/e6ad12b4e1
2021-05-10 19:09:43 +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
Hiroshi SHIBATA
53c5a4bbe1
[ruby/psych] Fixed test-case for NaN
...
https://github.com/ruby/psych/commit/f85a008263
2021-05-10 18:53:49 +09:00
Hiroshi SHIBATA
230d559f6b
[ruby/psych] Use Ractor constant for ignoreing condition
...
https://github.com/ruby/psych/commit/cc5f957327
2021-05-10 18:53:41 +09:00
Hiroshi SHIBATA
ce67549c50
[ruby/psych] Use test-unit instead of minitest
...
https://github.com/ruby/psych/commit/01e7310dd3
2021-05-10 18:53:33 +09:00
Hiroshi SHIBATA
8259d88938
[ruby/psych] Skip test_ractor.rb with ruby/psych repo
...
Because ruby/psych still uses minitest. minitest didn't support
assert_ractor provided by test suite of ruby/ruby repo.
https://github.com/ruby/psych/commit/7da26358f1
2020-12-23 19:45:54 +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
Hiroshi SHIBATA
c2a60fec2f
Merge Psych-3.2.1 from ruby/psych
2020-12-14 20:13:12 +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
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
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