psych 4.0.4-java → 4.0.6-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: b31da54485c398a26cd10e3dec1ab3498a36a95edd598c61ff34ec544b6b73a6
4
- data.tar.gz: 476898d5a9dbea84360caedb8b53274ffbe869bec0de5e3473c4a75cdc9c96c9
3
+ metadata.gz: e9f42a29eed9ab87717ca14e50f27e94e287823b0557748a320cc981622589b8
4
+ data.tar.gz: f2b6bd6ae5d9d36b4c3646e46d922b422f7b422ed6573af33d185b4688924b66
5
5
  SHA512:
6
- metadata.gz: 5d7efe52ceb22c90a351b2c32bda30f81843e903478b06779dba39f4fb5142ec738f5f8a2ae22124ce528b05ae7b7c8994c2becf92da1c568c1346f19e34c920
7
- data.tar.gz: 3f5bf83fe16f1f67fe300148cd671b4838ff46630576d8e28caf15aaa28abed43377e30855e8eebd61b36446e9fff9a882dffef010c5defc961a1cc5d0eaee96
6
+ metadata.gz: 8f5cbdc18603acb58933a59f9fe47af3f33166ab6422c75cae056c9ac2ce14d26855f479efcd4db91f8470103b60e03144989220ea37e21aa25fb5810f2002e9
7
+ data.tar.gz: 63b22e07d7c7df12f9e449fa71c7426225c6628da18493604180064280137793d5046c4a9803e9912a5673c8d19c67e739dcfbc0510fd20faa2353bace6599d0
@@ -63,7 +63,7 @@ module Psych
63
63
  elsif string.match?(/^\d{4}-(?:1[012]|0\d|\d)-(?:[12]\d|3[01]|0\d|\d)$/)
64
64
  require 'date'
65
65
  begin
66
- class_loader.date.strptime(string, '%Y-%m-%d')
66
+ class_loader.date.strptime(string, '%F', Date::GREGORIAN)
67
67
  rescue ArgumentError
68
68
  string
69
69
  end
@@ -2,9 +2,9 @@
2
2
 
3
3
  module Psych
4
4
  # The version of Psych you are using
5
- VERSION = '4.0.4'
5
+ VERSION = '4.0.6'
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?
@@ -482,8 +482,8 @@ module Psych
482
482
  @emitter.end_mapping
483
483
  end
484
484
 
485
- def format_time time
486
- if time.utc?
485
+ def format_time time, utc = time.utc?
486
+ if utc
487
487
  time.strftime("%Y-%m-%d %H:%M:%S.%9N Z")
488
488
  else
489
489
  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: 4.0.4
4
+ version: 4.0.6
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: 2022-05-16 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
@@ -137,7 +137,7 @@ 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
140
+ - jar org.yaml:snakeyaml, 1.33
141
141
  rubygems_version: 3.2.29
142
142
  signing_key:
143
143
  specification_version: 4