jsontemplate 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/jsontemplate/version.rb +1 -1
- data/lib/jsontemplate.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 928c018c315a90d125ccba148aca5d02e7ddec6f
|
4
|
+
data.tar.gz: 30e672445d4d6e52ddbc12f26d68de28f49c9226
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 951b22ace0afcd663612c795c5966a4b3dadec6d437edcc7e8acea8d4f9a08b7ca25e35d93a47539d1f49b2914af891842112caebb3b2ea67d04f94e2360e83a
|
7
|
+
data.tar.gz: 76f0b62b0d7a44cf1fe7aecfd13b34cc3848e9cb7d11e82218db65a0cf40dc788e45009f7b11c3a85b08ba43f9595a3f790b105227778cf9ecd61274116b6772
|
data/Gemfile.lock
CHANGED
data/lib/jsontemplate/version.rb
CHANGED
data/lib/jsontemplate.rb
CHANGED
@@ -10,14 +10,15 @@ class JsonTemplate
|
|
10
10
|
@path = path || (src.respond_to?(:path) ? src.path : nil)
|
11
11
|
@dir = File.expand_path(path ? File.dirname(path) : ".")
|
12
12
|
|
13
|
-
@properties_file =
|
14
|
-
@secrets_file =
|
13
|
+
@properties_file = "properties.json"
|
14
|
+
@secrets_file = "secrets.json"
|
15
15
|
|
16
16
|
if src.respond_to?(:read)
|
17
17
|
@filename = "<stream>"
|
18
18
|
data = src.read
|
19
19
|
else
|
20
|
-
@filename = File.join(@dir, File.basename(src))
|
20
|
+
@filename = src[0] == ?/ ? src : File.join(@dir, File.basename(src))
|
21
|
+
p [src, @path, @dir, @filename]
|
21
22
|
data = File.read(@filename)
|
22
23
|
end
|
23
24
|
@json = JSON.load(data)
|
@@ -26,6 +27,7 @@ class JsonTemplate
|
|
26
27
|
def process_dirmerge(pattern)
|
27
28
|
files = Dir.glob(@dir+"/"+pattern)
|
28
29
|
files.collect do |path|
|
30
|
+
p path
|
29
31
|
r = JsonTemplate.new(path,@path).process_dict
|
30
32
|
key=File.basename(path).split(".")[0..-2].join(".")
|
31
33
|
[key, r]
|