jsontemplate 0.4.1 → 0.4.2

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: 650217220c4a794fb5a58dfcbc27271efbe3672c
4
- data.tar.gz: 80c01ac97ce7a7a3a06cf526ce9ffb5929d58955
3
+ metadata.gz: 360933697b132664ef8783eeaa1d77a54b92ce96
4
+ data.tar.gz: 48601d2350b59574718f7365c788dee920e93330
5
5
  SHA512:
6
- metadata.gz: 64274d0bb43ab4b8c98bd7f396b70bfe389e2bc7c53ffe0f12c2326ca58d30611f36b5330a47d91431467dbaca4388c2f4fe90e1683eeed65d16a1802ded76bb
7
- data.tar.gz: 71524208b91d2b387b928c6e728ca2104d35ab8c63f470d14965d2d780f565f94e6c1ba431766a26882cb5e173687381be63887049304ff00d8ee125be10987a
6
+ metadata.gz: ee3d770335b3eea0a5efae708f5e479ad67eca32cdfccc566dbb87c13a236a214ea27efefce8c46901987270a3d510326aa6585b0c4d320959252a56beb07e89
7
+ data.tar.gz: fb74b90da549574c75b1ecf734330478539e4660edad8c5dd2d61dc6b1a30f91fe0fbd8c87f721b268b417b6e308b3fb6f3f6ddc3ed9709b98296a5aabf4e234
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jsontemplate (0.4.1)
4
+ jsontemplate (0.4.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -13,12 +13,12 @@ GEM
13
13
  coderay (~> 1.1.0)
14
14
  method_source (~> 0.8.1)
15
15
  slop (~> 3.4)
16
- rake (10.4.2)
16
+ rake (10.5.0)
17
17
  rspec (3.5.0)
18
18
  rspec-core (~> 3.5.0)
19
19
  rspec-expectations (~> 3.5.0)
20
20
  rspec-mocks (~> 3.5.0)
21
- rspec-core (3.5.1)
21
+ rspec-core (3.5.2)
22
22
  rspec-support (~> 3.5.0)
23
23
  rspec-expectations (3.5.0)
24
24
  diff-lcs (>= 1.2.0, < 2.0)
data/exe/jsontemplate CHANGED
@@ -11,6 +11,7 @@ src = File.expand_path(ARGV.shift) rescue nil
11
11
  dest = File.expand_path(ARGV.shift) rescue nil
12
12
 
13
13
  if src.nil? || dest.nil?
14
+ STDERR.puts "jsontemplate (from jsontemplate gem) version #{JsonTemplate::VERSION}"
14
15
  STDERR.puts "USAGE: jsontemplate in-file out-file"
15
16
  exit(1)
16
17
  end
data/lib/jsontemplate.rb CHANGED
@@ -11,9 +11,15 @@ class JsonTemplate
11
11
  @dir = File.expand_path(path ? File.dirname(path) : ".")
12
12
 
13
13
  @properties_file = File.join(@dir,"properties.json")
14
- @secrets_file = File.join(@dir,"secrets.json")
14
+ @secrets_file = File.join(@dir,"secrets.json")
15
15
 
16
- data = src.respond_to?(:read) ? src.read : File.read(src)
16
+ if src.respond_to?(:read)
17
+ @filename = "<stream>"
18
+ data = src.read
19
+ else
20
+ @filename = File.join(@dir, File.basename(src))
21
+ data = File.read(@filename)
22
+ end
17
23
  @json = JSON.load(data)
18
24
  end
19
25
 
@@ -1,3 +1,3 @@
1
1
  class JsonTemplate
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
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.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vidar Hokstad