psych
psych copied to clipboard
A libyaml wrapper for Ruby
I ran the following script: ```ruby require 'yaml' puts Psych::VERSION def compare(time) dumped = YAML.dump(time) loaded = YAML.load(YAML.dump(time)) equal = loaded == time pp( original: time, loaded: loaded, equal: equal,...
I had application using psych as yaml engine with ruby v 2.1.1 and rails 3.2 the old version of rub 1.9.4 is working fine with nested arabic object with `YAML::ENGINE.yamler=...
```ruby class Custom def initialize @value = 1 end def encode_with(coder) coder.scalar = @value.to_s end def init_with(coder) @value = coder.scalar.to_i end end YAML::load(YAML::dump(Custom.new)) # => 1 ``` Would expect that...
For example: ``` x = "\x00\x01".b x.encoding == Encoding::BINARY # => true y = YAML::load(YAML::dump(x)) y.encoding == Encoding::BINARY # => false ```
Apparently keys over 1022 characters are not supported: ```ruby > key = 'n' * 3 => "nnn" > text = "\"#{key}\": 12" => "\"nnn\": 12" > YAML.load(text) => {"nnn"=>12} >...
Psych adds whitespaces to the end of below lines: ``` date: abbr_month_names: -
JRUBY_HOME=C:\Users\first.last\workspace\TestBed\vendor GEM_PATH=GEM_HOME=C:\Users\/first.last\workspace\TestBed\vendor\vendor\gem_home C:\Program Files\Java\jre\bin\java -jar jruby-complete-9.0.4.0.jar -S gem install psych -v 2.0.16 ERROR: While executing gem ... (Errno::ENOENT) No such file or directory - C:/Users/first.last/workspace/TestBed/vendor/vendor/gem_home/gems/psych-2.0.16-java/deps.lst gem list command claims it...
Dumping and loading an Exception loses the backtrace information. The following test demonstrates this. ``` ruby def test_exception_should_have_backtrace err = 1 / 0 rescue $! assert_not_nil err.backtrace assert_not_nil YAML.load(YAML.dump(err)).backtrace end...
When trying to update rubocop from 0.64 to 0.65 `bundle update` failed, because psych x64-mingw64 forces Ruby to be < 2.6. https://rubygems.org/gems/psych/versions/3.1.0-x64-mingw32 https://rubygems.org/gems/psych/versions/3.1.0-x86-mingw32 compare to https://rubygems.org/gems/psych/versions/3.1.0 rubocop (~> 0.65) was...
There seems to be no `safe_load` equivalent for multi document yamls, such as `safe_load_stream`.