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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fa803573d39d69c706eec844ab105ce74589c01fd5284340d353e577829c4e1
4
- data.tar.gz: f5ec2260e1d0d1f2703d6c4cb672235b71754045a95b6a74cc7d12f5b490d0be
3
+ metadata.gz: 1a4075fe0c4db3e6dcc7e5b025be7b155d634502c706e55c69493ce5464e8e58
4
+ data.tar.gz: 2cc4c986617d151391906db8d8ec11c10d27a374142f4eff0dfc6d52939fa42d
5
5
  SHA512:
6
- metadata.gz: 2127235feecf70da3458afd0cf70a916d5f04e0d7bd659f731ec8f18b8d6438ec4f9c81385ba055029825cd4db28df940db4447cff20ca767b9ebe526753e595
7
- data.tar.gz: 0d8247f8a1cd7a2f9cb260c2dde98abdf7e7d23c6616209e8d06f7245c0eeeb8c17a289d006ae9bf0c5c674f91292c5014b001dfa85d18c92ce85bfc1907bf12
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/test/unit/core_assertions.rb", "./test/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
@@ -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
- FLOAT = /^(?:[-+]?([0-9][0-9_,]*)?\.[0-9]*([eE][-+][0-9]+)?(?# base 10)
13
- |[-+]?\.(inf|Inf|INF)(?# infinity)
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_,]+ (?# base 2)
18
- |[-+]?0[0-7_,]+ (?# base 8)
19
- |[-+]?(?:0|[1-9][0-9_,]*) (?# base 10)
20
- |[-+]?0x[0-9a-fA-F_,]+ (?# base 16))$/x
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?(/^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/) || string.match?(/\n/)
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?(/^\.inf$/i)
63
+ elsif string.match?(/^\+?\.inf$/i)
65
64
  Float::INFINITY
66
65
  elsif string.match?(/^-\.inf$/i)
67
66
  -Float::INFINITY
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Psych
4
4
  # The version of Psych you are using
5
- VERSION = '4.0.1'
5
+ VERSION = '4.0.2'
6
6
 
7
7
  if RUBY_ENGINE == 'jruby'
8
8
  DEFAULT_SNAKEYAML_VERSION = '1.28'.freeze
@@ -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 [HG repo: https://bitbucket.org/xi/libyaml] for its YAML parsing
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.1
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-06-07 00:00:00.000000000 Z
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.2.15
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