psych 3.0.0.beta2-java → 3.0.0.beta3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Rakefile +16 -3
- data/ext/psych/extconf.rb +1 -1
- data/lib/psych.rb +6 -2
- data/lib/psych/class_loader.rb +1 -1
- data/lib/psych/coder.rb +1 -1
- data/lib/psych/core_ext.rb +1 -1
- data/lib/psych/exception.rb +1 -1
- data/lib/psych/handler.rb +1 -1
- data/lib/psych/handlers/document_stream.rb +1 -1
- data/lib/psych/handlers/recorder.rb +1 -1
- data/lib/psych/json/ruby_events.rb +1 -1
- data/lib/psych/json/stream.rb +1 -1
- data/lib/psych/json/tree_builder.rb +1 -1
- data/lib/psych/json/yaml_events.rb +1 -1
- data/lib/psych/nodes.rb +1 -1
- data/lib/psych/nodes/alias.rb +1 -1
- data/lib/psych/nodes/document.rb +1 -1
- data/lib/psych/nodes/mapping.rb +1 -1
- data/lib/psych/nodes/node.rb +1 -1
- data/lib/psych/nodes/scalar.rb +1 -1
- data/lib/psych/nodes/sequence.rb +1 -1
- data/lib/psych/nodes/stream.rb +1 -1
- data/lib/psych/omap.rb +1 -1
- data/lib/psych/parser.rb +1 -1
- data/lib/psych/scalar_scanner.rb +1 -1
- 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 +1 -1
- data/lib/psych/tree_builder.rb +1 -1
- data/lib/psych/versions.rb +2 -2
- data/lib/psych/visitors.rb +1 -1
- data/lib/psych/visitors/depth_first.rb +1 -1
- data/lib/psych/visitors/emitter.rb +1 -1
- data/lib/psych/visitors/json_tree.rb +1 -1
- data/lib/psych/visitors/to_ruby.rb +1 -1
- data/lib/psych/visitors/visitor.rb +1 -1
- data/lib/psych/visitors/yaml_tree.rb +10 -12
- data/lib/psych/y.rb +1 -1
- data/lib/psych_jars.rb +1 -1
- data/psych.gemspec +26 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77219ea7bd26f2394f7a2dcc1e65c6608b11d82fd4c5365849ab29d662fcdfb5
|
4
|
+
data.tar.gz: 0b1f0b790f6d427281329d5dff9839161bf8f40a0834ef44a4106e6dd08c32d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e99610deb00c1b1cdefd8c04a72d53ec1080cd406b88ae06e3913f09ac2590c759a1add15860dc3e1992ecb6b85d02acd4787a1dc5e8b03ffdc537b543d4fdf
|
7
|
+
data.tar.gz: a5a27877892b3f2feae4a8604c74d8eaa835f68912913fff86ec46a41da23360c311e3c55739fbd215773334f16368dc16d0c282c6306446c003eb0184439a8f
|
data/.gitignore
CHANGED
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require "bundler
|
2
|
-
|
1
|
+
require "bundler"
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
3
|
|
4
|
+
require "rake/testtask"
|
4
5
|
Rake::TestTask.new(:test) do |t|
|
5
6
|
t.libs << "test"
|
6
7
|
t.libs << "lib"
|
@@ -25,9 +26,21 @@ if RUBY_PLATFORM =~ /java/
|
|
25
26
|
end
|
26
27
|
else
|
27
28
|
require 'rake/extensiontask'
|
28
|
-
|
29
|
+
spec = eval File.read("psych.gemspec")
|
30
|
+
Rake::ExtensionTask.new("psych", spec) do |ext|
|
29
31
|
ext.lib_dir = File.join(*['lib', ENV['FAT_DIR']].compact)
|
32
|
+
ext.cross_compile = true
|
33
|
+
ext.cross_platform = %w[x86-mingw32 x64-mingw32]
|
34
|
+
ext.cross_compiling do |s|
|
35
|
+
s.files.concat ["lib/2.2/psych.so", "lib/2.3/psych.so", "lib/2.4/psych.so"]
|
36
|
+
end
|
30
37
|
end
|
31
38
|
end
|
32
39
|
|
40
|
+
desc "Compile binaries for mingw platform using rake-compiler-dock"
|
41
|
+
task 'build:mingw' do
|
42
|
+
require 'rake_compiler_dock'
|
43
|
+
RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=2.2.2:2.3.0:2.4.0"
|
44
|
+
end
|
45
|
+
|
33
46
|
task :default => [:compile, :test]
|
data/ext/psych/extconf.rb
CHANGED
data/lib/psych.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
require 'psych/versions'
|
3
3
|
case RUBY_ENGINE
|
4
4
|
when 'jruby'
|
5
5
|
require 'psych_jars'
|
6
6
|
org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false)
|
7
7
|
else
|
8
|
-
|
8
|
+
begin
|
9
|
+
require "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
|
10
|
+
rescue LoadError
|
11
|
+
require 'psych.so'
|
12
|
+
end
|
9
13
|
end
|
10
14
|
require 'psych/nodes'
|
11
15
|
require 'psych/streaming'
|
data/lib/psych/class_loader.rb
CHANGED
data/lib/psych/coder.rb
CHANGED
data/lib/psych/core_ext.rb
CHANGED
data/lib/psych/exception.rb
CHANGED
data/lib/psych/handler.rb
CHANGED
data/lib/psych/json/stream.rb
CHANGED
data/lib/psych/nodes.rb
CHANGED
data/lib/psych/nodes/alias.rb
CHANGED
data/lib/psych/nodes/document.rb
CHANGED
data/lib/psych/nodes/mapping.rb
CHANGED
data/lib/psych/nodes/node.rb
CHANGED
data/lib/psych/nodes/scalar.rb
CHANGED
data/lib/psych/nodes/sequence.rb
CHANGED
data/lib/psych/nodes/stream.rb
CHANGED
data/lib/psych/omap.rb
CHANGED
data/lib/psych/parser.rb
CHANGED
data/lib/psych/scalar_scanner.rb
CHANGED
data/lib/psych/set.rb
CHANGED
data/lib/psych/stream.rb
CHANGED
data/lib/psych/streaming.rb
CHANGED
data/lib/psych/syntax_error.rb
CHANGED
data/lib/psych/tree_builder.rb
CHANGED
data/lib/psych/versions.rb
CHANGED
data/lib/psych/visitors.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
require 'psych/tree_builder'
|
3
3
|
require 'psych/scalar_scanner'
|
4
4
|
require 'psych/class_loader'
|
@@ -321,7 +321,7 @@ module Psych
|
|
321
321
|
end
|
322
322
|
@emitter.scalar o, nil, tag, plain, quote, style
|
323
323
|
else
|
324
|
-
maptag = '!ruby/string'
|
324
|
+
maptag = '!ruby/string'.dup
|
325
325
|
maptag << ":#{o.class}" unless o.class == ::String
|
326
326
|
|
327
327
|
register o, @emitter.start_mapping(nil, maptag, false, Nodes::Mapping::BLOCK)
|
@@ -378,14 +378,18 @@ module Psych
|
|
378
378
|
|
379
379
|
def visit_Array o
|
380
380
|
if o.class == ::Array
|
381
|
-
|
382
|
-
o.each { |c| accept c }
|
383
|
-
@emitter.end_sequence
|
381
|
+
visit_Enumerator o
|
384
382
|
else
|
385
383
|
visit_array_subclass o
|
386
384
|
end
|
387
385
|
end
|
388
386
|
|
387
|
+
def visit_Enumerator o
|
388
|
+
register o, @emitter.start_sequence(nil, nil, true, Nodes::Sequence::BLOCK)
|
389
|
+
o.each { |c| accept c }
|
390
|
+
@emitter.end_sequence
|
391
|
+
end
|
392
|
+
|
389
393
|
def visit_NilClass o
|
390
394
|
@emitter.scalar('', nil, 'tag:yaml.org,2002:null', true, false, Nodes::Scalar::ANY)
|
391
395
|
end
|
@@ -411,15 +415,9 @@ module Psych
|
|
411
415
|
end
|
412
416
|
|
413
417
|
private
|
414
|
-
# FIXME: Remove the index and count checks in Psych 3.0
|
415
|
-
NULL = "\x00"
|
416
|
-
BINARY_RANGE = "\x00-\x7F"
|
417
|
-
WS_RANGE = "^ -~\t\r\n"
|
418
418
|
|
419
419
|
def binary? string
|
420
|
-
|
421
|
-
string.index(NULL) ||
|
422
|
-
string.count(BINARY_RANGE, WS_RANGE).fdiv(string.length) > 0.3
|
420
|
+
string.encoding == Encoding::ASCII_8BIT && !string.ascii_only?
|
423
421
|
end
|
424
422
|
|
425
423
|
def visit_array_subclass o
|
data/lib/psych/y.rb
CHANGED
data/lib/psych_jars.rb
CHANGED
data/psych.gemspec
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
Gem::Specification.new do |s|
|
4
5
|
s.name = "psych"
|
5
|
-
s.version = "3.0.0.
|
6
|
+
s.version = "3.0.0.beta3"
|
6
7
|
s.authors = ["Aaron Patterson", "SHIBATA Hiroshi", "Charles Oliver Nutter"]
|
7
8
|
s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org", "headius@headius.com"]
|
8
9
|
s.date = "2017-06-16"
|
@@ -17,7 +18,25 @@ DESCRIPTION
|
|
17
18
|
s.require_paths = ["lib"]
|
18
19
|
|
19
20
|
# for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
s.files = [
|
21
|
+
s.files = [
|
22
|
+
".gitignore", ".travis.yml", "CHANGELOG.rdoc", "Gemfile", "Mavenfile", "README.md", "Rakefile", "bin/console",
|
23
|
+
"bin/setup", "ext/psych/.gitignore", "ext/psych/depend", "ext/psych/extconf.rb", "ext/psych/psych.c", "ext/psych/psych.h",
|
24
|
+
"ext/psych/psych_emitter.c", "ext/psych/psych_emitter.h", "ext/psych/psych_parser.c", "ext/psych/psych_parser.h",
|
25
|
+
"ext/psych/psych_to_ruby.c", "ext/psych/psych_to_ruby.h", "ext/psych/psych_yaml_tree.c", "ext/psych/psych_yaml_tree.h",
|
26
|
+
"ext/psych/yaml/LICENSE", "ext/psych/yaml/api.c", "ext/psych/yaml/config.h", "ext/psych/yaml/dumper.c",
|
27
|
+
"ext/psych/yaml/emitter.c", "ext/psych/yaml/loader.c", "ext/psych/yaml/parser.c", "ext/psych/yaml/reader.c",
|
28
|
+
"ext/psych/yaml/scanner.c", "ext/psych/yaml/writer.c", "ext/psych/yaml/yaml.h", "ext/psych/yaml/yaml_private.h",
|
29
|
+
"lib/psych.rb", "lib/psych/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/exception.rb",
|
30
|
+
"lib/psych/handler.rb", "lib/psych/handlers/document_stream.rb", "lib/psych/handlers/recorder.rb",
|
31
|
+
"lib/psych/json/ruby_events.rb", "lib/psych/json/stream.rb", "lib/psych/json/tree_builder.rb",
|
32
|
+
"lib/psych/json/yaml_events.rb", "lib/psych/nodes.rb", "lib/psych/nodes/alias.rb", "lib/psych/nodes/document.rb",
|
33
|
+
"lib/psych/nodes/mapping.rb", "lib/psych/nodes/node.rb", "lib/psych/nodes/scalar.rb", "lib/psych/nodes/sequence.rb",
|
34
|
+
"lib/psych/nodes/stream.rb", "lib/psych/omap.rb", "lib/psych/parser.rb", "lib/psych/scalar_scanner.rb",
|
35
|
+
"lib/psych/set.rb", "lib/psych/stream.rb", "lib/psych/streaming.rb", "lib/psych/syntax_error.rb",
|
36
|
+
"lib/psych/tree_builder.rb", "lib/psych/versions.rb", "lib/psych/visitors.rb","lib/psych/visitors/depth_first.rb",
|
37
|
+
"lib/psych/visitors/emitter.rb", "lib/psych/visitors/json_tree.rb", "lib/psych/visitors/to_ruby.rb",
|
38
|
+
"lib/psych/visitors/visitor.rb", "lib/psych/visitors/yaml_tree.rb", "lib/psych/y.rb", "psych.gemspec"
|
39
|
+
]
|
21
40
|
|
22
41
|
s.rdoc_options = ["--main", "README.md"]
|
23
42
|
s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md"]
|
@@ -31,11 +50,15 @@ DESCRIPTION
|
|
31
50
|
|
32
51
|
if RUBY_ENGINE == 'jruby'
|
33
52
|
s.platform = 'java'
|
34
|
-
s.files.concat [
|
53
|
+
s.files.concat [
|
54
|
+
"ext/java/PsychEmitter.java", "ext/java/PsychLibrary.java", "ext/java/PsychParser.java", "ext/java/PsychToRuby.java",
|
55
|
+
"ext/java/PsychYamlTree.java", "lib/psych_jars.rb", "lib/psych.jar"
|
56
|
+
]
|
35
57
|
s.requirements = "jar org.yaml:snakeyaml, 1.18"
|
36
58
|
s.add_dependency 'jar-dependencies', '>= 0.1.7'
|
37
59
|
s.add_development_dependency 'ruby-maven'
|
38
60
|
else
|
39
61
|
s.extensions = ["ext/psych/extconf.rb"]
|
62
|
+
s.add_development_dependency 'rake-compiler-dock', ">= 0.6.1"
|
40
63
|
end
|
41
64
|
end
|