psych 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/ext/psych/yaml/yaml.h +1 -1
 - data/lib/psych/versions.rb +2 -2
 - data/lib/psych/visitors/to_ruby.rb +9 -7
 - data/lib/psych/visitors/visitor.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: cc79877c9edee404384093bf5d8588162529b662c53c32ac7640dfe2c8c25855
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ba8c0cc414092f566944869bba1f70e3343a93c50f9ac9a52156b2d16c729649
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7356287aed8bd380f9e3fd31077dccbabb0fc70aac69abc82d76e80caea2d0c661a3a9d684d431fe3acbb71f68242d3f478512bdcdee3485d3fa66b14cdc5a5d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 9f6791b68628eb14f35a76a7a1fb7569dd9e9aa65533b005c65f80a0b2ec6bb78b10cc4d1830c177daaadcbfa93b03bf858aa29f6788f2ef45a4c8720f5476c2
         
     | 
    
        data/ext/psych/yaml/yaml.h
    CHANGED
    
    | 
         @@ -1734,7 +1734,7 @@ typedef struct yaml_emitter_s { 
     | 
|
| 
       1734 
1734 
     | 
    
         
             
                    size_t length;
         
     | 
| 
       1735 
1735 
     | 
    
         
             
                    /** Does the scalar contain line breaks? */
         
     | 
| 
       1736 
1736 
     | 
    
         
             
                    int multiline;
         
     | 
| 
       1737 
     | 
    
         
            -
                    /** Can the scalar be  
     | 
| 
      
 1737 
     | 
    
         
            +
                    /** Can the scalar be expressed in the flow plain style? */
         
     | 
| 
       1738 
1738 
     | 
    
         
             
                    int flow_plain_allowed;
         
     | 
| 
       1739 
1739 
     | 
    
         
             
                    /** Can the scalar be expressed in the block plain style? */
         
     | 
| 
       1740 
1740 
     | 
    
         
             
                    int block_plain_allowed;
         
     | 
    
        data/lib/psych/versions.rb
    CHANGED
    
    
| 
         @@ -24,6 +24,7 @@ module Psych 
     | 
|
| 
       24 
24 
     | 
    
         
             
                    super()
         
     | 
| 
       25 
25 
     | 
    
         
             
                    @st = {}
         
     | 
| 
       26 
26 
     | 
    
         
             
                    @ss = ss
         
     | 
| 
      
 27 
     | 
    
         
            +
                    @load_tags = Psych.load_tags
         
     | 
| 
       27 
28 
     | 
    
         
             
                    @domain_types = Psych.domain_types
         
     | 
| 
       28 
29 
     | 
    
         
             
                    @class_loader = class_loader
         
     | 
| 
       29 
30 
     | 
    
         
             
                    @symbolize_names = symbolize_names
         
     | 
| 
         @@ -48,7 +49,7 @@ module Psych 
     | 
|
| 
       48 
49 
     | 
    
         
             
                  end
         
     | 
| 
       49 
50 
     | 
    
         | 
| 
       50 
51 
     | 
    
         
             
                  def deserialize o
         
     | 
| 
       51 
     | 
    
         
            -
                    if klass = resolve_class( 
     | 
| 
      
 52 
     | 
    
         
            +
                    if klass = resolve_class(@load_tags[o.tag])
         
     | 
| 
       52 
53 
     | 
    
         
             
                      instance = klass.allocate
         
     | 
| 
       53 
54 
     | 
    
         | 
| 
       54 
55 
     | 
    
         
             
                      if instance.respond_to?(:init_with)
         
     | 
| 
         @@ -128,7 +129,7 @@ module Psych 
     | 
|
| 
       128 
129 
     | 
    
         
             
                  end
         
     | 
| 
       129 
130 
     | 
    
         | 
| 
       130 
131 
     | 
    
         
             
                  def visit_Psych_Nodes_Sequence o
         
     | 
| 
       131 
     | 
    
         
            -
                    if klass = resolve_class( 
     | 
| 
      
 132 
     | 
    
         
            +
                    if klass = resolve_class(@load_tags[o.tag])
         
     | 
| 
       132 
133 
     | 
    
         
             
                      instance = klass.allocate
         
     | 
| 
       133 
134 
     | 
    
         | 
| 
       134 
135 
     | 
    
         
             
                      if instance.respond_to?(:init_with)
         
     | 
| 
         @@ -160,8 +161,8 @@ module Psych 
     | 
|
| 
       160 
161 
     | 
    
         
             
                  end
         
     | 
| 
       161 
162 
     | 
    
         | 
| 
       162 
163 
     | 
    
         
             
                  def visit_Psych_Nodes_Mapping o
         
     | 
| 
       163 
     | 
    
         
            -
                    if  
     | 
| 
       164 
     | 
    
         
            -
                      return revive(resolve_class( 
     | 
| 
      
 164 
     | 
    
         
            +
                    if @load_tags[o.tag]
         
     | 
| 
      
 165 
     | 
    
         
            +
                      return revive(resolve_class(@load_tags[o.tag]), o)
         
     | 
| 
       165 
166 
     | 
    
         
             
                    end
         
     | 
| 
       166 
167 
     | 
    
         
             
                    return revive_hash(register(o, {}), o) unless o.tag
         
     | 
| 
       167 
168 
     | 
    
         | 
| 
         @@ -326,6 +327,7 @@ module Psych 
     | 
|
| 
       326 
327 
     | 
    
         
             
                  end
         
     | 
| 
       327 
328 
     | 
    
         | 
| 
       328 
329 
     | 
    
         
             
                  private
         
     | 
| 
      
 330 
     | 
    
         
            +
             
     | 
| 
       329 
331 
     | 
    
         
             
                  def register node, object
         
     | 
| 
       330 
332 
     | 
    
         
             
                    @st[node.anchor] = object if node.anchor
         
     | 
| 
       331 
333 
     | 
    
         
             
                    object
         
     | 
| 
         @@ -337,7 +339,7 @@ module Psych 
     | 
|
| 
       337 
339 
     | 
    
         
             
                    list
         
     | 
| 
       338 
340 
     | 
    
         
             
                  end
         
     | 
| 
       339 
341 
     | 
    
         | 
| 
       340 
     | 
    
         
            -
                  def revive_hash hash, o
         
     | 
| 
      
 342 
     | 
    
         
            +
                  def revive_hash hash, o, tagged= false
         
     | 
| 
       341 
343 
     | 
    
         
             
                    o.children.each_slice(2) { |k,v|
         
     | 
| 
       342 
344 
     | 
    
         
             
                      key = accept(k)
         
     | 
| 
       343 
345 
     | 
    
         
             
                      val = accept(v)
         
     | 
| 
         @@ -364,7 +366,7 @@ module Psych 
     | 
|
| 
       364 
366 
     | 
    
         
             
                          hash[key] = val
         
     | 
| 
       365 
367 
     | 
    
         
             
                        end
         
     | 
| 
       366 
368 
     | 
    
         
             
                      else
         
     | 
| 
       367 
     | 
    
         
            -
                        if @symbolize_names
         
     | 
| 
      
 369 
     | 
    
         
            +
                        if !tagged && @symbolize_names
         
     | 
| 
       368 
370 
     | 
    
         
             
                          key = key.to_sym
         
     | 
| 
       369 
371 
     | 
    
         
             
                        elsif !@freeze
         
     | 
| 
       370 
372 
     | 
    
         
             
                          key = deduplicate(key)
         
     | 
| 
         @@ -402,7 +404,7 @@ module Psych 
     | 
|
| 
       402 
404 
     | 
    
         | 
| 
       403 
405 
     | 
    
         
             
                  def revive klass, node
         
     | 
| 
       404 
406 
     | 
    
         
             
                    s = register(node, klass.allocate)
         
     | 
| 
       405 
     | 
    
         
            -
                    init_with(s, revive_hash({}, node), node)
         
     | 
| 
      
 407 
     | 
    
         
            +
                    init_with(s, revive_hash({}, node, true), node)
         
     | 
| 
       406 
408 
     | 
    
         
             
                  end
         
     | 
| 
       407 
409 
     | 
    
         | 
| 
       408 
410 
     | 
    
         
             
                  def init_with o, h, node
         
     | 
| 
         @@ -17,7 +17,7 @@ module Psych 
     | 
|
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
                  if defined?(Ractor)
         
     | 
| 
       19 
19 
     | 
    
         
             
                    def dispatch
         
     | 
| 
       20 
     | 
    
         
            -
                      Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache
         
     | 
| 
      
 20 
     | 
    
         
            +
                      @dispatch_cache ||= (Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache)
         
     | 
| 
       21 
21 
     | 
    
         
             
                    end
         
     | 
| 
       22 
22 
     | 
    
         
             
                  else
         
     | 
| 
       23 
23 
     | 
    
         
             
                    DISPATCH = dispatch_cache
         
     | 
    
        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. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 3.3.1
         
     | 
| 
       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:  
     | 
| 
      
 13 
     | 
    
         
            +
            date: 2021-02-24 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.1.4
         
     | 
| 
       121 
121 
     | 
    
         
             
            signing_key:
         
     | 
| 
       122 
122 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       123 
123 
     | 
    
         
             
            summary: Psych is a YAML parser and emitter
         
     |