yml_reader 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/lib/yml_reader.rb +7 -2
- data/lib/yml_reader/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d84ccd4325bd47330e821aa20216c28e276d4e53
|
4
|
+
data.tar.gz: 378a328ddcdddcb7ef9b92f34f10873a672d392d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f8300193986f71e8985f6a1359489e0c9d273d1f51591a46bf4b9a8646d944ec6d54440226c03ba24fe93ec5aa7f926a039d65bc1fa3643c32fb48d17fb6c84
|
7
|
+
data.tar.gz: 33aab24c6deddc6746b17ad1340445a1ed81cd4b68a87e3675cbd6b1aa19a2673795b22012d9a504c189b914e955cb1c362fb27b8363ffcafaa2ed97f7392587
|
data/ChangeLog
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
=== Version 0.7 / 2016-1-6
|
2
|
+
* Enhancements
|
3
|
+
* Added ability to supply multiple files to load via the load method (Thanks Justin Commu)
|
4
|
+
|
1
5
|
=== Version 0.6 / 2015-12-1
|
2
6
|
* Enhancements
|
3
7
|
* Added include_yml keyword to allow inclusion of one file within another (thanks Donavan Stanley)
|
data/lib/yml_reader.rb
CHANGED
@@ -23,11 +23,16 @@ module YmlReader
|
|
23
23
|
#
|
24
24
|
# Loads the requested file. It will look for the file in the
|
25
25
|
# directory specified by a call to the yml_directory= method.
|
26
|
+
# The parameter can also be a comma delimited list of files to
|
27
|
+
# load and merge.
|
26
28
|
#
|
27
29
|
def load(filename)
|
28
|
-
|
30
|
+
files= filename.include?(',') ? filename.split(',') : [filename]
|
31
|
+
@yml = files.inject({}) do |total_merge,file|
|
32
|
+
total_merge.merge!(::YAML.load(ERB.new(File.read("#{yml_directory}/#{file}")).result(binding)))
|
33
|
+
end
|
29
34
|
end
|
30
|
-
|
35
|
+
|
31
36
|
def include_yml(filename)
|
32
37
|
ERB.new(IO.read("#{yml_directory}/#{filename}")).result
|
33
38
|
end
|
data/lib/yml_reader/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yml_reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey S. Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Sets a directory and reads yml files
|
14
14
|
email:
|