psych
psych copied to clipboard
A libyaml wrapper for Ruby
Given the following input ```yaml key: "/Psych is a YAML parser and emitter. Psych leverages libyaml for its YAML parsing and emitting capabilities. In addition to wrapping libyaml, Psych also...
On page https://docs.ruby-lang.org/en/master/Psych/Nodes/Mapping.html, the link in the first line (https://yaml.org/spec/1.1/#mapping) correctly links to page https://yaml.org/spec/1.1, but the fragment refers to a nonexistent id on the page.
Psych serializes Date values with `to_s`, and just assumes that `to_s` generates ISO-8601 format dates. This is a little presumptuous of Psych, in my opinion, given that ActiveSupport in Rails...
JSON data is broken over multiple lines. However, this is not easily possible in JSON. Therefore, invalid JSON is produced. ```ruby $cat bug.rb require 'psych' puts Psych.to_json [[4, "Afghanistan"], [8,...
Ensure strings that may be confused as YAML1.2 numbers are quoted. Example: `0o123` or `1e3` strings in Ruby will be printed without quotation marks, resulting in them changing to numbers...
Example: a string in the form of `344455e6` will not be quoted by the Psych YAML parser as it is not matching the regex used by the YAML1.1 spec for...
I'd like to be able to do the following: ``` { long_string_content: "This is a very long string that I want to display in a literal block in my YAML...
I have some YAML with some values containing non-breaking spaces, correctly formatted according to the [YAML spec's guidelines on escaped characters](https://yaml.org/spec/1.2.2/#57-escaped-characters) as `"\_"`. Psych correctly loads these strings and converts...
what's wrong when upgrade psych ? ```ruby /home/careline/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/psych/class_loader.rb:99:in `find': Tried to load unspecified class: IPAddr (Psych::DisallowedClass) ```
Pych 4 change the default behavior of `load` to `safe_load` and add `Symbol` into `permitted_classes`. I propose also adding `Date`, `DateTime` and `Time` into `permitted_classes`. Related with https://github.com/ruby/psych/issues/604 But I'm...