psych 2.2.1 → 5.1.2
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 +5 -5
- data/CONTRIBUTING.md +24 -0
- data/{ext/psych/yaml/LICENSE → LICENSE} +9 -7
- data/README.md +13 -13
- data/ext/psych/depend +14 -0
- data/ext/psych/extconf.rb +43 -29
- data/ext/psych/psych.c +6 -3
- data/ext/psych/psych_emitter.c +10 -9
- data/ext/psych/psych_parser.c +69 -72
- data/ext/psych/psych_yaml_tree.c +0 -12
- data/lib/psych/class_loader.rb +11 -9
- data/lib/psych/coder.rb +1 -1
- data/lib/psych/core_ext.rb +3 -20
- data/lib/psych/exception.rb +17 -3
- data/lib/psych/handler.rb +8 -3
- data/lib/psych/handlers/document_stream.rb +2 -2
- data/lib/psych/handlers/recorder.rb +2 -2
- data/lib/psych/json/ruby_events.rb +1 -1
- data/lib/psych/json/stream.rb +3 -3
- data/lib/psych/json/tree_builder.rb +2 -2
- data/lib/psych/json/yaml_events.rb +1 -1
- data/lib/psych/nodes/alias.rb +3 -1
- data/lib/psych/nodes/document.rb +3 -1
- data/lib/psych/nodes/mapping.rb +3 -1
- data/lib/psych/nodes/node.rb +24 -5
- data/lib/psych/nodes/scalar.rb +4 -2
- data/lib/psych/nodes/sequence.rb +3 -1
- data/lib/psych/nodes/stream.rb +3 -1
- data/lib/psych/nodes.rb +8 -8
- data/lib/psych/omap.rb +1 -1
- data/lib/psych/parser.rb +14 -1
- data/lib/psych/scalar_scanner.rb +39 -47
- data/lib/psych/set.rb +1 -1
- data/lib/psych/stream.rb +1 -1
- data/lib/psych/streaming.rb +1 -1
- data/lib/psych/syntax_error.rb +2 -2
- data/lib/psych/tree_builder.rb +48 -8
- data/lib/psych/versions.rb +5 -4
- data/lib/psych/visitors/depth_first.rb +1 -1
- data/lib/psych/visitors/emitter.rb +1 -1
- data/lib/psych/visitors/json_tree.rb +2 -2
- data/lib/psych/visitors/to_ruby.rb +61 -31
- data/lib/psych/visitors/visitor.rb +18 -4
- data/lib/psych/visitors/yaml_tree.rb +111 -123
- data/lib/psych/visitors.rb +7 -7
- data/lib/psych/y.rb +1 -1
- data/lib/psych.rb +333 -96
- metadata +16 -52
- data/.gitignore +0 -14
- data/.travis.yml +0 -18
- data/CHANGELOG.rdoc +0 -576
- data/Gemfile +0 -3
- data/Mavenfile +0 -7
- data/Rakefile +0 -33
- data/bin/console +0 -7
- data/bin/setup +0 -6
- data/ext/psych/.gitignore +0 -11
- data/ext/psych/yaml/api.c +0 -1392
- data/ext/psych/yaml/config.h +0 -10
- data/ext/psych/yaml/dumper.c +0 -394
- data/ext/psych/yaml/emitter.c +0 -2329
- data/ext/psych/yaml/loader.c +0 -444
- data/ext/psych/yaml/parser.c +0 -1374
- data/ext/psych/yaml/reader.c +0 -469
- data/ext/psych/yaml/scanner.c +0 -3576
- data/ext/psych/yaml/writer.c +0 -141
- data/ext/psych/yaml/yaml.h +0 -1971
- data/ext/psych/yaml/yaml_private.h +0 -662
- data/lib/psych/deprecated.rb +0 -86
- data/psych.gemspec +0 -43
data/lib/psych/deprecated.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
# frozen_string_literal: false
|
2
|
-
require 'date'
|
3
|
-
|
4
|
-
module Psych
|
5
|
-
DEPRECATED = __FILE__ # :nodoc:
|
6
|
-
|
7
|
-
module DeprecatedMethods # :nodoc:
|
8
|
-
attr_accessor :taguri
|
9
|
-
attr_accessor :to_yaml_style
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.quick_emit thing, opts = {}, &block # :nodoc:
|
13
|
-
warn "#{caller[0]}: YAML.quick_emit is deprecated" if $VERBOSE && !caller[0].start_with?(File.dirname(__FILE__))
|
14
|
-
target = eval 'self', block.binding
|
15
|
-
target.extend DeprecatedMethods
|
16
|
-
metaclass = class << target; self; end
|
17
|
-
metaclass.send(:define_method, :encode_with) do |coder|
|
18
|
-
target.taguri = coder.tag
|
19
|
-
target.to_yaml_style = coder.style
|
20
|
-
block.call coder
|
21
|
-
end
|
22
|
-
target.psych_to_yaml unless opts[:nodump]
|
23
|
-
end
|
24
|
-
|
25
|
-
# This method is deprecated, use Psych.load_stream instead.
|
26
|
-
def self.load_documents yaml, &block
|
27
|
-
if $VERBOSE
|
28
|
-
warn "#{caller[0]}: load_documents is deprecated, use load_stream"
|
29
|
-
end
|
30
|
-
list = load_stream yaml
|
31
|
-
return list unless block_given?
|
32
|
-
list.each(&block)
|
33
|
-
end
|
34
|
-
|
35
|
-
def self.detect_implicit thing
|
36
|
-
warn "#{caller[0]}: detect_implicit is deprecated" if $VERBOSE
|
37
|
-
return '' unless String === thing
|
38
|
-
return 'null' if '' == thing
|
39
|
-
ss = ScalarScanner.new(ClassLoader.new)
|
40
|
-
ss.tokenize(thing).class.name.downcase
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.add_ruby_type type_tag, &block
|
44
|
-
warn "#{caller[0]}: add_ruby_type is deprecated, use add_domain_type" if $VERBOSE
|
45
|
-
domain = 'ruby.yaml.org,2002'
|
46
|
-
key = ['tag', domain, type_tag].join ':'
|
47
|
-
@domain_types[key] = [key, block]
|
48
|
-
end
|
49
|
-
|
50
|
-
def self.add_private_type type_tag, &block
|
51
|
-
warn "#{caller[0]}: add_private_type is deprecated, use add_domain_type" if $VERBOSE
|
52
|
-
domain = 'x-private'
|
53
|
-
key = [domain, type_tag].join ':'
|
54
|
-
@domain_types[key] = [key, block]
|
55
|
-
end
|
56
|
-
|
57
|
-
def self.tagurize thing
|
58
|
-
warn "#{caller[0]}: add_private_type is deprecated, use add_domain_type" if $VERBOSE
|
59
|
-
return thing unless String === thing
|
60
|
-
"tag:yaml.org,2002:#{thing}"
|
61
|
-
end
|
62
|
-
|
63
|
-
def self.read_type_class type, reference
|
64
|
-
warn "#{caller[0]}: read_type_class is deprecated" if $VERBOSE
|
65
|
-
_, _, type, name = type.split ':', 4
|
66
|
-
|
67
|
-
reference = name.split('::').inject(reference) do |k,n|
|
68
|
-
k.const_get(n.to_sym)
|
69
|
-
end if name
|
70
|
-
[type, reference]
|
71
|
-
end
|
72
|
-
|
73
|
-
def self.object_maker klass, hash
|
74
|
-
warn "#{caller[0]}: object_maker is deprecated" if $VERBOSE
|
75
|
-
klass.allocate.tap do |obj|
|
76
|
-
hash.each { |k,v| obj.instance_variable_set(:"@#{k}", v) }
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
class Object
|
82
|
-
undef :to_yaml_properties rescue nil
|
83
|
-
def to_yaml_properties # :nodoc:
|
84
|
-
instance_variables
|
85
|
-
end
|
86
|
-
end
|
data/psych.gemspec
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$LOAD_PATH.unshift './lib'
|
3
|
-
load 'psych/versions.rb'
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "psych"
|
7
|
-
s.version = Psych::VERSION
|
8
|
-
s.authors = ["Aaron Patterson", "SHIBATA Hiroshi", "Charles Oliver Nutter"]
|
9
|
-
s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org", "headius@headius.com"]
|
10
|
-
s.date = "2016-11-14"
|
11
|
-
s.summary = "Psych is a YAML parser and emitter"
|
12
|
-
s.description = <<-DESCRIPTION
|
13
|
-
Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/LibYAML]
|
14
|
-
for its YAML parsing and emitting capabilities. In addition to wrapping libyaml,
|
15
|
-
Psych also knows how to serialize and de-serialize most Ruby objects to and from the YAML format.
|
16
|
-
DESCRIPTION
|
17
|
-
s.homepage = "https://github.com/ruby/psych"
|
18
|
-
s.licenses = ["MIT"]
|
19
|
-
s.require_paths = ["lib"]
|
20
|
-
|
21
|
-
# for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
-
s.files = [".gitignore", ".travis.yml", "CHANGELOG.rdoc", "Gemfile", "Mavenfile", "README.md", "Rakefile", "bin/console", "bin/setup", "ext/psych/.gitignore", "ext/psych/depend", "ext/psych/extconf.rb", "ext/psych/psych.c", "ext/psych/psych.h", "ext/psych/psych_emitter.c", "ext/psych/psych_emitter.h", "ext/psych/psych_parser.c", "ext/psych/psych_parser.h", "ext/psych/psych_to_ruby.c", "ext/psych/psych_to_ruby.h", "ext/psych/psych_yaml_tree.c", "ext/psych/psych_yaml_tree.h", "ext/psych/yaml/LICENSE", "ext/psych/yaml/api.c", "ext/psych/yaml/config.h", "ext/psych/yaml/dumper.c", "ext/psych/yaml/emitter.c", "ext/psych/yaml/loader.c", "ext/psych/yaml/parser.c", "ext/psych/yaml/reader.c", "ext/psych/yaml/scanner.c", "ext/psych/yaml/writer.c", "ext/psych/yaml/yaml.h", "ext/psych/yaml/yaml_private.h", "lib/psych.rb", "lib/psych/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/deprecated.rb", "lib/psych/exception.rb", "lib/psych/handler.rb", "lib/psych/handlers/document_stream.rb", "lib/psych/handlers/recorder.rb", "lib/psych/json/ruby_events.rb", "lib/psych/json/stream.rb", "lib/psych/json/tree_builder.rb", "lib/psych/json/yaml_events.rb", "lib/psych/nodes.rb", "lib/psych/nodes/alias.rb", "lib/psych/nodes/document.rb", "lib/psych/nodes/mapping.rb", "lib/psych/nodes/node.rb", "lib/psych/nodes/scalar.rb", "lib/psych/nodes/sequence.rb", "lib/psych/nodes/stream.rb", "lib/psych/omap.rb", "lib/psych/parser.rb", "lib/psych/scalar_scanner.rb", "lib/psych/set.rb", "lib/psych/stream.rb", "lib/psych/streaming.rb", "lib/psych/syntax_error.rb", "lib/psych/tree_builder.rb", "lib/psych/versions.rb", "lib/psych/visitors.rb","lib/psych/visitors/depth_first.rb", "lib/psych/visitors/emitter.rb", "lib/psych/visitors/json_tree.rb", "lib/psych/visitors/to_ruby.rb", "lib/psych/visitors/visitor.rb", "lib/psych/visitors/yaml_tree.rb", "lib/psych/y.rb", "psych.gemspec"]
|
23
|
-
|
24
|
-
s.rdoc_options = ["--main", "README.md"]
|
25
|
-
s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md"]
|
26
|
-
|
27
|
-
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
|
28
|
-
s.rubygems_version = "2.5.1"
|
29
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0")
|
30
|
-
|
31
|
-
s.add_development_dependency 'rake-compiler', ">= 0.4.1"
|
32
|
-
s.add_development_dependency 'minitest', "~> 5.0"
|
33
|
-
|
34
|
-
if RUBY_ENGINE == 'jruby'
|
35
|
-
s.platform = 'java'
|
36
|
-
s.files.concat ["ext/java/PsychEmitter.java", "ext/java/PsychLibrary.java", "ext/java/PsychParser.java", "ext/java/PsychToRuby.java", "ext/java/PsychYamlTree.java", "lib/psych_jars.rb", "lib/psych.jar"]
|
37
|
-
s.requirements = "jar org.yaml:snakeyaml, #{Psych::DEFAULT_SNAKEYAML_VERSION}"
|
38
|
-
s.add_dependency 'jar-dependencies', '>= 0.1.7'
|
39
|
-
s.add_development_dependency 'ruby-maven'
|
40
|
-
else
|
41
|
-
s.extensions = ["ext/psych/extconf.rb"]
|
42
|
-
end
|
43
|
-
end
|