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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 515d21e196c6b0077a3f873a04281a0bcbd4d21858acaf64a6a380e75b07eeb5
4
- data.tar.gz: 7ca9fbd9d902ee3eabcb81c4547018eb7fe5ffabe506b29dfb0582e54670de5e
3
+ metadata.gz: 0be0858832e50ba9b97682783c3e61550023201916017e95a75277e87766b870
4
+ data.tar.gz: a27eef2f56b516905246a9dfb19bcc974ed0c8b5554f6b08d0d037df3c00bd1f
5
5
  SHA512:
6
- metadata.gz: aa16ed31fce2a1895f60c4871b926ffc8fe8a93af8548a2eee0f63220d2afe2a6f83dd8fd51f7a04e7af7bd4bb90620b7e9fc0bf5fe8d1f347ae5394be017961
7
- data.tar.gz: 056f53baa09e83d64ac705811887f72677ce1e18f95441330d0b3fd0accc8cc041598fd6118b90db03e81705ff09173d67b2c70d13d0e6a99ef131ee16f617fc
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
 
@@ -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
- super_config = YAML.load_file(File.open(yaml_path))
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
@@ -1,3 +1,3 @@
1
1
  module YamlExtend
2
- VERSION = '1.0.3'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
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.3
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: 2020-12-23 00:00:00.000000000 Z
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge