New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support JSON::PP::Boolean #66

Closed
wants to merge 11 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@perlpunk
Collaborator

perlpunk commented Sep 30, 2017

When $YAML::XS::Booleans is true, it will load and dump JSON::PP::Boolean
objects.

Currently, you have to load JSON::PP yourself. This should be done in XS, too.

Edit: JSON::PP will be loaded automatically now.

@perlpunk

This comment has been minimized.

Show comment
Hide comment
@perlpunk

perlpunk Sep 30, 2017

Collaborator

Like @jhthorsen suggsted on IRC, it might make sense to also load True and False additionally to true and false, since that's also quite common.
I see that a lot in ansible files.

Collaborator

perlpunk commented Sep 30, 2017

Like @jhthorsen suggsted on IRC, it might make sense to also load True and False additionally to true and false, since that's also quite common.
I see that a lot in ansible files.

@perlpunk

This comment has been minimized.

Show comment
Hide comment
@perlpunk

perlpunk Oct 2, 2017

Collaborator

As discussed with @ingydotnet, it should be configurable which boolean class to use:

$YAML::XS::Boolean = 'boolean'; # or JSON::PP

working on how to get a string from a package variable in XS now...

Collaborator

perlpunk commented Oct 2, 2017

As discussed with @ingydotnet, it should be configurable which boolean class to use:

$YAML::XS::Boolean = 'boolean'; # or JSON::PP

working on how to get a string from a package variable in XS now...

@perlpunk

This comment has been minimized.

Show comment
Hide comment
@perlpunk

perlpunk Nov 8, 2017

Collaborator

got it working, I have to test a bit more, though.
thanks to @hoehrmann for the help with getting the package var as a string.

Collaborator

perlpunk commented Nov 8, 2017

got it working, I have to test a bit more, though.
thanks to @hoehrmann for the help with getting the package var as a string.

@perlpunk

This comment has been minimized.

Show comment
Hide comment
@perlpunk

perlpunk Nov 10, 2017

Collaborator

@ingydotnet please review

Collaborator

perlpunk commented Nov 10, 2017

@ingydotnet please review

More tests for $Boolean
$YAML::XS::Boolean accepts only "JSON::PP", "boolean", and undef, '', 0 or '0'
@perlpunk

This comment has been minimized.

Show comment
Hide comment
@perlpunk

perlpunk Nov 10, 2017

Collaborator

squashed the commits, applied and released YAML-LibYAML-0.66_001.tar.gz

Collaborator

perlpunk commented Nov 10, 2017

squashed the commits, applied and released YAML-LibYAML-0.66_001.tar.gz

@perlpunk perlpunk closed this Nov 10, 2017

@perlpunk perlpunk deleted the perlpunk/fun-with-booleans branch Dec 8, 2017

gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Apr 3, 2018

dev-perl/YAML-LibYAML: Bump to version 0.690.0
Upstream:
- (Security) Add $LoadBlessed option[1] to run on/off loading objects
- Fix regex roundtrip [2]
- Fix loading of many regex classes [3]
- Support tags !!str, !!map and !!seq [4]
- Support JSON::PP::Boolean via $YAML::XS::Boolean [5]
- Fix Dump modifying inspected values [6]

[1]
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861958
Bug: ingydotnet/yaml-libyaml-pm#45
Bug: ingydotnet/yaml-libyaml-pm#73
Bug: ingydotnet/yaml-libyaml-pm#74
[2]
Bug: ingydotnet/yaml-libyaml-pm#69
Bug: ingydotnet/yaml-libyaml-pm#70
[3]
Bug: ingydotnet/yaml-libyaml-pm#64
Bug: ingydotnet/yaml-libyaml-pm#71
[4]
Bug: ingydotnet/yaml-libyaml-pm#67
[5]
Bug: ingydotnet/yaml-libyaml-pm#66
[6]
Bug: ingydotnet/yaml-libyaml-pm#32
Bug: ingydotnet/yaml-libyaml-pm#55
Package-Manager: Portage-2.3.24, Repoman-2.3.6

madmartin added a commit to madmartin/gentoo that referenced this pull request Apr 4, 2018

dev-perl/YAML-LibYAML: Bump to version 0.690.0
Upstream:
- (Security) Add $LoadBlessed option[1] to run on/off loading objects
- Fix regex roundtrip [2]
- Fix loading of many regex classes [3]
- Support tags !!str, !!map and !!seq [4]
- Support JSON::PP::Boolean via $YAML::XS::Boolean [5]
- Fix Dump modifying inspected values [6]

[1]
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861958
Bug: ingydotnet/yaml-libyaml-pm#45
Bug: ingydotnet/yaml-libyaml-pm#73
Bug: ingydotnet/yaml-libyaml-pm#74
[2]
Bug: ingydotnet/yaml-libyaml-pm#69
Bug: ingydotnet/yaml-libyaml-pm#70
[3]
Bug: ingydotnet/yaml-libyaml-pm#64
Bug: ingydotnet/yaml-libyaml-pm#71
[4]
Bug: ingydotnet/yaml-libyaml-pm#67
[5]
Bug: ingydotnet/yaml-libyaml-pm#66
[6]
Bug: ingydotnet/yaml-libyaml-pm#32
Bug: ingydotnet/yaml-libyaml-pm#55
Package-Manager: Portage-2.3.24, Repoman-2.3.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment