ix-cli 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c5aadde615cdfa81843168a63e691e29be91832d247cb01c769ac6f0be4cf5f
4
- data.tar.gz: 178a6b48491c5e5d627390595c60bef6b17c37d150ce02f8ccf59070666b8e2f
3
+ metadata.gz: bb14cdf843c9b38f5aa771f23334ee0bb58ebcc6cd138c56ce2af5d02fbe283d
4
+ data.tar.gz: b09c43e5a377df98063a481d8ccefc95ee698b5fbee9416e95e5e9b6e19eb9bf
5
5
  SHA512:
6
- metadata.gz: 34a177748f513b36e85a425f02865b2c7803b1d2c59abce5cd79aae31bf7ff992adffdf3e7d4277c9312c6aa90f209fb662dde35cc2752366de0c6c7c14c90ea
7
- data.tar.gz: 6b79ddb512d93d28444592dd107076eae1e9c24b0b4da4c9f8c4d8fda5a0be46a69a48d2de0b3afd55bf8f741cc15437137908f736d13c2348581cf43d016c21
6
+ metadata.gz: daef124c711c4365df35f28c2366c8f0cab9a3e83110eb2574ccee83298fef06637e1ba183b31a65e4b6c03a79f412cc9308f2fd0769d74d01fa2d078d48e0d1
7
+ data.tar.gz: 16807bada66a3cbd525e2cdb7b5726e9b2457bb05b392dbabde129d42e6f808309c6b065a6fa1c4f72a222a55952bc551ec4a35ef51edef49bb33e29b8c37223
File without changes
@@ -81,6 +81,10 @@ OptionParser.new do |opts|
81
81
  options[:threshold] = value.to_f
82
82
  end
83
83
 
84
+ opts.on('-s', '--summary', 'Print Summarized version.') do |value|
85
+ options[:summary] = value
86
+ end
87
+
84
88
  end.parse!
85
89
 
86
90
  required_options = [:threshold]
@@ -157,12 +161,15 @@ end
157
161
 
158
162
  require 'isna'
159
163
 
164
+ summary_output = []
165
+ detailed_output = []
166
+
160
167
  banner = Template::Banner.new
161
168
  banner.lines = lines.to_s.to_ansi.yellow.to_s
162
169
  banner.groups = hash.keys.size.to_s.to_ansi.yellow.to_s
163
170
  banner.threshold = options[:threshold].to_s.to_ansi.yellow.to_s
164
171
  banner.datetime = Time.now.to_s.to_ansi.yellow.to_s
165
- puts banner.to_s
172
+ summary_output.push(banner.to_s)
166
173
 
167
174
  groups = []
168
175
 
@@ -179,14 +186,15 @@ end
179
186
  sorted_groups_by_n_records_asc.reverse.each_with_index do |key, index|
180
187
  line, records = key[0], hash[key[0]]
181
188
 
182
- puts ''
189
+ detailed_output.push('')
183
190
 
184
191
  group = Template::Group.new
185
192
  group.percent = ('%2.2f%%' % ((records.size.to_f / lines) * 100)).to_s.to_ansi.red.to_s
186
193
  group.number = (index + 1).to_s.to_ansi.red.to_s
187
194
  group.items = records.size.to_s.to_ansi.cyan.to_s
188
195
  group.line = line.chomp.to_ansi.green.to_s
189
- puts group.to_s
196
+ summary_output.push(group.to_s)
197
+ detailed_output.push(group.to_s)
190
198
 
191
199
  sorted_items_in_group = records.sort do |a, b|
192
200
  a[:score] <=> b[:score]
@@ -198,8 +206,17 @@ sorted_groups_by_n_records_asc.reverse.each_with_index do |key, index|
198
206
  item.total = records.size.to_s.ljust(4, ' ').to_ansi.cyan.to_s
199
207
  item.score = ('%4.2f%%' % (record[:score] * 100)).rjust(7, ' ').to_ansi.green.to_s
200
208
  item.line = record[:line]
201
- puts item.to_s
209
+ detailed_output.push(item.to_s)
202
210
  end
203
211
 
204
212
  end
205
213
 
214
+ summary_output.each do |output_line|
215
+ puts output_line
216
+ end
217
+
218
+ unless options[:summary]
219
+ detailed_output.each do |output_line|
220
+ puts output_line
221
+ end
222
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ix-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuyoshi Tlacaelel