extended_yaml 0.2.0 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/extended_yaml/version.rb +1 -1
- data/lib/extended_yaml.rb +11 -4
- 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: ced5a6acff533366f924ada3bd7680a56e691a50ec73e8747e9ebe69889a3fc9
|
4
|
+
data.tar.gz: 3dabc28c5f82f31c90d60606249085f3f4044ded6ba33b5b2a44b3ced0c13dd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83bead6025c48647a646c1cede4b83a5b84a33d37527759d1c27139b8fb16ff78da57c91e865558565423aeeaf6521b4014ce15292ad7f3f08156f4f430a556e
|
7
|
+
data.tar.gz: ef610dc109bdfd0f1cfc69c31ddc136910c8df4359e06a96b7f632a5684d060bdcc2085412c08bc8c6ebd89aa093371a4a49c634a67ae5e3065368c7228c2848
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@ Extended YAML
|
|
2
2
|
==================================================
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/extended_yaml.svg)](https://badge.fury.io/rb/extended_yaml)
|
5
|
-
[![Build Status](https://
|
5
|
+
[![Build Status](https://github.com/DannyBen/extended_yaml/workflows/Test/badge.svg)](https://github.com/DannyBen/extended_yaml/actions?query=workflow%3ATest)
|
6
6
|
[![Maintainability](https://api.codeclimate.com/v1/badges/0d162ff84c50abe7c83a/maintainability)](https://codeclimate.com/github/DannyBen/extended_yaml/maintainability)
|
7
7
|
|
8
8
|
---
|
data/lib/extended_yaml.rb
CHANGED
@@ -17,10 +17,17 @@ class ExtendedYAML
|
|
17
17
|
@file, @key = file, key
|
18
18
|
end
|
19
19
|
|
20
|
-
# @return [Hash, Array] the parsed YAML
|
20
|
+
# @return [Hash, Array, nil] the parsed YAML
|
21
21
|
def result
|
22
|
-
|
23
|
-
|
22
|
+
# ref: https://bugs.ruby-lang.org/issues/17866
|
23
|
+
begin
|
24
|
+
# ruby >= 3.1 / psych >= 4
|
25
|
+
data = ::YAML.unsafe_load evaluate
|
26
|
+
rescue NoMethodError
|
27
|
+
# ruby < 3.1 / psych < 4
|
28
|
+
data = ::YAML.load evaluate
|
29
|
+
end
|
30
|
+
data ? resolve_extends(data) : nil
|
24
31
|
end
|
25
32
|
|
26
33
|
# @return [String] the YAML string, with evaluated and ERB
|
@@ -77,6 +84,6 @@ private
|
|
77
84
|
def expand_path(path)
|
78
85
|
path += extension unless path.end_with? extension
|
79
86
|
path = File.expand_path path, base_dir
|
80
|
-
path.include?('*') ? Dir[path] : [path]
|
87
|
+
path.include?('*') ? Dir[path].sort : [path]
|
81
88
|
end
|
82
89
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extended_yaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Load YAML files that deep merge other YAML files
|
14
14
|
email: db@dannyben.com
|
@@ -39,7 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
requirements: []
|
42
|
-
rubygems_version: 3.
|
42
|
+
rubygems_version: 3.3.3
|
43
43
|
signing_key:
|
44
44
|
specification_version: 4
|
45
45
|
summary: Load YAML files that merge other YAML files
|