asi_bod 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/asi_bod.rdoc +1 -1
- data/lib/asi_bod/bod.rb +10 -0
- data/lib/asi_bod/cli.rb +10 -8
- data/lib/asi_bod/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcc08bcafe31a9d406a2bb22eb85eb375617c57f
|
4
|
+
data.tar.gz: b20e8303ce389e37a92ecd9e9a1fc5ec95f3d53a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd0791b1d6461b71ee9e71f707495226f4577aa28d9dacd73d49d08e5f8eb3ab634ff10f74a6f4e199eb2f6b77cf77389b9d28ad1ba7bea13a78cfd4a868cb49
|
7
|
+
data.tar.gz: b6ffb27dc01ba55cd1d365437f8fb09f682a09d74c7ed66e4eeb3fd8223a0b8a97d19fc1f50b0185fecc794db26f924384b9137b815b3bcf04111f2990c895c0
|
data/asi_bod.rdoc
CHANGED
data/lib/asi_bod/bod.rb
CHANGED
@@ -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)
|
data/lib/asi_bod/cli.rb
CHANGED
@@ -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.
|
145
|
-
|
146
|
-
|
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.
|
152
|
-
|
153
|
-
|
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
|
data/lib/asi_bod/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|