rid-core 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/rid/document.rb +10 -2
  3. data/rid-core.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.5.0
data/lib/rid/document.rb CHANGED
@@ -49,8 +49,16 @@ module Rid
49
49
  key.sub!(/\.erb$/, '')
50
50
 
51
51
  value = block_given? ? block.call(filename) : read_file(filename)
52
- # strip value if its a one-liner
53
- value.strip! if value.count("\n") == 1
52
+
53
+ if key =~ /\.json$/
54
+ # parse json files
55
+ value = JSON.parse(value)
56
+ key.sub!(/\.json$/, '')
57
+ else
58
+ # strip value if its a one-liner
59
+ value.strip! if value.count("\n") == 1
60
+ end
61
+
54
62
  @hash.update_at key, value
55
63
  end
56
64
 
data/rid-core.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rid-core}
8
- s.version = "1.4.0"
8
+ s.version = "1.5.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Johannes J. Schmidt"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rid-core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 4
8
+ - 5
9
9
  - 0
10
- version: 1.4.0
10
+ version: 1.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Johannes J. Schmidt