yaml-safe_load_stream 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yaml/safe_load_stream.rb +7 -7
- 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: 0425e55837f2056ed9fc5cd0e0e68604283054c41ae66ac1238db1a4ac5559ba
|
4
|
+
data.tar.gz: 43c0d6bee081ae0314a43102c723a13c1a1fda60a08de757af087e2186dec81e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5d3824687eae80db57d60f97801043621f362f3dbe26bf45fc46b6194f6c26bf724d01d297610078982f6a9ab2cd5d24ddb961e71eb934a9e41960626f202f1
|
7
|
+
data.tar.gz: 7d3e69ce593c00bacac0a7c973db4a0f369d0e53ad810260a2c3f23f2b229589c1a8e33176669565e03634b070fe3e7a92d83c4f9800b810d90a33df8bb04175
|
@@ -12,16 +12,16 @@ module YAMLSafeLoadStream
|
|
12
12
|
# @yield [document] each document in the stream is yielded if a block is given
|
13
13
|
# @return [Array] when a block is not given, returns an Array of documents
|
14
14
|
module_function def safe_load_stream(yaml, filename = nil)
|
15
|
-
|
15
|
+
result = []
|
16
16
|
::YAML.parse_stream(yaml, filename) do |stream|
|
17
17
|
raise_if_tags(stream, filename)
|
18
|
-
if block_given?
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
result << if block_given?
|
19
|
+
yield(stream.to_ruby)
|
20
|
+
else
|
21
|
+
stream.to_ruby
|
22
|
+
end
|
23
23
|
end
|
24
|
-
|
24
|
+
result
|
25
25
|
end
|
26
26
|
|
27
27
|
module_function def raise_if_tags(obj, filename = nil, doc_num = 1)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml-safe_load_stream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kimmo Lehto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
rubygems_version: 3.0.
|
86
|
+
rubygems_version: 3.0.2
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Adds YAML.safe_load_stream for safely parsing multi-document YAML streams
|