yaml_extend 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/yaml_extend.rb +8 -1
- data/lib/yaml_extend/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0be0858832e50ba9b97682783c3e61550023201916017e95a75277e87766b870
|
4
|
+
data.tar.gz: a27eef2f56b516905246a9dfb19bcc974ed0c8b5554f6b08d0d037df3c00bd1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63a9a94a76eefd6ef9b8cfce70fbaa32e53ee28a1884ddb30ed7df07d702e7731a2fd27a294dc66b64cd4d3978168361f321deedbd64060e06dc6024d9178e77
|
7
|
+
data.tar.gz: d2eb52bc628096d558293fcba275a2bd70de6c623df3c57bce24d7a7b06b4963b5df7c7581be741e17b31a79246493e29c9ed8d441ece95f54f225be0b0405cc
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# yaml_extend
|
2
|
+
![Gem](https://img.shields.io/gem/v/yaml_extend?color=default&style=plastic&logo=ruby&logoColor=red)
|
3
|
+
![Gem](https://img.shields.io/gem/dt/yaml_extend?color=blue&style=plastic)
|
4
|
+
[![License: MIT](https://img.shields.io/badge/License-MIT-gold.svg?style=plastic&logo=mit)](LICENSE)
|
2
5
|
|
3
|
-
Extends YAML to support file based inheritance.
|
6
|
+
> Extends YAML to support file based inheritance.
|
4
7
|
|
5
8
|
That can be very handy to build a configuration hierachy.
|
6
9
|
|
data/lib/yaml_extend.rb
CHANGED
@@ -105,7 +105,14 @@ module YAML
|
|
105
105
|
total_config = config.clone
|
106
106
|
|
107
107
|
yaml_path = YAML.make_absolute_path yaml_path
|
108
|
-
|
108
|
+
|
109
|
+
super_config =
|
110
|
+
if yaml_path.match(/(\.erb\.|\.erb$)/)
|
111
|
+
YAML.load(ERB.new(File.read(yaml_path)).result)
|
112
|
+
else
|
113
|
+
YAML.load_file(File.open(yaml_path))
|
114
|
+
end
|
115
|
+
|
109
116
|
super_inheritance_files = yaml_value_by_key inheritance_key, super_config
|
110
117
|
unless options[:preserve_inheritance_key]
|
111
118
|
delete_yaml_key inheritance_key, super_config # we don't merge the super inheritance keys into the base yaml
|
data/lib/yaml_extend/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml_extend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthäus Beyrle
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deep_merge
|