obf 0.8.0 → 0.8.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/obf/utils.rb +5 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd00c599d531f48b18aebf3bb2bed662be381436
4
- data.tar.gz: dbe1f4910cfdc5441f46137a348eec3fd5120254
3
+ metadata.gz: 7fa4899ce714401f07c3efb5de7b5f852ed973e8
4
+ data.tar.gz: 5531558fe14f1d255b15188e47cf47147e934278
5
5
  SHA512:
6
- metadata.gz: c5cf06356cd608a7602ae2043cdd27d8eaa8f3d4f9323f90afc99e795f4c29ff89930c08a1b736accc4ff816384c758f26735040bdd074ad5eac48512a9de04c
7
- data.tar.gz: a6257eb285b1bd76b93fcb2eedfac5a4201b191115996cd65ee2daf11df361bdb85ace887cabf5e24368331b09254a9b4cd3d51f1cbf7a425c3160347cd52cec
6
+ metadata.gz: 1a757ced5cd7b21d16acca423951a43e16f879a02219e791689e68c58aeb470d5c18af3e6bdebe19f7c5bcbed33e9674dd2b710d9b3cffb621ce3485ab9242db
7
+ data.tar.gz: 63fa5a8561e226e320fb6566867d2e1643cc53cb2de793cefe444223af1605e7141393f8f72d81297f0c2dc14bc985dc68012675c0d85333a124afb1665f807a
data/lib/obf/utils.rb CHANGED
@@ -244,15 +244,17 @@ module OBF::Utils
244
244
  json["#{key}_hash"] = json[key]
245
245
  if json[key].is_a?(Array)
246
246
  hash = {}
247
- json[key].each do |item|
247
+ json[key].compact.each do |item|
248
248
  hash[item['id']] = item
249
249
  end
250
250
  json["#{key}_hash"] = hash
251
251
  elsif json["#{key}_hash"]
252
252
  array = []
253
253
  json["#{key}_hash"].each do |id, item|
254
- item['id'] ||= id
255
- array << item
254
+ if item
255
+ item['id'] ||= id
256
+ array << item
257
+ end
256
258
  end
257
259
  json[key] = array
258
260
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-26 00:00:00.000000000 Z
11
+ date: 2017-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json