jsontemplate 0.2.0 → 0.3.0
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 +8 -0
- 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: e973f4782b9b49398b971d7a06d9c2e4bd650507
|
4
|
+
data.tar.gz: cba28240636fd024c12ff89dcbf36ea59af936f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74c098eb69e20f99ee8fae5ad5aef728a777468626dcb2f5c61c6a7e9971ab45e09598f40cf39608c7ca64adf02247a3b4e0c94c1f2cde8338a598968aa8a7c6
|
7
|
+
data.tar.gz: 1da023d5075fd4f43ab9ace8f98207ae5acb8d84d492857dae358a62f8f4c25dc188df4f204c87754513223a2c0dffbb98c65b9c8b680339b8dd7967a4b1468d
|
data/Gemfile.lock
CHANGED
data/lib/jsontemplate/version.rb
CHANGED
data/lib/jsontemplate.rb
CHANGED
@@ -3,12 +3,16 @@ require "jsontemplate/version"
|
|
3
3
|
|
4
4
|
class JsonTemplate
|
5
5
|
attr_reader :json
|
6
|
+
attr_accessor :properties_file, :secrets_file
|
6
7
|
|
7
8
|
def initialize(src, path=nil)
|
8
9
|
path ||= src.kind_of?(String) ? src : nil
|
9
10
|
@path = path || (src.respond_to?(:path) ? src.path : nil)
|
10
11
|
@dir = File.expand_path(path ? File.dirname(path) : ".")
|
11
12
|
|
13
|
+
@properties_file = File.join(@dir,"properties.json")
|
14
|
+
@secrets_file = File.join(@dir,"secrets.json")
|
15
|
+
|
12
16
|
data = src.respond_to?(:read) ? src.read : File.read(src)
|
13
17
|
@json = JSON.load(data)
|
14
18
|
end
|
@@ -39,6 +43,10 @@ class JsonTemplate
|
|
39
43
|
process_dirmerge(v)
|
40
44
|
elsif k == "$FLookup"
|
41
45
|
process_flookup(*v)
|
46
|
+
elsif k == "$Prop"
|
47
|
+
process_flookup(@properties_file, v)
|
48
|
+
elsif k == "$Secret"
|
49
|
+
process_flookup(@secrets_file, v)
|
42
50
|
elsif k[0] == "$"
|
43
51
|
raise "Unknown directive #{k}"
|
44
52
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsontemplate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vidar Hokstad
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|