psych 5.1.1 → 5.1.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: 0113beab783fc4f9d4e06f6c9e96558369aa4f2f4f7fd1b5641da48c21b8ea87
4
- data.tar.gz: cbb6be7457de54629be12d60468e9fa116f4ea2ea9a36a7a82522e82d4bf879f
3
+ metadata.gz: 39bdb85aafa27b992e7e8db6905f6e1bc52976bbfc3f71e0ce1adee552a89682
4
+ data.tar.gz: a8d566aa3e16cde752a41ffdb5990af2b2d4f7082ad8774dbd3a8250636fef20
5
5
  SHA512:
6
- metadata.gz: a06797dd9641b66251b16e39436bb53f98ef78cf917b5d4428d2c8b35db5e1c9d96a4c0c2666277e743233b044e2629339e06c798c274e94db34c2e227bcb8d2
7
- data.tar.gz: 2bc0032b201db800d5f72180b8fddc41653daf61c2be6f332ab5f9a6376393294b6fed9e144bcf69a56240d2a2369e4d2d681676bf2c7e6473491ef2beb066d9
6
+ metadata.gz: ca436b4d85c8c931bfc9b05d2f16a52f03d01f65c5d708419f75ce926ba55ef9aa4af95a811fec0309773ec6f8963002ffa5ead5cc2f69e1666d3759f24a688b
7
+ data.tar.gz: bc2aabe53f58a0eb15fed477c96767bc4267ce6bd1f929010c580a0891fdbe28517fdf030a09356dd9b84000c60e1fe7d403d2d9414b5b3a7db8bfa152f5ba5a
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Psych
4
4
  # The version of Psych you are using
5
- VERSION = '5.1.1'
5
+ VERSION = '5.1.2'
6
6
 
7
7
  if RUBY_ENGINE == 'jruby'
8
8
  DEFAULT_SNAKEYAML_VERSION = '2.7'.freeze
@@ -101,7 +101,7 @@ module Psych
101
101
  source = $1
102
102
  options = 0
103
103
  lang = nil
104
- ($2 || '').split('').each do |option|
104
+ $2&.each_char do |option|
105
105
  case option
106
106
  when 'x' then options |= Regexp::EXTENDED
107
107
  when 'i' then options |= Regexp::IGNORECASE
@@ -15,30 +15,29 @@ module Psych
15
15
  class YAMLTree < Psych::Visitors::Visitor
16
16
  class Registrar # :nodoc:
17
17
  def initialize
18
- @obj_to_id = {}
19
- @obj_to_node = {}
18
+ @obj_to_id = {}.compare_by_identity
19
+ @obj_to_node = {}.compare_by_identity
20
20
  @targets = []
21
21
  @counter = 0
22
22
  end
23
23
 
24
24
  def register target, node
25
- return unless target.respond_to? :object_id
26
25
  @targets << target
27
- @obj_to_node[target.object_id] = node
26
+ @obj_to_node[target] = node
28
27
  end
29
28
 
30
29
  def key? target
31
- @obj_to_node.key? target.object_id
30
+ @obj_to_node.key? target
32
31
  rescue NoMethodError
33
32
  false
34
33
  end
35
34
 
36
35
  def id_for target
37
- @obj_to_id[target.object_id] ||= (@counter += 1)
36
+ @obj_to_id[target] ||= (@counter += 1)
38
37
  end
39
38
 
40
39
  def node_for target
41
- @obj_to_node[target.object_id]
40
+ @obj_to_node[target]
42
41
  end
43
42
  end
44
43
 
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: 5.1.1
4
+ version: 5.1.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: 2023-10-11 00:00:00.000000000 Z
13
+ date: 2023-12-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: stringio
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.5.0.dev
117
+ rubygems_version: 3.5.1
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Psych is a YAML parser and emitter