psych 3.2.1-java → 3.3.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/psych/psych.c +3 -0
- data/ext/psych/yaml/yaml.h +3 -3
- data/lib/psych.rb +34 -14
- data/lib/psych/class_loader.rb +6 -4
- data/lib/psych/versions.rb +1 -1
- data/lib/psych/visitors/visitor.rb +17 -3
- data/lib/psych/visitors/yaml_tree.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07175c114aaed4a3bc43893283642e907290b3c24178197185ef05d0e66c4b92
|
4
|
+
data.tar.gz: d85e294b5c13fd28a65995a955a2fdbc19e4c8f994f8319e66a9575f95d211dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e27409598fced4c6c42b7c618e190b64dc64cf64fa3b730b3ed8e9c948c054800bdbd13c9ba4d6c58d88862f9b78c1d53b3b483f0f7d2314f5a4729d9556a82
|
7
|
+
data.tar.gz: 9bed3482df75bdbd9344d13657035a889bcf7b3ff1182aaf1a17ea3411aba028c89448b279f514b108e194903713430c3b7a2224e87fa1ede425dc8b2bfed93a
|
data/ext/psych/psych.c
CHANGED
data/ext/psych/yaml/yaml.h
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* @file yaml.h
|
3
3
|
* @brief Public interface for libyaml.
|
4
|
-
*
|
4
|
+
*
|
5
5
|
* Include the header file with the code:
|
6
6
|
* @code
|
7
7
|
* #include <yaml.h>
|
@@ -390,7 +390,7 @@ typedef struct yaml_event_s {
|
|
390
390
|
|
391
391
|
/** The event data. */
|
392
392
|
union {
|
393
|
-
|
393
|
+
|
394
394
|
/** The stream parameters (for @c YAML_STREAM_START_EVENT). */
|
395
395
|
struct {
|
396
396
|
/** The document encoding. */
|
@@ -726,7 +726,7 @@ struct yaml_node_s {
|
|
726
726
|
|
727
727
|
/** The node data. */
|
728
728
|
union {
|
729
|
-
|
729
|
+
|
730
730
|
/** The scalar parameters (for @c YAML_SCALAR_NODE). */
|
731
731
|
struct {
|
732
732
|
/** The scalar value. */
|
data/lib/psych.rb
CHANGED
@@ -233,9 +233,9 @@ require 'psych/class_loader'
|
|
233
233
|
|
234
234
|
module Psych
|
235
235
|
# The version of libyaml Psych is using
|
236
|
-
LIBYAML_VERSION = Psych.libyaml_version.join
|
236
|
+
LIBYAML_VERSION = Psych.libyaml_version.join('.').freeze
|
237
237
|
# Deprecation guard
|
238
|
-
NOT_GIVEN = Object.new
|
238
|
+
NOT_GIVEN = Object.new.freeze
|
239
239
|
private_constant :NOT_GIVEN
|
240
240
|
|
241
241
|
###
|
@@ -595,28 +595,25 @@ module Psych
|
|
595
595
|
end
|
596
596
|
|
597
597
|
# :stopdoc:
|
598
|
-
@domain_types = {}
|
599
598
|
def self.add_domain_type domain, type_tag, &block
|
600
599
|
key = ['tag', domain, type_tag].join ':'
|
601
|
-
|
602
|
-
|
600
|
+
domain_types[key] = [key, block]
|
601
|
+
domain_types["tag:#{type_tag}"] = [key, block]
|
603
602
|
end
|
604
603
|
|
605
604
|
def self.add_builtin_type type_tag, &block
|
606
605
|
domain = 'yaml.org,2002'
|
607
606
|
key = ['tag', domain, type_tag].join ':'
|
608
|
-
|
607
|
+
domain_types[key] = [key, block]
|
609
608
|
end
|
610
609
|
|
611
610
|
def self.remove_type type_tag
|
612
|
-
|
611
|
+
domain_types.delete type_tag
|
613
612
|
end
|
614
613
|
|
615
|
-
@load_tags = {}
|
616
|
-
@dump_tags = {}
|
617
614
|
def self.add_tag tag, klass
|
618
|
-
|
619
|
-
|
615
|
+
load_tags[tag] = klass.name
|
616
|
+
dump_tags[klass] = tag
|
620
617
|
end
|
621
618
|
|
622
619
|
# Workaround for emulating `warn '...', uplevel: 1` in Ruby 2.4 or lower.
|
@@ -635,9 +632,32 @@ module Psych
|
|
635
632
|
private_class_method :warn_with_uplevel, :parse_caller
|
636
633
|
|
637
634
|
class << self
|
638
|
-
|
639
|
-
|
640
|
-
|
635
|
+
if defined?(Ractor)
|
636
|
+
require 'forwardable'
|
637
|
+
extend Forwardable
|
638
|
+
|
639
|
+
class Config
|
640
|
+
attr_accessor :load_tags, :dump_tags, :domain_types
|
641
|
+
def initialize
|
642
|
+
@load_tags = {}
|
643
|
+
@dump_tags = {}
|
644
|
+
@domain_types = {}
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
def config
|
649
|
+
Ractor.current[:PsychConfig] ||= Config.new
|
650
|
+
end
|
651
|
+
|
652
|
+
def_delegators :config, :load_tags, :dump_tags, :domain_types, :load_tags=, :dump_tags=, :domain_types=
|
653
|
+
else
|
654
|
+
attr_accessor :load_tags
|
655
|
+
attr_accessor :dump_tags
|
656
|
+
attr_accessor :domain_types
|
657
|
+
end
|
641
658
|
end
|
659
|
+
self.load_tags = {}
|
660
|
+
self.dump_tags = {}
|
661
|
+
self.domain_types = {}
|
642
662
|
# :startdoc:
|
643
663
|
end
|
data/lib/psych/class_loader.rb
CHANGED
@@ -35,9 +35,11 @@ module Psych
|
|
35
35
|
|
36
36
|
constants.each do |const|
|
37
37
|
konst = const_get const
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
class_eval <<~RUBY
|
39
|
+
def #{const.to_s.downcase}
|
40
|
+
load #{konst.inspect}
|
41
|
+
end
|
42
|
+
RUBY
|
41
43
|
end
|
42
44
|
|
43
45
|
private
|
@@ -69,7 +71,7 @@ module Psych
|
|
69
71
|
rescue
|
70
72
|
nil
|
71
73
|
end
|
72
|
-
}.compact]
|
74
|
+
}.compact].freeze
|
73
75
|
|
74
76
|
class Restricted < ClassLoader
|
75
77
|
def initialize classes, symbols
|
data/lib/psych/versions.rb
CHANGED
@@ -8,12 +8,26 @@ module Psych
|
|
8
8
|
|
9
9
|
private
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
# @api private
|
12
|
+
def self.dispatch_cache
|
13
|
+
Hash.new do |hash, klass|
|
14
|
+
hash[klass] = :"visit_#{klass.name.gsub('::', '_')}"
|
15
|
+
end.compare_by_identity
|
16
|
+
end
|
17
|
+
|
18
|
+
if defined?(Ractor)
|
19
|
+
def dispatch
|
20
|
+
Ractor.current[:Psych_Visitors_Visitor] ||= Visitor.dispatch_cache
|
21
|
+
end
|
22
|
+
else
|
23
|
+
DISPATCH = dispatch_cache
|
24
|
+
def dispatch
|
25
|
+
DISPATCH
|
26
|
+
end
|
13
27
|
end
|
14
28
|
|
15
29
|
def visit target
|
16
|
-
send
|
30
|
+
send dispatch[target.class], target
|
17
31
|
end
|
18
32
|
end
|
19
33
|
end
|
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.
|
4
|
+
version: 3.3.0
|
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: 2020-12-
|
13
|
+
date: 2020-12-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|