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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 360933697b132664ef8783eeaa1d77a54b92ce96
4
- data.tar.gz: 48601d2350b59574718f7365c788dee920e93330
3
+ metadata.gz: 928c018c315a90d125ccba148aca5d02e7ddec6f
4
+ data.tar.gz: 30e672445d4d6e52ddbc12f26d68de28f49c9226
5
5
  SHA512:
6
- metadata.gz: ee3d770335b3eea0a5efae708f5e479ad67eca32cdfccc566dbb87c13a236a214ea27efefce8c46901987270a3d510326aa6585b0c4d320959252a56beb07e89
7
- data.tar.gz: fb74b90da549574c75b1ecf734330478539e4660edad8c5dd2d61dc6b1a30f91fe0fbd8c87f721b268b417b6e308b3fb6f3f6ddc3ed9709b98296a5aabf4e234
6
+ metadata.gz: 951b22ace0afcd663612c795c5966a4b3dadec6d437edcc7e8acea8d4f9a08b7ca25e35d93a47539d1f49b2914af891842112caebb3b2ea67d04f94e2360e83a
7
+ data.tar.gz: 76f0b62b0d7a44cf1fe7aecfd13b34cc3848e9cb7d11e82218db65a0cf40dc788e45009f7b11c3a85b08ba43f9595a3f790b105227778cf9ecd61274116b6772
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jsontemplate (0.4.2)
4
+ jsontemplate (0.4.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  class JsonTemplate
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
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 = File.join(@dir,"properties.json")
14
- @secrets_file = File.join(@dir,"secrets.json")
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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsontemplate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vidar Hokstad