state_mate 0.0.7 → 0.0.8

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: 7e41284705be1f86eac6d6e3d67e0867fae16c30
4
- data.tar.gz: b89e28497de8c95c21226c873bcb0bc84d453139
3
+ metadata.gz: 6405979811d0c551cc74702afc8e4b32b17a7947
4
+ data.tar.gz: d5832875e024eb641f188c9d1cfc5ceb574b0261
5
5
  SHA512:
6
- metadata.gz: fcf1b94b353247bad4191400d91ad633b32c1197e7b46a12c1d8ed2a81a5349d9fd3af3a72748a64d85c6b9fe22cc8465e2f8c8e2253abab523b6e18e3204f71
7
- data.tar.gz: b766eeee693b372c6abf79a91d0e8eeb6a2d0913334196219982ac6030626e2f2ae7a9420fbfbf843760b9cd46fc47ce288f8377e26caa032ea7bdde4e23a889
6
+ metadata.gz: f6d84cdcff0f671d9db98c1a2e27faf6bda37c181ca7ba3039c87196c0b38cf53daa59d9ad7b551a03d12b46f60d687614ca6b2b48036ac2776c8f76077fb6a8
7
+ data.tar.gz: e76937841bc8713c17c8390b06b35f6f2af1f62b9686499199fbb93366302530bbec05e9e73e4437404fea750c99746c35aaf3041847259d361e94736943dedf
@@ -36,8 +36,15 @@ module StateMate::Adapters::JSON
36
36
  }.merge options
37
37
 
38
38
  filepath, key_segs = parse_key key
39
+
40
+ StateMate.debug "writing json",
41
+ options: options,
42
+ filepath: filepath,
43
+ key_segs: key_segs
39
44
 
40
- new_root = if key_segs.length > 1
45
+ new_root = if key_segs.empty?
46
+ value
47
+ else
41
48
  root = read filepath
42
49
 
43
50
  StateMate::Adapters::Defaults.hash_deep_write!(
@@ -47,9 +54,9 @@ module StateMate::Adapters::JSON
47
54
  )
48
55
 
49
56
  root
50
- else
51
- value
52
57
  end
58
+
59
+ StateMate.debug new_root: new_root
53
60
 
54
61
  content = if options['pretty']
55
62
  ::JSON.pretty_generate new_root
@@ -1,3 +1,3 @@
1
1
  module StateMate
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_mate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - nrser
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-06 00:00:00.000000000 Z
11
+ date: 2016-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler