asi_bod 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,42 @@
1
+ require 'pp'
2
+
3
+ module AsiBod
4
+
5
+ class Dict
6
+ def self.find_by_key_substring(dict, key, search_string)
7
+ dict.each_with_object({}) do |(k, v), memo|
8
+ next if v[key].nil?
9
+ memo[k] = v if v[key].to_s.include? search_string
10
+ end
11
+ end
12
+
13
+ # Takes a node and returns an array of elements in the order the keys specify
14
+ # @param node [Hash] The node hash
15
+ # @param keys [Array] Ordered array of keys to select which elements to return
16
+ def self.node_line(node, keys)
17
+ keys.map { |k| node[k] }.join(", ")
18
+ end
19
+
20
+ # Takes a hash of results (subset of a Dict Hash) and puts a result per line
21
+ # with only the keys specified
22
+ # @param results [Hash] The subset of a full asi or bod Hash
23
+ # @param keys [Array] Optional array of keys to display
24
+ def self.put_results(results, keys)
25
+ results.each_pair do |address, node|
26
+ puts Dict.node_line(node, keys)
27
+ end
28
+ end
29
+
30
+ def self.merge(asi, bod)
31
+ bod.each_with_object({}) do |(address, node), memo|
32
+ memo[address] = node
33
+ if (asi[address][:description].nil? ||
34
+ asi[address][:description].include?("Reserved") rescue true)
35
+ memo[address][:description] = nil
36
+ end
37
+ memo[address][:description] = asi[address][:description]
38
+ end
39
+ end
40
+ end
41
+ end
42
+
@@ -0,0 +1,13 @@
1
+ # Work around a bug with the RdocDocumentListener
2
+ # Fix rdoc formatter #201
3
+ # https://github.com/davetron5000/gli/pull/201#issuecomment-195385509
4
+ require 'gli'
5
+ module RdocDocumentListenerAppFix
6
+ def initialize(_global_options,_options,_arguments,app)
7
+ super
8
+ @app = app
9
+ end
10
+ end
11
+ class GLI::Commands::RdocDocumentListener
12
+ prepend RdocDocumentListenerAppFix
13
+ end
@@ -0,0 +1,3 @@
1
+ module AsiBod
2
+ VERSION = '0.1.2'
3
+ end
metadata ADDED
@@ -0,0 +1,182 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asi_bod
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Robert J. Berger
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rdoc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '6.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '6.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: aruba
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.14'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.14'
83
+ - !ruby/object:Gem::Dependency
84
+ name: gli
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.17'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.17'
97
+ - !ruby/object:Gem::Dependency
98
+ name: nori
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.6'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.6'
111
+ - !ruby/object:Gem::Dependency
112
+ name: nokogiri
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.8'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.8'
125
+ description: Process and View Grin Phaserunner ASIObjectDictionary.xml and BOD.json
126
+ files
127
+ email:
128
+ - rberger@ibd.com
129
+ executables:
130
+ - asi_bod
131
+ extensions: []
132
+ extra_rdoc_files:
133
+ - README.rdoc
134
+ - asi_bod.rdoc
135
+ files:
136
+ - ".gitignore"
137
+ - ASIObjectDictionary.xml
138
+ - BOD.origin.json
139
+ - BODm.json
140
+ - Gemfile
141
+ - README.rdoc
142
+ - Rakefile
143
+ - asi_bod.gemspec
144
+ - asi_bod.rdoc
145
+ - exe/asi_bod
146
+ - lib/asi_bod.rb
147
+ - lib/asi_bod/asi.rb
148
+ - lib/asi_bod/bod.rb
149
+ - lib/asi_bod/cli.rb
150
+ - lib/asi_bod/dict.rb
151
+ - lib/asi_bod/gli_patch.rb
152
+ - lib/asi_bod/version.rb
153
+ homepage: https://github.com/rberger/asi_bod
154
+ licenses:
155
+ - MIT
156
+ metadata: {}
157
+ post_install_message:
158
+ rdoc_options:
159
+ - "--title"
160
+ - asi_bod
161
+ - "--main"
162
+ - README.rdoc
163
+ - "-ri"
164
+ require_paths:
165
+ - lib
166
+ required_ruby_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: '0'
171
+ required_rubygems_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ requirements: []
177
+ rubyforge_project:
178
+ rubygems_version: 2.6.14
179
+ signing_key:
180
+ specification_version: 4
181
+ summary: Process and View Grin Phaserunner ASIObjectDictionary.xml and BOD.json files
182
+ test_files: []