psych 3.3.2-java → 3.3.4-java

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: 3f502010ef57ab680b8a273b17cb0c7bcf38cd9e3c9f4885323c8817933bbf7b
4
- data.tar.gz: 2be8f458c94bf961bb3c9681ced9ea2e00e67095e9ce0f4e062111a0b1e6bbaa
3
+ metadata.gz: 7e314c5613e0b86ac2a12afd58de21b4b2253bbce98c9f5059f193b07abbbe47
4
+ data.tar.gz: 53031659a8f278e7003f36b3732401a4c63e7ec3d05f7a5302bb3610f7d0b18c
5
5
  SHA512:
6
- metadata.gz: 4af84db27ecb5c12a92c8f80b6078a639e75f11ce0284b68e57e4906e62893ffd7cfe77780e6729374d760e136b61c70709050c8aebce345b373ea3fbfd00f77
7
- data.tar.gz: afcf7ee1fac4892db0789448761d325d951904423d914e579a1b51740ae3bdb0c5de9b20590b11ed88aa56c03fff25bb16623b7771c45e9957dc8e07b716d81a
6
+ metadata.gz: 64ffd8d7ccacad0f5c934e0756343a131b07d245972e5e0d58526c8ea3e7b19d2259f89b19b8eeb123d0746da61e8373e91ecc3f7db73f9db25eba46e5a90310
7
+ data.tar.gz: 949dccd16148d62ac4c7b3fc61ea16739470ad213c06070b9f93f71d5d595696e4e6d7e4b50755cdf6d04b31a580c07ea5283136a33d228ae8bc1fe466a86176
@@ -34,7 +34,7 @@ module Psych
34
34
 
35
35
  # Check for a String type, being careful not to get caught by hash keys, hex values, and
36
36
  # special floats (e.g., -.inf).
37
- if string.match?(/^[^\d\.:-]?[A-Za-z_\s!@#\$%\^&\*\(\)\{\}\<\>\|\/\\~;=]+/) || string.match?(/\n/)
37
+ if string.match?(%r{^[^\d.:-]?[[:alpha:]_\s!@#$%\^&*(){}<>|/\\~;=]+}) || string.match?(/\n/)
38
38
  return string if string.length > 5
39
39
 
40
40
  if string.match?(/^[^ytonf~]/i)
@@ -57,7 +57,7 @@ module Psych
57
57
  elsif string.match?(/^\d{4}-(?:1[012]|0\d|\d)-(?:[12]\d|3[01]|0\d|\d)$/)
58
58
  require 'date'
59
59
  begin
60
- class_loader.date.strptime(string, '%Y-%m-%d')
60
+ class_loader.date.strptime(string, '%F', Date::GREGORIAN)
61
61
  rescue ArgumentError
62
62
  string
63
63
  end
@@ -2,9 +2,9 @@
2
2
 
3
3
  module Psych
4
4
  # The version of Psych you are using
5
- VERSION = '3.3.2'
5
+ VERSION = '3.3.4'
6
6
 
7
7
  if RUBY_ENGINE == 'jruby'
8
- DEFAULT_SNAKEYAML_VERSION = '1.28'.freeze
8
+ DEFAULT_SNAKEYAML_VERSION = '1.33'.freeze
9
9
  end
10
10
  end
@@ -80,7 +80,9 @@ module Psych
80
80
  when "!ruby/object:DateTime"
81
81
  class_loader.date_time
82
82
  require 'date' unless defined? DateTime
83
- @ss.parse_time(o.value).to_datetime
83
+ t = @ss.parse_time(o.value)
84
+ DateTime.civil(*t.to_a[0, 6].reverse, Rational(t.utc_offset, 86400)) +
85
+ (t.subsec/86400)
84
86
  when '!ruby/encoding'
85
87
  ::Encoding.find o.value
86
88
  when "!ruby/object:Complex"
@@ -192,12 +192,13 @@ module Psych
192
192
  register o, @emitter.scalar(o.inspect, nil, '!ruby/regexp', false, false, Nodes::Scalar::ANY)
193
193
  end
194
194
 
195
+ def visit_Date o
196
+ register o, visit_Integer(o.gregorian)
197
+ end
198
+
195
199
  def visit_DateTime o
196
- formatted = if o.offset.zero?
197
- o.strftime("%Y-%m-%d %H:%M:%S.%9N Z".freeze)
198
- else
199
- o.strftime("%Y-%m-%d %H:%M:%S.%9N %:z".freeze)
200
- end
200
+ t = o.italy
201
+ formatted = format_time t, t.offset.zero?
201
202
  tag = '!ruby/object:DateTime'
202
203
  register o, @emitter.scalar(formatted, nil, tag, false, false, Nodes::Scalar::ANY)
203
204
  end
@@ -235,7 +236,6 @@ module Psych
235
236
  end
236
237
  alias :visit_TrueClass :visit_Integer
237
238
  alias :visit_FalseClass :visit_Integer
238
- alias :visit_Date :visit_Integer
239
239
 
240
240
  def visit_Float o
241
241
  if o.nan?
@@ -480,8 +480,8 @@ module Psych
480
480
  @emitter.end_mapping
481
481
  end
482
482
 
483
- def format_time time
484
- if time.utc?
483
+ def format_time time, utc = time.utc?
484
+ if utc
485
485
  time.strftime("%Y-%m-%d %H:%M:%S.%9N Z")
486
486
  else
487
487
  time.strftime("%Y-%m-%d %H:%M:%S.%9N %:z")
data/lib/psych.jar CHANGED
Binary file
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: 3.3.2
4
+ version: 3.3.4
5
5
  platform: java
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-05-13 00:00:00.000000000 Z
13
+ date: 2022-09-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  requirement: !ruby/object:Gem::Requirement
@@ -19,8 +19,8 @@ dependencies:
19
19
  - !ruby/object:Gem::Version
20
20
  version: 0.1.7
21
21
  name: jar-dependencies
22
- type: :runtime
23
22
  prerelease: false
23
+ type: :runtime
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
@@ -137,8 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  requirements:
140
- - jar org.yaml:snakeyaml, 1.28
141
- rubygems_version: 3.0.6
140
+ - jar org.yaml:snakeyaml, 1.33
141
+ rubygems_version: 3.2.29
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Psych is a YAML parser and emitter