summaryrefslogtreecommitdiff
path: root/ext/psych
AgeCommit message (Collapse)Author
2024-12-18[ruby/psych] Bump up v5.2.2Hiroshi SHIBATA
https://github.com/ruby/psych/commit/746e1ad24d
2024-12-16[ruby/psych] Don't autolink Exception in psych module docszzak
https://docs.ruby-lang.org/en/master/Psych.html#module-Psych-label-Exception+handling https://github.com/ruby/psych/commit/c53c298222
2024-12-09[ruby/psych] Bump up 5.2.1Hiroshi SHIBATA
https://github.com/ruby/psych/commit/7c81f7db53
2024-12-04[ruby/psych] Do not depend on the evaluation order of C argumentsYusuke Endoh
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
2024-11-20[ruby/psych] Eagerly require `date`.Thierry Deo
https://github.com/ruby/psych/commit/b2aa0032c0
2024-11-11[ruby/psych] Bump up v5.2.0Hiroshi SHIBATA
https://github.com/ruby/psych/commit/6ea07fdadd
2024-11-11[ruby/psych] Bump up v5.2.0.beta7Hiroshi SHIBATA
https://github.com/ruby/psych/commit/6609955e68
2024-11-11[ruby/psych] Bump up v5.2.0.beta6Hiroshi SHIBATA
https://github.com/ruby/psych/commit/b89064efa5
2024-11-11[ruby/psych] Bump up v5.2.0.beta5Hiroshi SHIBATA
https://github.com/ruby/psych/commit/48e5af8454
2024-11-11[ruby/psych] Bump up v5.2.0.beta4Hiroshi SHIBATA
https://github.com/ruby/psych/commit/288febbc87
2024-11-07[ruby/psych] Bump up v5.2.0.beta3Hiroshi SHIBATA
https://github.com/ruby/psych/commit/d9e18aaab7
2024-11-07[ruby/psych] Bump up v5.2.0.beta2Hiroshi SHIBATA
https://github.com/ruby/psych/commit/a0c353ec97
2024-09-24[ruby/psych] Use `String#match?` over `String#=~` when applicableJean Boussier
Save on allocating useless `MatchData` instances. https://github.com/ruby/psych/commit/b2d9f16e58
2024-09-11[ruby/psych] Ensure strings with only underscores are not processed as IntegerJohn Meade
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
2024-09-09[ruby/psych] Bump up 5.2.0.beta1Hiroshi SHIBATA
https://github.com/ruby/psych/commit/a8b73bb80e
2024-09-09[ruby/psych] Unlimited line_width with -1Juanjo Bazán
https://github.com/ruby/psych/commit/3b63a93dfc
2024-09-09[ruby/psych] Make to load stringio lazilyHiroshi SHIBATA
https://github.com/ruby/psych/commit/9f5392d180
2024-09-09[ruby/psych] docs: specify correct default `fallback` valueGareth Jones
https://github.com/ruby/psych/commit/ce7946981d
2024-08-09[ruby/psych] Guard from memory leak in Psych::Emitter#start_documentPeter Zhu
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
2024-08-09[ruby/psych] Convert missed tabs to spaces in C filesPeter Zhu
https://github.com/ruby/psych/commit/74a6b4d226
2024-08-09[ruby/psych] Convert tabs to spaces in C filesPeter Zhu
https://github.com/ruby/psych/commit/e7d64c9848
2024-07-19Don't call `Kernel#require` in hot loopJean Boussier
Ref: https://bugs.ruby-lang.org/issues/20641 Even without the reference bug, `require 'date'` isn't cheap. ```ruby require "benchmark/ips" require "yaml" require "date" 100.times do |i| $LOAD_PATH.unshift("/tmp/does/not/exist/#{i}") end payload = 100.times.map { Date.today }.to_yaml Benchmark.ips do |x| x.report("100 dates") { YAML.unsafe_load(payload) } end ``` Before: ``` $ ruby /tmp/bench-yaml.rb ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22] Warming up -------------------------------------- 100 dates 416.000 i/100ms Calculating ------------------------------------- 100 dates 4.309k (± 1.2%) i/s - 21.632k in 5.021003s ``` After: ``` $ ruby -Ilib /tmp/bench-yaml.rb ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22] Warming up -------------------------------------- 100 dates 601.000 i/100ms Calculating ------------------------------------- 100 dates 5.993k (± 1.8%) i/s - 30.050k in 5.016079s ```
2024-04-27ruby tool/update-deps --fix卜部昌平
2024-01-18[ruby/psych] Add :stringify_names option to convert symbol keys to string ↵Robert Schulze
for dumping https://github.com/ruby/psych/commit/3d051d89aa
2024-01-17[ruby/psych] Provide a 'Changelog' link on rubygems.org/gems/psychMark Young
By providing a 'changelog_uri' in the metadata of the gemspec a 'Changelog' link will be shown on https://rubygems.org/gems/psych which makes it quick and easy for someone to check on the changes introduced with a new version. Details of this functionality can be found on https://guides.rubygems.org/specification-reference/ https://github.com/ruby/psych/commit/28ef10edcf
2024-01-17[ruby/psych] issue #443: quote Y and N when dumpingColin Kelley
https://github.com/ruby/psych/commit/93c8fb443a
2023-12-25[ruby/psych] Remove now-unreachable rescue blockAlexander Momchilov
https://github.com/ruby/psych/commit/6905a2123c
2023-12-25[ruby/psych] Remove unused arrayAlexander Momchilov
https://github.com/ruby/psych/commit/b9e7b4a4a4
2023-12-19[ruby/psych] Bump up 5.1.2Hiroshi SHIBATA
https://github.com/ruby/psych/commit/a9ab74d132
2023-12-19[ruby/psych] Use `compare_by_identity` instead of `object_id`Alexander Momchilov
Object IDs became more expensive in Ruby 2.7. Using `Hash#compare_by_identity` let's us get the same effect, without needing to force all these objects to have object_ids assigned to them. https://github.com/ruby/psych/commit/df69e4a12e
2023-11-27[ruby/psych] Prefer each_char in Psych::Visitors::Visitor::ToRuby#deserializeMau Magnaguagno
Use safe navigation operator with each_char to remove empty strings and improve readability. https://github.com/ruby/psych/commit/5fe714b216
2023-10-16[ruby/psych] Bump up v5.1.1.1Hiroshi SHIBATA
https://github.com/ruby/psych/commit/51cc86ff3f
2023-10-11[ruby/psych] Bump up v5.1.1Hiroshi SHIBATA
https://github.com/ruby/psych/commit/f306512d60
2023-10-02[ruby/psych] Update SnakeYAML Engine to 2.7Charles Oliver Nutter
https://github.com/ruby/psych/commit/094c811588
2023-07-05[ruby/psych] Extract accessor methods without forwardableHiroshi SHIBATA
We should leave additional dependency if we leave from them. https://github.com/ruby/psych/commit/3d0325a774
2023-07-01[ruby/psych] Remove private methods unused since #487Nobuyoshi Nakada
https://github.com/ruby/psych/commit/902c292f26
2023-06-12[ruby/psych] Comment out the code used to expand the file list [ci skip]Nobuyoshi Nakada
https://github.com/ruby/psych/commit/715f3bfad0
2023-06-12[ruby/psych] Update spec filesNobuyoshi Nakada
https://github.com/ruby/psych/commit/ba6fc48591
2023-06-08[ruby/psych] Drop to support Ruby 2.4 because the latest version of ↵Hiroshi SHIBATA
core_assertions only support Ruby 2.5+ https://github.com/ruby/psych/commit/6ec316b7fa
2023-02-28Update the depend filesMatt Valentine-House
Notes: Merged: https://github.com/ruby/ruby/pull/7310
2023-02-27Remove intern/gc.h from Make depsMatt Valentine-House
Notes: Merged: https://github.com/ruby/ruby/pull/7330
2023-02-08Extract include/ruby/internal/attr/packed_struct.hNobuyoshi Nakada
Split `PACKED_STRUCT` and `PACKED_STRUCT_UNALIGNED` macros into the macros bellow: * `RBIMPL_ATTR_PACKED_STRUCT_BEGIN` * `RBIMPL_ATTR_PACKED_STRUCT_END` * `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_BEGIN` * `RBIMPL_ATTR_PACKED_STRUCT_UNALIGNED_END` Notes: Merged: https://github.com/ruby/ruby/pull/7268
2023-02-07[ruby/psych] Bump version to 5.1 for releaseCharles Oliver Nutter
This version primarily updates the JRuby extension to use SnakeYAML Engine, a newer version of the SnakeYAML library, which also updates YAML support to 1.2. The JRuby extension now also exposes settings for the parser. https://github.com/ruby/psych/commit/6f2b16b343
2023-01-31Initial move to SnakeYAML EngineCharles Oliver Nutter
See jruby/jruby#7570 for some of the justification for this move. We only require the parser from SnakeYAML, but in the original form it is encumbered with Java object serialization code that keeps getting flagged as a CVE risk. We disagree with the assessment, at least as it pertains to JRuby (we do not use the code in question) but our inclusion of the library continues to get flagged by auditing tools. This commit starts the process of moving to the successor library, SnakeYAML Engine. The parser API is largely unchanged, except as seen in this commit. No Java exceptions are thrown, but a number of Psych tests fail (possibly due to Engine being YAML 1.2 only).
2023-01-23[ruby/psych] Fix RestrictedYAMLTree allowing the Symbol class should allow ↵Jean Boussier
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-18[ruby/psych] Bump up 5.0.2Hiroshi SHIBATA
https://github.com/ruby/psych/commit/a170b8eb46
2023-01-17[ruby/psych] Bump up 5.0.2.pre1 for testingHiroshi SHIBATA
https://github.com/ruby/psych/commit/67ec299c68
2023-01-17[ruby/psych] configure of libyaml couldn't detect "arm64-apple-darwin22" for ↵Hiroshi SHIBATA
build host. checking whether make sets $(MAKE)... (cached) yes checking build system type... arm-apple-darwin21.6.0 checking host system type... Invalid configuration `arm64-apple-darwin21': machine `arm64-apple' not recognized configure: error: /bin/sh /Users/hsbt/Downloads/yaml-0.2.5/config/config.sub arm64-apple-darwin21 failed *** extconf.rb failed *** https://github.com/ruby/psych/commit/ad1502202c
2023-01-14[ruby/psych] Remove deleted file from gemspecCharles Oliver Nutter
https://github.com/ruby/psych/commit/77861ff281
2023-01-11[ruby/psych] Get rid of anonymous eval callsJean Boussier
Things declared in anonymous eval are always annoying to locate. https://github.com/ruby/psych/commit/38871ad4e5