psych 3.0.0.beta4-java → 3.0.2-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +2 -2
- data/ext/psych/psych_parser.c +3 -3
- data/lib/psych.rb +26 -7
- data/lib/psych/versions.rb +1 -1
- data/lib/psych/visitors/yaml_tree.rb +1 -1
- data/psych.gemspec +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0cd551e6f43bcd6884c1efd454765a9544649e5a
|
4
|
+
data.tar.gz: f660bc87fca4221c306f93f9b0de800e4aa11b06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c17282aa46f06bdbfb34e5be66b1037ca6c4e0b6175e543a804a623e2a0e16e6d88ef0c7203e7d903f83c587f584f36e76234495a8dc8399061f4e26d35e652b
|
7
|
+
data.tar.gz: 75022ffc21735051df9de9d674a5867b69472ed136486eb09daa342ade8163c87da03b29cede5a4365dcbf7a4e161789eb87038f952405ad0df601d609dd626e
|
data/.travis.yml
CHANGED
data/ext/psych/psych_parser.c
CHANGED
@@ -292,6 +292,9 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
|
|
292
292
|
}
|
293
293
|
|
294
294
|
while(!done) {
|
295
|
+
VALUE event_args[5];
|
296
|
+
VALUE start_line, start_column, end_line, end_column;
|
297
|
+
|
295
298
|
if(!yaml_parser_parse(parser, &event)) {
|
296
299
|
VALUE exception;
|
297
300
|
|
@@ -302,9 +305,6 @@ static VALUE parse(int argc, VALUE *argv, VALUE self)
|
|
302
305
|
rb_exc_raise(exception);
|
303
306
|
}
|
304
307
|
|
305
|
-
VALUE event_args[5];
|
306
|
-
VALUE start_line, start_column, end_line, end_column;
|
307
|
-
|
308
308
|
start_line = INT2NUM((long)event.start_mark.line);
|
309
309
|
start_column = INT2NUM((long)event.start_mark.column);
|
310
310
|
end_line = INT2NUM((long)event.end_mark.line);
|
data/lib/psych.rb
CHANGED
@@ -252,8 +252,15 @@ module Psych
|
|
252
252
|
# ex.file # => 'file.txt'
|
253
253
|
# ex.message # => "(file.txt): found character that cannot start any token"
|
254
254
|
# end
|
255
|
-
|
256
|
-
|
255
|
+
#
|
256
|
+
# When the optional +symbolize_names+ keyword argument is set to a
|
257
|
+
# true value, returns symbols for keys in Hash objects (default: strings).
|
258
|
+
#
|
259
|
+
# Psych.load("---\n foo: bar") # => {"foo"=>"bar"}
|
260
|
+
# Psych.load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"}
|
261
|
+
#
|
262
|
+
def self.load yaml, filename = nil, fallback: false, symbolize_names: false
|
263
|
+
result = parse(yaml, filename, fallback: fallback)
|
257
264
|
result = result.to_ruby if result
|
258
265
|
symbolize_names!(result) if symbolize_names
|
259
266
|
result
|
@@ -293,7 +300,17 @@ module Psych
|
|
293
300
|
#
|
294
301
|
# A Psych::BadAlias exception will be raised if the yaml contains aliases
|
295
302
|
# but the +aliases+ parameter is set to false.
|
296
|
-
|
303
|
+
#
|
304
|
+
# +filename+ will be used in the exception message if any exception is raised
|
305
|
+
# while parsing.
|
306
|
+
#
|
307
|
+
# When the optional +symbolize_names+ keyword argument is set to a
|
308
|
+
# true value, returns symbols for keys in Hash objects (default: strings).
|
309
|
+
#
|
310
|
+
# Psych.safe_load("---\n foo: bar") # => {"foo"=>"bar"}
|
311
|
+
# Psych.safe_load("---\n foo: bar", symbolize_names: true) # => {:foo=>"bar"}
|
312
|
+
#
|
313
|
+
def self.safe_load yaml, whitelist_classes = [], whitelist_symbols = [], aliases = false, filename = nil, symbolize_names: false
|
297
314
|
result = parse(yaml, filename)
|
298
315
|
return unless result
|
299
316
|
|
@@ -305,7 +322,9 @@ module Psych
|
|
305
322
|
else
|
306
323
|
visitor = Visitors::NoAliasRuby.new scanner, class_loader
|
307
324
|
end
|
308
|
-
visitor.accept result
|
325
|
+
result = visitor.accept result
|
326
|
+
symbolize_names!(result) if symbolize_names
|
327
|
+
result
|
309
328
|
end
|
310
329
|
|
311
330
|
###
|
@@ -327,7 +346,7 @@ module Psych
|
|
327
346
|
# end
|
328
347
|
#
|
329
348
|
# See Psych::Nodes for more information about YAML AST.
|
330
|
-
def self.parse yaml, filename = nil, fallback
|
349
|
+
def self.parse yaml, filename = nil, fallback: false
|
331
350
|
parse_stream(yaml, filename) do |node|
|
332
351
|
return node
|
333
352
|
end
|
@@ -474,9 +493,9 @@ module Psych
|
|
474
493
|
# Load the document contained in +filename+. Returns the yaml contained in
|
475
494
|
# +filename+ as a Ruby object, or if the file is empty, it returns
|
476
495
|
# the specified default return value, which defaults to an empty Hash
|
477
|
-
def self.load_file filename, fallback
|
496
|
+
def self.load_file filename, fallback: false
|
478
497
|
File.open(filename, 'r:bom|utf-8') { |f|
|
479
|
-
self.load f, filename, FALLBACK.new(fallback)
|
498
|
+
self.load f, filename, fallback: FALLBACK.new(fallback)
|
480
499
|
}
|
481
500
|
end
|
482
501
|
|
data/lib/psych/versions.rb
CHANGED
@@ -304,7 +304,7 @@ module Psych
|
|
304
304
|
quote = false
|
305
305
|
elsif @line_width && o.length > @line_width
|
306
306
|
style = Nodes::Scalar::FOLDED
|
307
|
-
elsif o =~ /^[^[:word:]][^"]*$/
|
307
|
+
elsif o =~ /^[^[:word:]][^"]*$/
|
308
308
|
style = Nodes::Scalar::DOUBLE_QUOTED
|
309
309
|
elsif not String === @ss.tokenize(o) or /\A0[0-7]*[89]/ =~ o
|
310
310
|
style = Nodes::Scalar::SINGLE_QUOTED
|
data/psych.gemspec
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "psych"
|
6
|
-
s.version = "3.0.
|
6
|
+
s.version = "3.0.2"
|
7
7
|
s.authors = ["Aaron Patterson", "SHIBATA Hiroshi", "Charles Oliver Nutter"]
|
8
8
|
s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org", "headius@headius.com"]
|
9
|
-
s.date = "2017-
|
9
|
+
s.date = "2017-12-04"
|
10
10
|
s.summary = "Psych is a YAML parser and emitter"
|
11
11
|
s.description = <<-DESCRIPTION
|
12
12
|
Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/LibYAML]
|
@@ -41,7 +41,7 @@ DESCRIPTION
|
|
41
41
|
s.rdoc_options = ["--main", "README.md"]
|
42
42
|
s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md"]
|
43
43
|
|
44
|
-
s.required_ruby_version = Gem::Requirement.new(">=
|
44
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.2.2")
|
45
45
|
s.rubygems_version = "2.5.1"
|
46
46
|
s.required_rubygems_version = Gem::Requirement.new(">= 0")
|
47
47
|
|
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.0.
|
4
|
+
version: 3.0.2
|
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: 2017-
|
13
|
+
date: 2017-12-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
@@ -175,7 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
175
175
|
requirements:
|
176
176
|
- - ">="
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
version:
|
178
|
+
version: 2.2.2
|
179
179
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
180
|
requirements:
|
181
181
|
- - ">="
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
requirements:
|
185
185
|
- jar org.yaml:snakeyaml, 1.18
|
186
186
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.6.
|
187
|
+
rubygems_version: 2.6.14
|
188
188
|
signing_key:
|
189
189
|
specification_version: 4
|
190
190
|
summary: Psych is a YAML parser and emitter
|