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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df0999d146e785a7c0debc4cb23efe6389120a3fe39e93de690dd939881f0bc8
4
- data.tar.gz: 78caa00e3f4bcf72f4d3330df8dd52db158c12fd393695b8c16814c3c1c7d34a
3
+ metadata.gz: ced5a6acff533366f924ada3bd7680a56e691a50ec73e8747e9ebe69889a3fc9
4
+ data.tar.gz: 3dabc28c5f82f31c90d60606249085f3f4044ded6ba33b5b2a44b3ced0c13dd8
5
5
  SHA512:
6
- metadata.gz: f02a0dbce52f18a7e4b5d2d5c13e6917a981d0dcb932f8cdf417e72205971d5e000affdda06d394973662359438e4bd5d6a2775a30a70be21346bbe4c9d361af
7
- data.tar.gz: 4a0895c01faefd1bac66e9cb913518d56fa1fadbc2a243ab12e1ea8716f23e1ba8621d895f0795f610d8cad18c6421f0aac5030357169f67c25af8a4b0a8bfac
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://travis-ci.com/DannyBen/extended_yaml.svg?branch=master)](https://travis-ci.com/DannyBen/extended_yaml)
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
  ---
@@ -1,3 +1,3 @@
1
1
  class ExtendedYAML
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.3"
3
3
  end
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
- data = ::YAML.load evaluate
23
- resolve_extends data
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.0
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: 2020-01-16 00:00:00.000000000 Z
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.0.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