| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/psych/commit/8345af9ffb
|
|
https://github.com/ruby/psych/commit/6a826693ba
|
|
https://github.com/ruby/psych/commit/506bf75ab2
|
|
https://github.com/ruby/psych/commit/d8053b0d16
|
|
https://github.com/ruby/psych/commit/907fd4fa97
|
|
https://github.com/ruby/psych/commit/4e9d08c285
|
|
Fixes: ruby#685
This feature can easily break how you use other gems like factory_bot or prawn.
https://github.com/ruby/psych/pull/747#issuecomment-3413139525
> But I kind of think we should leave `psych/y` around. If people really want to use it they could require the file.
If you miss the function in Kernel, you can require it interactively or add it to `.irbrc`:
```ruby
require 'psych/y'
```
https://github.com/ruby/psych/commit/f1610b3f05
|
|
* From https://github.com/truffleruby/truffleruby/commit/1f81db82d2969ff7c5de0dacdecb38252664f42c
https://github.com/ruby/psych/commit/dbabe7aac6
|
|
values and not a Hash
* rb_struct_initialize() does not accept a Hash, and it's very brittle
to pass `[{...}]` and to rely on that C function using rb_keyword_given_p().
It basically worked accidentally, by having **members in the caller of the caller.
Such logic when Struct#initialize is defined in Ruby (as in TruffleRuby) is basically impossible to implement,
because it's incorrectly treating positional arguments as keyword arguments.
* rb_struct_initialize() is used in CRuby to set members of Data instances in marshal.c (there is no rb_data_initialize() yet).
There, the code passes an Array of members values for Data (and for Struct which are not `keyword_init: true`):
https://github.com/ruby/ruby/blob/48c7f349f68846e10d60ae77ad299a38ee014479/marshal.c#L2150-L2176
So we should do the same in psych.
* Rename to init_data since it's only used for Data.
* See https://github.com/ruby/psych/pull/692#discussion_r2483947279.
https://github.com/ruby/psych/commit/3550148378
|
|
This commit updates the Ruby version to follow the commit in Ruby master branch.
https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523
https://github.com/ruby/psych/commit/971b7de078
|
|
If pkg_config returns a truthy value, it found the library and added it
to the global values for the Makefile.
Calling `find_library` after a successful `pkg_config` causes -lyaml to
appear twice in the LIBS variable in the resulting Makefile, and causes
ld on macOS to emit a warning:
$ bundle exec rake compile 2>&1 | grep warning
ld: warning: ignoring duplicate libraries: '-lyaml'
https://github.com/ruby/psych/commit/cb5e3d465c
|
|
|
|
https://github.com/ruby/psych/commit/b9dec9f811
|
|
In Ruby < 3.0, the superclass of StringIO was actually already `Data`,
but it doesn't have the expected shape. So, on these earlier versions it errors:
> NoMethodError: undefined method `members' for #<StringIO:0x00005641dd5f2880>
> vendor/bundle/ruby/2.6.0/gems/psych-5.2.5/lib/psych/visitors/yaml_tree.rb:170:in `visit_Data'
This test doesn't fail on 2.7, presumably because it can pull in a newer `stringio` version.
https://github.com/ruby/psych/commit/0f40f56268
|
|
https://github.com/ruby/psych/commit/dbf9e36583
|
|
https://github.com/ruby/psych/commit/336553b412
|
|
https://github.com/ruby/psych/commit/e954f96639
|
|
https://github.com/ruby/psych/commit/30a2a5ee94
|
|
Use feature testing to detect native Set,
and don't rely on `Set#to_h` which wasn't intended
as a public method.
https://github.com/ruby/psych/commit/d58cff11af
|
|
https://github.com/ruby/psych/commit/3573fb356e
|
|
https://github.com/ruby/psych/commit/9df5501fdc
|
|
This sets the ivars _before_ calling initialize, which feels wrong. But
Data doesn't give us any mechanism for setting the members other than 1)
initialize, or 2) drop down into the C API. Since initialize freezes
the object, we need to set the ivars before that. I think this is a
reasonable compromise—if users need better handling, they can implement
their own `encode_with` and `init_with`. But it will lead to unhappy
surprises for some users.
Alternatively, we could use the C API, similarly to Marshal. Psych _is_
already using the C API for path2class and build_exception. This would
be the least surprising behavior for users, I think.
|
|
https://github.com/ruby/psych/commit/788b844c83
|
|
This fixes the issue where regular expression would come back slightly
different after going through a YAML load/dump cycle. Because we're used
to having to escape forward slashes in regular expression literals
(because the literal is delimited by slashes), but the deserializer
takes the literal output from `Regexp#inspect` and feeds it as a string
into `Regexp.new`, which expects a string, not a Regexp literal, cycling
did not properly work before this commit.
I've also changed the code to be a bit more readable, I hope this
doesn't affect performance.
https://github.com/ruby/psych/commit/f4dd8dadad
|
|
https://github.com/ruby/psych/commit/bb63f91825
|
|
Since `Set` no longer is a regular object class holding a Hash
it needs to be specially handled.
https://github.com/ruby/psych/commit/c2d185d27c
|
|
Fix https://github.com/ruby/psych/pull/644
https://github.com/ruby/psych/commit/b1ade765ba
|
|
Followup: https://github.com/ruby/psych/pull/686
This single call shows up as 4% of some controller actions
in the lobsters benchmark.
Profile: https://share.firefox.dev/3EqKnhS
https://github.com/ruby/psych/commit/b77bfee092
|
|
https://github.com/ruby/psych/commit/2af9f6ac02
|
|
Fixes ruby/psych#689
https://github.com/ruby/psych/commit/ac887cdc76
|
|
https://github.com/ruby/psych/commit/2f46abf4e1
|
|
https://github.com/ruby/psych/commit/746e1ad24d
|
|
https://docs.ruby-lang.org/en/master/Psych.html#module-Psych-label-Exception+handling
https://github.com/ruby/psych/commit/c53c298222
|
|
https://github.com/ruby/psych/commit/7c81f7db53
|
|
The evaluation order of C arguments is unspecified.
`RSTRING_LEN(value)` would fail if the conversion to a String by
`StringValuePtr(value)` is not done yet.
Coverity Scan found this issue.
https://github.com/ruby/psych/commit/d1e6bf323a
|
|
https://github.com/ruby/psych/commit/b2aa0032c0
|
|
https://github.com/ruby/psych/commit/6ea07fdadd
|
|
https://github.com/ruby/psych/commit/6609955e68
|
|
https://github.com/ruby/psych/commit/b89064efa5
|
|
https://github.com/ruby/psych/commit/48e5af8454
|
|
https://github.com/ruby/psych/commit/288febbc87
|
|
https://github.com/ruby/psych/commit/d9e18aaab7
|
|
https://github.com/ruby/psych/commit/a0c353ec97
|
|
Save on allocating useless `MatchData` instances.
https://github.com/ruby/psych/commit/b2d9f16e58
|
|
A string similar to "0x____" should be treated as a string.
Currently it is processed as an Integer.
This alters the regex specified by http://yaml.org/type/int.html
to ensure at least one numerical symbol is present in the string
before converting to Integer.
https://github.com/ruby/psych/commit/81479b203e
|
|
https://github.com/ruby/psych/commit/a8b73bb80e
|
|
https://github.com/ruby/psych/commit/3b63a93dfc
|
|
https://github.com/ruby/psych/commit/9f5392d180
|
|
https://github.com/ruby/psych/commit/ce7946981d
|
|
When an exception is raised, it can leak memory in `head`. There are two
places that can leak memory:
1. `Check_Type(tuple, T_ARRAY)` can leak memory if `tuple` is not an
array.
2. `StringValue(name)` and `StringValue(value)` if they are not strings
and the call to `to_str` does not return a string.
This commit fixes these memory leaks by wrapping the code around a
rb_ensure so that the memory is freed in all cases.
The following code demonstrates the memory leak:
emitter = Psych::Emitter.new(StringIO.new)
nil_to_string_tags = [[nil, "tag:TALOS"]] + ([1] * 1000)
expected_array_tags = [1] * 1000
10.times do
1_000.times do
# Raises `no implicit conversion of nil into String`
emitter.start_document([], nil_to_string_tags, 0)
rescue TypeError
end
1_000.times do
# Raises `wrong argument type Integer (expected Array)`
emitter.start_document([], expected_array_tags, 0)
rescue TypeError
end
puts `ps -o rss= -p #{$$}`
end
Before:
47248
79728
111968
144224
176480
208896
241104
273280
305472
337664
After:
14832
15088
15344
15344
15360
15632
15632
15632
15648
15648
https://github.com/ruby/psych/commit/053af73818
|