summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2018-04-23Add more test cases for fallback of Psych.load_fileMarcus Stollsteimer
Add test cases for the fallback keyword argument of Psych.load_file to make sure that the fallback is not used for valid YAML that represents nil or false.
2017-12-20Add a predicate method to each nodeAaron Patterson
This allows the AST to be searched via a predicate method rather than hardcoding the class name and doing is_a? checks. For example, rather than: ``` ast.grep(Psych::Nodes::Scalar).each do |node| # .. do something end ``` Now you can do: ``` ast.find_all(&:scalar?).each do |node| # .. do something end ``` Your code no longer needs to know the exact class used in the AST.
2017-12-19Add more test cases for fallback of Psych.load_fileMarcus Stollsteimer
Add more test cases for the fallback keyword argument of Psych.load_file; additionally, fix an error in the docs.
2017-12-02Convert fallback option to a keyword argumentMarcus Stollsteimer
Converting the optional fallback argument to a keyword argument fixes a problem that is caused by mixing optional arguments and optional keyword arguments. Without this change, a hash as fallback value is not handled correctly: in Psych.load("", nil, {}) the hash is not interpreted as the fallback value, and the default value for the fallback argument is used instead.
2017-11-30Add :symbolize_names option to .safe_load tooTakashi Kokubun
related to #333
2017-11-29Revert "Double quote stings that contain single quotes only"SHIBATA Hiroshi
2017-11-25Add :symbolize_names option to Psych.loadTakashi Kokubun
like JSON.parse.
2017-09-12Removed trailing white-spaces.SHIBATA Hiroshi
2017-09-11Merge pull request #325 from knugie/fix_324SHIBATA Hiroshi
Double quote stings that contain single quotes only
2017-09-10Merge pull request #326 from asterite/feature/scalar_locationAaron Patterson
Add Psych::Handler#event_location
2017-09-05Parse.load with an IO/File which has a non-YAML allowed encoding will justThomas E. Enebo
set the encoding to UTF-8 and hope for the best. This appears to be how libyaml works. This issue was noticed in yaml/store because it extends pstore which will create an IO in read_only mode as: ```ruby RD_ACCESS = {mode: IO::RDONLY | IO::BINARY, encoding: Encoding::ASCII_8BIT} ``` The data in the test case I was debugging was in fact UTF-8 data and MRI was happy to take this 8bit IO and pretend it is UTF-8. Form-fitting ftw.
2017-08-02Add location information to Psych::Nodes::NodeAry Borenszweig
2017-08-02Add Psych::Handler#event_locationAry Borenszweig
This adds a new reported event to Psych::Handler, event_location, with precise start/end line/column information. The line/column information provided by Psych::Parser#mark is not very useful because it points to the location past the event.
2017-07-21Double quote stings that contain single quotes onlyWolfgang Teuber
Fixes #324
2017-06-30Merge branch 'master' into frozenSHIBATA Hiroshi
2017-06-29Support enumerator objectsAaron Patterson
Fixes #277
2017-06-29Rely on encoding tags to determine if string should be dumped as binaryAaron Patterson
If a string is tagged as binary, then we should dump it as binary. Fixes #278
2017-06-19make frozen_string_literal: trueSHIBATA Hiroshi
2017-06-16Merge pull request #158 from laserlemon/delegatorsSHIBATA Hiroshi
Enable YAML serialization of Ruby delegators
2017-05-22Preserve time zone offset when deserializing timesMarcus Stollsteimer
Fix support of time zone offsets. Now the time zone offset will be preserved when times are deserialized from YAML with a specified offset. Previously, times other than UTC ("Z") where converted to local time. The test cases use two different offsets to account for the possibility of an erratic success when the tests are run in the corresponding time zone.
2017-05-22Add tests for time with usec and with time zone offsetMarcus Stollsteimer
Add test cases for times with nonzero usec, and for times other than UTC. Note that in the latter case the test only ensures that the restored time designates the same point in time, not that is has the same time zone offset.
2017-03-27Fixed gabage linesSHIBATA Hiroshi
2017-03-27Removed deprecated yaml_initialize methodSHIBATA Hiroshi
2017-03-27Removed Module#psych_yaml_asSHIBATA Hiroshi
2017-03-27Remove to_yaml_propatiesSHIBATA Hiroshi
2017-03-27Remove Psych.tagurizeSHIBATA Hiroshi
2017-03-27Remove Psych.object_makerSHIBATA Hiroshi
2017-03-27Remove Psych.read_type_classSHIBATA Hiroshi
2017-03-27Remove Psych.add_private_typeSHIBATA Hiroshi
2017-03-27Removed Psyych.add_ruby_type.SHIBATA Hiroshi
2017-03-27Removed Psyych.detect_implicit.SHIBATA Hiroshi
2017-03-27Removed Psyych.load_documents.SHIBATA Hiroshi
2017-03-10Merge pull request #304 from ruby/remove-syckSHIBATA Hiroshi
Remove deprecated code related syck
2017-03-07Make sexagesimal parsing more strictAaron Patterson
Fixes #265
2017-03-07To use yaml_as instead of psych_yaml_asSHIBATA Hiroshi
2017-03-03Removed aliases for Syck module.SHIBATA Hiroshi
* Removed alias for to_yaml. * Renamed pysch_to_yaml to to_yaml. * Removed Pysch.quick_emit. Because it caused infinite recuresion call used to_yaml.
2017-03-03styleSHIBATA Hiroshi
2017-03-03avoid to deprecated warnings with nil assertions.SHIBATA Hiroshi
2017-03-03avoid to shadowing outer local variables.SHIBATA Hiroshi
2017-03-03Added parentheses for regex assertionsSHIBATA Hiroshi
2017-03-03use assert_nil when nil assertionSHIBATA Hiroshi
2016-08-23Close TempfileNobuyoshi Nakada
Fix Tempfile leak.
2016-06-30Merge pull request #276 from ccutrer/invalid_floatAaron Patterson
fix serialization of a string that looks like a valid YAML float
2016-06-24cherry-picking assertion from ↵SHIBATA Hiroshi
https://github.com/ruby/ruby/commit/cc0313436160b735a3d41361cb5e3eeb10fcbdad
2016-06-24Merge pull request #264 from tuexss/load_file-defaultAaron Patterson
Add optional fallback return value parameter
2016-06-24Merge pull request #270 from tenderlove/issue-11988SHIBATA Hiroshi
Support YAML 1.2 Core Schema
2016-03-29fix serialization of a string that looks like a valid YAML floatCody Cutrer
refs gh-156 (but isn't a valid ruby float)
2016-02-23backport workaround for JRubySHIBATA Hiroshi
ref. https://github.com/ruby/ruby/commit/9386ecf9b6baf6fd37d97bfee025702cee411718
2016-02-23Temporary disabled to frozen literal string.SHIBATA Hiroshi
ref. https://github.com/ruby/ruby/commit/3e92b635fb5422207b7bbdc924e292e51e21f040
2016-02-23cherry-picked test from ↵SHIBATA Hiroshi
https://github.com/ruby/ruby/commit/db48c307944a9a18877236bdf9e9b778875f38ed