json_checker 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7039a495025f0d11a764d92a4e30a358a2858797
4
- data.tar.gz: 68ba2a3b3574fb0be32090aba3bf3e893e260f3d
3
+ metadata.gz: 5c1eda9d2c67208e7ba50526054b2332efc1168a
4
+ data.tar.gz: 7077d4f7c8035a28fe209ced104c74b5c2d912fc
5
5
  SHA512:
6
- metadata.gz: 0debc9c97f6b9b9c21cb04de3792cc7c406187effee5e091f287e875ae9ff8b8ae19d8c08ad54792ae6019335545cfd947ec7b44668513ba34c4a026d5457ae5
7
- data.tar.gz: dc905f8d9816c28f093a7623082f80715dbfc95402bff6eba0cc0c8e649b4d0d0f59d0d4ef7a2ad28b081904bd1bdec72a5f025802f44cd3a221aae5a63aa3a9
6
+ metadata.gz: e6a8f0ec83310635b57be3b3f0bd4d003914d39a01bf11710daf10dbea089cf9fecedfabc9119a1517ad62b386d19c5f97c29a921cb2cd7c4e74e58aa2a0f157
7
+ data.tar.gz: 6fb8fd9dce3ab9996d6f3a9302a84a504eb1739e842ca2f57524e635086bf316c9851257b918ff16b47c3b056504bb7e8a65537d887cfdcbbcce67c49b3ed1bb
@@ -56,9 +56,13 @@ module JsonChecker
56
56
  def value_for_key_with_split_character(key, json, splitCharacter)
57
57
  value = json
58
58
  key.split(splitCharacter).each do |item|
59
- if !value.nil? && !item.empty?
60
- value = is_numeric?(item) ? value[item.to_i] : value[item]
59
+ if !value.nil? && !item.empty?
60
+ if is_numeric?(item)
61
+ value = value.kind_of?(Array) ? value[item.to_i] : nil
62
+ else
63
+ value = value.kind_of?(Array) ? nil : value[item]
61
64
  end
65
+ end
62
66
  end
63
67
  return value
64
68
  end
@@ -1,3 +1,3 @@
1
1
  module JsonChecker
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cícero Duarte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-12 00:00:00.000000000 Z
11
+ date: 2017-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  requirements: []
135
135
  rubyforge_project:
136
- rubygems_version: 2.0.14.1
136
+ rubygems_version: 2.6.8
137
137
  signing_key:
138
138
  specification_version: 4
139
139
  summary: Validate fields and compare with others json files