psych 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/lib/psych/scalar_scanner.rb +8 -9
- data/lib/psych/versions.rb +1 -1
- data/lib/psych/visitors/yaml_tree.rb +2 -0
- data/lib/psych.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a4075fe0c4db3e6dcc7e5b025be7b155d634502c706e55c69493ce5464e8e58
|
4
|
+
data.tar.gz: 2cc4c986617d151391906db8d8ec11c10d27a374142f4eff0dfc6d52939fa42d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b06f0866f9967812901502e12afc81ffcc297597396f25a31184aca58eafbcad635bf39b495ef04e9ea5dca1312c5afb207fd835dbe5de97cb810f504ee37534
|
7
|
+
data.tar.gz: 47546ca4c3785b6eaffd73ccc1008ec4414c8d7187503cd4e9c927b98d65a9bee84c07aa7defd55b3e671f30f660aed826ce57245cd0fffc24c5ff7bf3c2912f
|
data/Rakefile
CHANGED
@@ -33,7 +33,7 @@ end
|
|
33
33
|
|
34
34
|
task :sync_tool do
|
35
35
|
require 'fileutils'
|
36
|
-
FileUtils.cp "../ruby/tool/lib/
|
36
|
+
FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
|
37
37
|
FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
|
38
38
|
FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
|
39
39
|
end
|
data/lib/psych/scalar_scanner.rb
CHANGED
@@ -9,15 +9,14 @@ module Psych
|
|
9
9
|
TIME = /^-?\d{4}-\d{1,2}-\d{1,2}(?:[Tt]|\s+)\d{1,2}:\d\d:\d\d(?:\.\d*)?(?:\s*(?:Z|[-+]\d{1,2}:?(?:\d\d)?))?$/
|
10
10
|
|
11
11
|
# Taken from http://yaml.org/type/float.html
|
12
|
-
|
13
|
-
|
14
|
-
|\.(nan|NaN|NAN)(?# not a number))$/x
|
12
|
+
# Base 60, [-+]inf and NaN are handled separately
|
13
|
+
FLOAT = /^(?:[-+]?([0-9][0-9_,]*)?\.[0-9]*([eE][-+][0-9]+)?(?# base 10))$/x
|
15
14
|
|
16
15
|
# Taken from http://yaml.org/type/int.html
|
17
|
-
INTEGER = /^(?:[-+]?0b[0-1_,]+
|
18
|
-
|[-+]?0[0-7_,]+
|
19
|
-
|[-+]?(?:0|[1-9][0-
|
20
|
-
|[-+]?0x[0-9a-fA-F_,]+
|
16
|
+
INTEGER = /^(?:[-+]?0b[0-1_,]+ (?# base 2)
|
17
|
+
|[-+]?0[0-7_,]+ (?# base 8)
|
18
|
+
|[-+]?(?:0|[1-9](?:[0-9]|,[0-9]|_[0-9])*) (?# base 10)
|
19
|
+
|[-+]?0x[0-9a-fA-F_,]+ (?# base 16))$/x
|
21
20
|
|
22
21
|
attr_reader :class_loader
|
23
22
|
|
@@ -34,7 +33,7 @@ module Psych
|
|
34
33
|
|
35
34
|
# Check for a String type, being careful not to get caught by hash keys, hex values, and
|
36
35
|
# special floats (e.g., -.inf).
|
37
|
-
if string.match?(
|
36
|
+
if string.match?(%r{^[^\d.:-]?[[:alpha:]_\s!@#$%\^&*(){}<>|/\\~;=]+}) || string.match?(/\n/)
|
38
37
|
return string if string.length > 5
|
39
38
|
|
40
39
|
if string.match?(/^[^ytonf~]/i)
|
@@ -61,7 +60,7 @@ module Psych
|
|
61
60
|
rescue ArgumentError
|
62
61
|
string
|
63
62
|
end
|
64
|
-
elsif string.match?(
|
63
|
+
elsif string.match?(/^\+?\.inf$/i)
|
65
64
|
Float::INFINITY
|
66
65
|
elsif string.match?(/^-\.inf$/i)
|
67
66
|
-Float::INFINITY
|
data/lib/psych/versions.rb
CHANGED
@@ -272,6 +272,8 @@ module Psych
|
|
272
272
|
tag = 'tag:yaml.org,2002:str'
|
273
273
|
plain = false
|
274
274
|
quote = false
|
275
|
+
elsif o == 'y' || o == 'n'
|
276
|
+
style = Nodes::Scalar::DOUBLE_QUOTED
|
275
277
|
elsif @line_width && o.length > @line_width
|
276
278
|
style = Nodes::Scalar::FOLDED
|
277
279
|
elsif o =~ /^[^[:word:]][^"]*$/
|
data/lib/psych.rb
CHANGED
@@ -33,7 +33,7 @@ require 'psych/class_loader'
|
|
33
33
|
#
|
34
34
|
# Psych is a YAML parser and emitter.
|
35
35
|
# Psych leverages libyaml [Home page: https://pyyaml.org/wiki/LibYAML]
|
36
|
-
# or [
|
36
|
+
# or [git repo: https://github.com/yaml/libyaml] for its YAML parsing
|
37
37
|
# and emitting capabilities. In addition to wrapping libyaml, Psych also
|
38
38
|
# knows how to serialize and de-serialize most Ruby objects to and from
|
39
39
|
# the YAML format.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: psych
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Patterson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: |
|
16
16
|
Psych is a YAML parser and emitter. Psych leverages libyaml[https://pyyaml.org/wiki/LibYAML]
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
|
-
rubygems_version: 3.
|
120
|
+
rubygems_version: 3.3.0.dev
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Psych is a YAML parser and emitter
|