asi_bod 0.1.3 → 0.1.4

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: 0fffe6a70e746724e33292bea03778ae3c4ae4e7
4
- data.tar.gz: 343e48434eb1a69e0e532891fc4fcc39649fd15a
3
+ metadata.gz: dcc08bcafe31a9d406a2bb22eb85eb375617c57f
4
+ data.tar.gz: b20e8303ce389e37a92ecd9e9a1fc5ec95f3d53a
5
5
  SHA512:
6
- metadata.gz: ed713a4e7cca0ceacd3cebb2eca07d40cc28347fc015b2bd7ff21f576a9bae87429e71862905f0d97285e94c458171ad582f2dcadc4518d017da2ee53f8eea5a
7
- data.tar.gz: 29f643a1f59f09624aa728da6d8f8d38105c736913a13c750adf7bb9e9734484ff72cc7ae897b1809c9a0fbdf75414e8cc7fecbaf3c2adeccddb8c6cb7e9a56c
6
+ metadata.gz: cd0791b1d6461b71ee9e71f707495226f4577aa28d9dacd73d49d08e5f8eb3ab634ff10f74a6f4e199eb2f6b77cf77389b9d28ad1ba7bea13a78cfd4a868cb49
7
+ data.tar.gz: b6ffb27dc01ba55cd1d365437f8fb09f682a09d74c7ed66e4eeb3fd8223a0b8a97d19fc1f50b0185fecc794db26f924384b9137b815b3bcf04111f2990c895c0
@@ -1,6 +1,6 @@
1
1
  == asi_bod - Manipulate and view the ASIObjectDictionary.xml and BOD.json files
2
2
 
3
- v0.1.3
3
+ v0.1.4
4
4
 
5
5
  === Global Options
6
6
  === -a|--asi_file arg
@@ -16,6 +16,16 @@ module AsiBod
16
16
  @hash_data = json_data_to_hash(@json_data)
17
17
  end
18
18
 
19
+ # Make the Dictionary an pleasant hash with Integer top keys (addresses) and
20
+ # symbols for other keys
21
+ # @params [Hash<String, Hash>] original_dict The BOD Hash as it came from JSON.parse
22
+ # @return [Hash<Integer>, <Hash>] Hash of Hashes where the top key is the address
23
+ def clean_dict(original_dict)
24
+ original_dict.each_with_object({}) do |(k, v), memo|
25
+ memo[k.to_i] = clean_node(v)
26
+ end
27
+ end
28
+
19
29
  def json_data_to_hash(json_data)
20
30
  json_data.each_with_object({}) do |(k, v), memo|
21
31
  memo[k.to_i] = clean_node(v)
@@ -141,17 +141,19 @@ module AsiBod
141
141
  substring = args[1]
142
142
  if options[GPARENT][:asi]
143
143
  puts "asi: key: #{key} substring: #{substring} => "
144
- Dict.put_results(
145
- Dict.find_by_key_substring(asi.hash_data, key, substring),
146
- which_keys(global_options)
147
- )
144
+ Dict.find_by_key_substring(asi.hash_data, key, substring,
145
+ which_keys(global_options)
146
+ ).each_pair do |address, node|
147
+ puts node
148
+ end
148
149
  end
149
150
  if options[GPARENT][:bod]
150
151
  puts "bod: key: #{key} substring: #{substring} => "
151
- Dict.put_results(
152
- Dict.find_by_key_substring(bod.hash_data, key, substring),
153
- which_keys(global_options)
154
- )
152
+ Dict.find_by_key_substring(bod.hash_data, key, substring,
153
+ which_keys(global_options)
154
+ ).each_pair do |address, node|
155
+ puts node
156
+ end
155
157
  end
156
158
  end
157
159
  end
@@ -1,3 +1,3 @@
1
1
  module AsiBod
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asi_bod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert J. Berger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-10 00:00:00.000000000 Z
11
+ date: 2018-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler