hammer_cli 0.19.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hammer-complete +28 -0
- data/config/cli_config.template.yml +2 -0
- data/config/hammer.completion +5 -0
- data/doc/creating_commands.md +27 -0
- data/doc/installation.md +47 -4
- data/doc/release_notes.md +17 -9
- data/lib/hammer_cli.rb +1 -0
- data/lib/hammer_cli/abstract.rb +32 -2
- data/lib/hammer_cli/apipie/api_connection.rb +5 -1
- data/lib/hammer_cli/apipie/command.rb +3 -2
- data/lib/hammer_cli/bash.rb +2 -0
- data/lib/hammer_cli/bash/completion.rb +159 -0
- data/lib/hammer_cli/bash/prebuild_command.rb +21 -0
- data/lib/hammer_cli/connection.rb +4 -0
- data/lib/hammer_cli/exception_handler.rb +10 -1
- data/lib/hammer_cli/main.rb +5 -3
- data/lib/hammer_cli/options/normalizers.rb +7 -3
- data/lib/hammer_cli/options/option_definition.rb +22 -0
- data/lib/hammer_cli/output/adapter/abstract.rb +1 -5
- data/lib/hammer_cli/output/adapter/base.rb +1 -1
- data/lib/hammer_cli/output/adapter/csv.rb +3 -2
- data/lib/hammer_cli/output/adapter/json.rb +14 -3
- data/lib/hammer_cli/output/adapter/silent.rb +1 -1
- data/lib/hammer_cli/output/adapter/table.rb +26 -7
- data/lib/hammer_cli/output/adapter/yaml.rb +6 -3
- data/lib/hammer_cli/output/output.rb +2 -4
- data/lib/hammer_cli/settings.rb +2 -1
- data/lib/hammer_cli/utils.rb +5 -0
- data/lib/hammer_cli/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/de/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/en/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/en_GB/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/es/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/fr/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/it/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/ja/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/ko/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/ru/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/zh_CN/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/hammer-cli.mo +0 -0
- data/man/hammer.1.gz +0 -0
- data/test/unit/apipie/api_connection_test.rb +1 -0
- data/test/unit/bash_test.rb +138 -0
- data/test/unit/exception_handler_test.rb +44 -0
- data/test/unit/output/adapter/base_test.rb +58 -0
- data/test/unit/output/adapter/csv_test.rb +63 -1
- data/test/unit/output/adapter/json_test.rb +61 -0
- data/test/unit/output/adapter/table_test.rb +70 -1
- data/test/unit/output/adapter/yaml_test.rb +59 -0
- data/test/unit/output/output_test.rb +3 -3
- metadata +75 -68
- data/hammer_cli_complete +0 -13
@@ -55,4 +55,48 @@ describe HammerCLI::ExceptionHandler do
|
|
55
55
|
assert_match /ERROR Exception : (Resource )?Not Found/, @log_output.readline.strip
|
56
56
|
end
|
57
57
|
|
58
|
+
it "should print default prompts for standard missing arguments" do
|
59
|
+
params = %w[login mail]
|
60
|
+
heading = 'Could not create user:'
|
61
|
+
body = "Missing arguments for '--login', '--mail'."
|
62
|
+
ex = ApipieBindings::MissingArgumentsError.new(params)
|
63
|
+
output.expects(:print_error).with(heading, body)
|
64
|
+
handler.handle_exception(ex, heading: heading)
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should print right prompts for nested missing arguments" do
|
68
|
+
params = %w[user[login] user[mail]]
|
69
|
+
heading = 'Could not create user:'
|
70
|
+
body = "Missing arguments for '--login', '--mail'."
|
71
|
+
ex = ApipieBindings::MissingArgumentsError.new(params)
|
72
|
+
output.expects(:print_error).with(heading, body)
|
73
|
+
handler.handle_exception(ex, heading: heading)
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should print simple prompts for even more nested arguments" do
|
77
|
+
params = %w[user[address][city] user[address][street]]
|
78
|
+
heading = 'Could not create user:'
|
79
|
+
body = "Missing arguments for '--address'."
|
80
|
+
ex = ApipieBindings::MissingArgumentsError.new(params)
|
81
|
+
output.expects(:print_error).with(heading, body)
|
82
|
+
handler.handle_exception(ex, heading: heading)
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should print simple prompts for even more different nested arguments" do
|
86
|
+
params = %w[user[address][city] user[address][street] user[nested][par1]]
|
87
|
+
heading = 'Could not create user:'
|
88
|
+
body = "Missing arguments for '--address', '--nested'."
|
89
|
+
ex = ApipieBindings::MissingArgumentsError.new(params)
|
90
|
+
output.expects(:print_error).with(heading, body)
|
91
|
+
handler.handle_exception(ex, heading: heading)
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should print default prompts for standard missing arguments" do
|
95
|
+
params = %w[opt_abc opt_a_b-c]
|
96
|
+
heading = 'Could not create user:'
|
97
|
+
body = "Missing arguments for '--opt-abc', '--opt-a-b-c'."
|
98
|
+
ex = ApipieBindings::MissingArgumentsError.new(params)
|
99
|
+
output.expects(:print_error).with(heading, body)
|
100
|
+
handler.handle_exception(ex, heading: heading)
|
101
|
+
end
|
58
102
|
end
|
@@ -199,6 +199,64 @@ describe HammerCLI::Output::Adapter::Base do
|
|
199
199
|
proc { adapter.print_collection(fields, data) }.must_output(expected_output)
|
200
200
|
end
|
201
201
|
|
202
|
+
context 'printing by chunks' do
|
203
|
+
let(:context) { { show_ids: true } }
|
204
|
+
let(:collection_count) { 30 }
|
205
|
+
let(:collection_data) do
|
206
|
+
collection = collection_count.times.each_with_object([]) do |t, r|
|
207
|
+
r << { id: t, name: "John #{t}"}
|
208
|
+
end
|
209
|
+
HammerCLI::Output::RecordCollection.new(collection)
|
210
|
+
end
|
211
|
+
let(:fields) { [id, name] }
|
212
|
+
|
213
|
+
it 'prints single chunk' do
|
214
|
+
expected_output = collection_count.times.each_with_object([]) do |t, r|
|
215
|
+
r << ["Id: #{t}", "Name: John #{t}", "\n"].join("\n")
|
216
|
+
end.flatten(1).join
|
217
|
+
|
218
|
+
proc do
|
219
|
+
adapter.print_collection(fields, collection_data)
|
220
|
+
end.must_output(expected_output)
|
221
|
+
end
|
222
|
+
|
223
|
+
it 'prints first chunk' do
|
224
|
+
expected_output = 10.times.each_with_object([]) do |t, r|
|
225
|
+
r << ["Id: #{t}", "Name: John #{t}", "\n"].join("\n")
|
226
|
+
end.flatten(1).join
|
227
|
+
|
228
|
+
proc do
|
229
|
+
adapter.print_collection(
|
230
|
+
fields, collection_data[0...10], current_chunk: :first
|
231
|
+
)
|
232
|
+
end.must_output(expected_output)
|
233
|
+
end
|
234
|
+
|
235
|
+
it 'prints another chunk' do
|
236
|
+
expected_output = (10...20).each_with_object([]) do |t, r|
|
237
|
+
r << ["Id: #{t}", "Name: John #{t}", "\n"].join("\n")
|
238
|
+
end.flatten(1).join
|
239
|
+
|
240
|
+
proc do
|
241
|
+
adapter.print_collection(
|
242
|
+
fields, collection_data[10...20], current_chunk: :another
|
243
|
+
)
|
244
|
+
end.must_output(expected_output)
|
245
|
+
end
|
246
|
+
|
247
|
+
it 'prints last chunk' do
|
248
|
+
expected_output = (20...30).each_with_object([]) do |t, r|
|
249
|
+
r << ["Id: #{t}", "Name: John #{t}", "\n"].join("\n")
|
250
|
+
end.flatten(1).join
|
251
|
+
|
252
|
+
proc do
|
253
|
+
adapter.print_collection(
|
254
|
+
fields, collection_data[20...30], current_chunk: :last
|
255
|
+
)
|
256
|
+
end.must_output(expected_output)
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
202
260
|
context "show ids" do
|
203
261
|
|
204
262
|
let(:context) { {:show_ids => true} }
|
@@ -9,7 +9,7 @@ describe HammerCLI::Output::Adapter::CSValues do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
context "print_collection" do
|
12
|
-
|
12
|
+
let(:field_id) { Fields::Id.new(:path => [:id], :label => "Id") }
|
13
13
|
let(:field_name) { Fields::Field.new(:path => [:name], :label => "Name") }
|
14
14
|
let(:field_started_at) { Fields::Field.new(:path => [:started_at], :label => "Started At") }
|
15
15
|
let(:field_login) { Fields::Field.new(:path => [:login], :label => "Login") }
|
@@ -220,6 +220,68 @@ describe HammerCLI::Output::Adapter::CSValues do
|
|
220
220
|
end
|
221
221
|
end
|
222
222
|
|
223
|
+
context 'printing by chunks' do
|
224
|
+
let(:adapter) { HammerCLI::Output::Adapter::CSValues.new(show_ids: true) }
|
225
|
+
let(:collection_count) { 30 }
|
226
|
+
let(:collection_data) do
|
227
|
+
collection = collection_count.times.each_with_object([]) do |t, r|
|
228
|
+
r << { id: t, name: "John #{t}"}
|
229
|
+
end
|
230
|
+
HammerCLI::Output::RecordCollection.new(collection)
|
231
|
+
end
|
232
|
+
let(:fields) { [field_id, field_name] }
|
233
|
+
|
234
|
+
it 'prints single chunk' do
|
235
|
+
expected_output = collection_count.times.each_with_object([]) do |t, r|
|
236
|
+
r << ["#{t}", "John #{t}"].join(',')
|
237
|
+
end.flatten(1).unshift('Id,Name').join("\n") + "\n"
|
238
|
+
|
239
|
+
out, _err = capture_io do
|
240
|
+
adapter.print_collection(fields, collection_data)
|
241
|
+
end
|
242
|
+
out.must_equal(expected_output)
|
243
|
+
end
|
244
|
+
|
245
|
+
it 'prints first chunk' do
|
246
|
+
expected_output = 10.times.each_with_object([]) do |t, r|
|
247
|
+
r << ["#{t}", "John #{t}"].join(',')
|
248
|
+
end.flatten(1).unshift('Id,Name').join("\n") + "\n"
|
249
|
+
|
250
|
+
out, _err = capture_io do
|
251
|
+
adapter.print_collection(
|
252
|
+
fields, collection_data[0...10], current_chunk: :first
|
253
|
+
)
|
254
|
+
end
|
255
|
+
out.must_equal(expected_output)
|
256
|
+
end
|
257
|
+
|
258
|
+
it 'prints another chunk' do
|
259
|
+
expected_output = (10...20).each_with_object([]) do |t, r|
|
260
|
+
r << ["#{t}", "John #{t}"].join(',')
|
261
|
+
end.flatten(1).join("\n") + "\n"
|
262
|
+
|
263
|
+
out, _err = capture_io do
|
264
|
+
adapter.print_collection(
|
265
|
+
fields, collection_data[10...20], current_chunk: :another
|
266
|
+
)
|
267
|
+
end
|
268
|
+
out.must_equal(expected_output)
|
269
|
+
end
|
270
|
+
|
271
|
+
it 'prints last chunk' do
|
272
|
+
expected_output = (20...30).each_with_object([]) do |t, r|
|
273
|
+
r << ["#{t}", "John #{t}"].join(',')
|
274
|
+
end.flatten(1).join("\n") + "\n"
|
275
|
+
|
276
|
+
out, _err = capture_io do
|
277
|
+
adapter.print_collection(
|
278
|
+
fields, collection_data[20...30], current_chunk: :last
|
279
|
+
)
|
280
|
+
end
|
281
|
+
out.must_equal(expected_output)
|
282
|
+
end
|
283
|
+
end
|
284
|
+
|
223
285
|
context "output_stream" do
|
224
286
|
|
225
287
|
let(:tempfile) { Tempfile.new("output_stream_csv_test_temp") }
|
@@ -316,6 +316,67 @@ describe HammerCLI::Output::Adapter::Json do
|
|
316
316
|
end
|
317
317
|
end
|
318
318
|
|
319
|
+
context 'printing by chunks' do
|
320
|
+
let(:settings) { HammerCLI::Settings }
|
321
|
+
let(:context) { { show_ids: true, capitalization: HammerCLI.capitalization } }
|
322
|
+
let(:collection_count) { 30 }
|
323
|
+
let(:collection) do
|
324
|
+
collection_count.times.each_with_object([]) do |t, r|
|
325
|
+
r << { id: t, name: "John #{t}"}
|
326
|
+
end
|
327
|
+
end
|
328
|
+
let(:collection_data) do
|
329
|
+
HammerCLI::Output::RecordCollection.new(collection)
|
330
|
+
end
|
331
|
+
let(:fields) { [id, name] }
|
332
|
+
|
333
|
+
before do
|
334
|
+
settings.load(ui: { capitalization: :downcase })
|
335
|
+
end
|
336
|
+
|
337
|
+
it 'prints single chunk' do
|
338
|
+
expected_output = JSON.pretty_generate(collection) + "\n"
|
339
|
+
|
340
|
+
out, _err = capture_io do
|
341
|
+
adapter.print_collection(fields, collection_data)
|
342
|
+
end
|
343
|
+
out.must_equal(expected_output)
|
344
|
+
end
|
345
|
+
|
346
|
+
it 'prints first chunk' do
|
347
|
+
expected_output = JSON.pretty_generate(collection[0...10])[0...-2] + ",\n"
|
348
|
+
|
349
|
+
out, _err = capture_io do
|
350
|
+
adapter.print_collection(
|
351
|
+
fields, collection_data[0...10], current_chunk: :first
|
352
|
+
)
|
353
|
+
end
|
354
|
+
out.must_equal(expected_output)
|
355
|
+
end
|
356
|
+
|
357
|
+
it 'prints another chunk' do
|
358
|
+
expected_output = JSON.pretty_generate(collection[10...20])[2...-2] + ",\n"
|
359
|
+
|
360
|
+
out, _err = capture_io do
|
361
|
+
adapter.print_collection(
|
362
|
+
fields, collection_data[10...20], current_chunk: :another
|
363
|
+
)
|
364
|
+
end
|
365
|
+
out.must_equal(expected_output)
|
366
|
+
end
|
367
|
+
|
368
|
+
it 'prints last chunk' do
|
369
|
+
expected_output = JSON.pretty_generate(collection[20...30])[2..-1] + "\n"
|
370
|
+
|
371
|
+
out, _err = capture_io do
|
372
|
+
adapter.print_collection(
|
373
|
+
fields, collection_data[20...30], current_chunk: :last
|
374
|
+
)
|
375
|
+
end
|
376
|
+
out.must_equal(expected_output)
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
319
380
|
context "show ids" do
|
320
381
|
|
321
382
|
let(:context) { {:show_ids => true} }
|
@@ -9,7 +9,7 @@ describe HammerCLI::Output::Adapter::Table do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
context "print_collection" do
|
12
|
-
|
12
|
+
let(:field_id) { Fields::Id.new(:path => [:id], :label => "Id") }
|
13
13
|
let(:field_name) { Fields::Field.new(:path => [:fullname], :label => "Name") }
|
14
14
|
let(:field_firstname) { Fields::Field.new(:path => [:firstname], :label => "Firstname") }
|
15
15
|
let(:field_lastname) { Fields::Field.new(:path => [:lastname], :label => "Lastname") }
|
@@ -380,6 +380,75 @@ describe HammerCLI::Output::Adapter::Table do
|
|
380
380
|
|
381
381
|
end
|
382
382
|
|
383
|
+
context 'printing by chunks' do
|
384
|
+
let(:adapter) { HammerCLI::Output::Adapter::Table.new(show_ids: true) }
|
385
|
+
let(:collection_count) { 30 }
|
386
|
+
let(:collection_data) do
|
387
|
+
collection = collection_count.times.each_with_object([]) do |t, r|
|
388
|
+
r << { id: t, fullname: "John Doe #{t}"}
|
389
|
+
end
|
390
|
+
HammerCLI::Output::RecordCollection.new(collection)
|
391
|
+
end
|
392
|
+
let(:fields) { [field_id, field_name] }
|
393
|
+
|
394
|
+
it 'prints single chunk' do
|
395
|
+
expected_output = collection_count.times.each_with_object([]) do |t, r|
|
396
|
+
sp = t < 10 ? ' ' : ''
|
397
|
+
r << ["#{t} #{sp}| John Doe #{t}#{sp}"]
|
398
|
+
end.flatten(1).unshift(
|
399
|
+
'---|------------',
|
400
|
+
'ID | NAME ',
|
401
|
+
"---|------------",
|
402
|
+
).join("\n") + "\n---|------------\n"
|
403
|
+
|
404
|
+
proc do
|
405
|
+
adapter.print_collection(fields, collection_data)
|
406
|
+
end.must_output(expected_output)
|
407
|
+
end
|
408
|
+
|
409
|
+
it 'prints first chunk' do
|
410
|
+
expected_output = (0...10).each_with_object([]) do |t, r|
|
411
|
+
r << [
|
412
|
+
"#{t} | John Doe #{t}"
|
413
|
+
]
|
414
|
+
end.flatten(1).unshift(
|
415
|
+
'---|-----------',
|
416
|
+
'ID | NAME ',
|
417
|
+
"---|-----------",
|
418
|
+
).join("\n") + "\n"
|
419
|
+
|
420
|
+
proc do
|
421
|
+
adapter.print_collection(
|
422
|
+
fields, collection_data[0...10], current_chunk: :first
|
423
|
+
)
|
424
|
+
end.must_output(expected_output)
|
425
|
+
end
|
426
|
+
|
427
|
+
it 'prints another chunk' do
|
428
|
+
expected_output = (10...20).each_with_object([]) do |t, r|
|
429
|
+
r << ["#{t} | John Doe #{t}"]
|
430
|
+
end.flatten(1).join("\n") + "\n"
|
431
|
+
|
432
|
+
proc do
|
433
|
+
adapter.print_collection(
|
434
|
+
fields, collection_data[10...20], current_chunk: :another
|
435
|
+
)
|
436
|
+
end.must_output(expected_output)
|
437
|
+
end
|
438
|
+
#
|
439
|
+
it 'prints last chunk' do
|
440
|
+
expected_output = (20...30).each_with_object([]) do |t, r|
|
441
|
+
r << ["#{t} | John Doe #{t}"]
|
442
|
+
end.flatten(1).join("\n") + "\n---|------------\n"
|
443
|
+
|
444
|
+
proc do
|
445
|
+
adapter.print_collection(
|
446
|
+
fields, collection_data[20...30], current_chunk: :last
|
447
|
+
)
|
448
|
+
end.must_output(expected_output)
|
449
|
+
end
|
450
|
+
end
|
451
|
+
|
383
452
|
context "output_stream" do
|
384
453
|
|
385
454
|
let(:tempfile) { Tempfile.new("output_stream_table_test_temp") }
|
@@ -312,6 +312,65 @@ describe HammerCLI::Output::Adapter::Yaml do
|
|
312
312
|
end
|
313
313
|
end
|
314
314
|
|
315
|
+
context 'printing by chunks' do
|
316
|
+
let(:context) { { show_ids: true } }
|
317
|
+
let(:collection_count) { 30 }
|
318
|
+
let(:collection) do
|
319
|
+
collection_count.times.each_with_object([]) do |t, r|
|
320
|
+
r << { id: t, name: "John #{t}"}
|
321
|
+
end
|
322
|
+
end
|
323
|
+
let(:prepared_collection) do
|
324
|
+
collection.map { |i| i.transform_keys { |k| k.to_s.capitalize } }
|
325
|
+
end
|
326
|
+
let(:collection_data) do
|
327
|
+
HammerCLI::Output::RecordCollection.new(collection)
|
328
|
+
end
|
329
|
+
let(:fields) { [id, name] }
|
330
|
+
|
331
|
+
it 'prints single chunk' do
|
332
|
+
expected_output = YAML.dump(prepared_collection)
|
333
|
+
|
334
|
+
out, _err = capture_io do
|
335
|
+
adapter.print_collection(fields, collection_data)
|
336
|
+
end
|
337
|
+
out.must_equal(expected_output)
|
338
|
+
end
|
339
|
+
|
340
|
+
it 'prints first chunk' do
|
341
|
+
expected_output = YAML.dump(prepared_collection[0...10])
|
342
|
+
|
343
|
+
out, _err = capture_io do
|
344
|
+
adapter.print_collection(
|
345
|
+
fields, collection_data[0...10], current_chunk: :first
|
346
|
+
)
|
347
|
+
end
|
348
|
+
out.must_equal(expected_output)
|
349
|
+
end
|
350
|
+
|
351
|
+
it 'prints another chunk' do
|
352
|
+
expected_output = YAML.dump(prepared_collection[10...20])[4..-1]
|
353
|
+
|
354
|
+
out, _err = capture_io do
|
355
|
+
adapter.print_collection(
|
356
|
+
fields, collection_data[10...20], current_chunk: :another
|
357
|
+
)
|
358
|
+
end
|
359
|
+
out.must_equal(expected_output)
|
360
|
+
end
|
361
|
+
|
362
|
+
it 'prints last chunk' do
|
363
|
+
expected_output = YAML.dump(prepared_collection[20...30])[4..-1]
|
364
|
+
|
365
|
+
out, _err = capture_io do
|
366
|
+
adapter.print_collection(
|
367
|
+
fields, collection_data[20...30], current_chunk: :last
|
368
|
+
)
|
369
|
+
end
|
370
|
+
out.must_equal(expected_output)
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
315
374
|
context "show ids" do
|
316
375
|
|
317
376
|
let(:context) { {:show_ids => true} }
|
@@ -58,19 +58,19 @@ describe HammerCLI::Output::Output do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
it "prints single resource as collection" do
|
61
|
-
adapter.any_instance.expects(:print_collection).with([], instance_of(HammerCLI::Output::RecordCollection))
|
61
|
+
adapter.any_instance.expects(:print_collection).with([], instance_of(HammerCLI::Output::RecordCollection), {})
|
62
62
|
out.print_collection(definition, item1)
|
63
63
|
end
|
64
64
|
|
65
65
|
|
66
66
|
it "prints array of resources" do
|
67
|
-
adapter.any_instance.expects(:print_collection).with([], instance_of(HammerCLI::Output::RecordCollection))
|
67
|
+
adapter.any_instance.expects(:print_collection).with([], instance_of(HammerCLI::Output::RecordCollection), {})
|
68
68
|
out.print_collection(definition, collection)
|
69
69
|
end
|
70
70
|
|
71
71
|
it "prints recordset" do
|
72
72
|
data = HammerCLI::Output::RecordCollection.new(collection)
|
73
|
-
adapter.any_instance.expects(:print_collection).with([], data)
|
73
|
+
adapter.any_instance.expects(:print_collection).with([], data, {})
|
74
74
|
out.print_collection(definition, data)
|
75
75
|
end
|
76
76
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hammer_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Bačovský
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: clamp
|
@@ -149,38 +149,42 @@ description: 'Hammer cli provides universal extendable CLI interface for ruby ap
|
|
149
149
|
email: mbacovsk@redhat.com
|
150
150
|
executables:
|
151
151
|
- hammer
|
152
|
+
- hammer-complete
|
152
153
|
extensions: []
|
153
154
|
extra_rdoc_files:
|
154
155
|
- doc/commands_extension.md
|
155
|
-
- doc/
|
156
|
-
- doc/creating_apipie_commands.md
|
156
|
+
- doc/release_notes.md
|
157
157
|
- doc/design.png
|
158
|
-
- doc/
|
158
|
+
- doc/commands_modification.md
|
159
|
+
- doc/installation.md
|
159
160
|
- doc/development_tips.md
|
160
|
-
- doc/
|
161
|
+
- doc/writing_a_plugin.md
|
162
|
+
- doc/output.md
|
163
|
+
- doc/developer_docs.md
|
161
164
|
- doc/installation_deb.md
|
162
|
-
- doc/
|
165
|
+
- doc/option_normalizers.md
|
163
166
|
- doc/installation_rpm.md
|
167
|
+
- doc/installation_gem.md
|
168
|
+
- doc/help_modification.md
|
169
|
+
- doc/creating_commands.md
|
164
170
|
- doc/installation_source.md
|
165
171
|
- doc/option_builders.md
|
166
|
-
- doc/
|
167
|
-
- doc/writing_a_plugin.md
|
168
|
-
- doc/developer_docs.md
|
169
|
-
- doc/output.md
|
172
|
+
- doc/i18n.md
|
170
173
|
- doc/review_checklist.md
|
171
|
-
- doc/
|
172
|
-
- doc/
|
173
|
-
- doc/help_modification.md
|
174
|
-
- doc/creating_commands.md
|
174
|
+
- doc/creating_apipie_commands.md
|
175
|
+
- doc/design.uml
|
175
176
|
- config/cli.modules.d/module_config_template.yml
|
176
177
|
- config/cli_config.template.yml
|
178
|
+
- config/hammer.completion
|
177
179
|
- README.md
|
178
180
|
files:
|
179
181
|
- LICENSE
|
180
182
|
- README.md
|
181
183
|
- bin/hammer
|
184
|
+
- bin/hammer-complete
|
182
185
|
- config/cli.modules.d/module_config_template.yml
|
183
186
|
- config/cli_config.template.yml
|
187
|
+
- config/hammer.completion
|
184
188
|
- doc/commands_extension.md
|
185
189
|
- doc/commands_modification.md
|
186
190
|
- doc/creating_apipie_commands.md
|
@@ -202,7 +206,6 @@ files:
|
|
202
206
|
- doc/release_notes.md
|
203
207
|
- doc/review_checklist.md
|
204
208
|
- doc/writing_a_plugin.md
|
205
|
-
- hammer_cli_complete
|
206
209
|
- lib/hammer_cli.rb
|
207
210
|
- lib/hammer_cli/abstract.rb
|
208
211
|
- lib/hammer_cli/apipie.rb
|
@@ -212,6 +215,9 @@ files:
|
|
212
215
|
- lib/hammer_cli/apipie/option_definition.rb
|
213
216
|
- lib/hammer_cli/apipie/options.rb
|
214
217
|
- lib/hammer_cli/apipie/resource.rb
|
218
|
+
- lib/hammer_cli/bash.rb
|
219
|
+
- lib/hammer_cli/bash/completion.rb
|
220
|
+
- lib/hammer_cli/bash/prebuild_command.rb
|
215
221
|
- lib/hammer_cli/ca_cert_fetcher.rb
|
216
222
|
- lib/hammer_cli/ca_cert_manager.rb
|
217
223
|
- lib/hammer_cli/clamp.rb
|
@@ -312,6 +318,7 @@ files:
|
|
312
318
|
- test/unit/apipie/option_builder_test.rb
|
313
319
|
- test/unit/apipie/option_definition_test.rb
|
314
320
|
- test/unit/apipie/test_helper.rb
|
321
|
+
- test/unit/bash_test.rb
|
315
322
|
- test/unit/ca_cert_manager_test.rb
|
316
323
|
- test/unit/command_extensions_test.rb
|
317
324
|
- test/unit/completer_test.rb
|
@@ -385,74 +392,74 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
385
392
|
- !ruby/object:Gem::Version
|
386
393
|
version: '0'
|
387
394
|
requirements: []
|
388
|
-
|
389
|
-
rubygems_version: 2.7.10
|
395
|
+
rubygems_version: 3.0.3
|
390
396
|
signing_key:
|
391
397
|
specification_version: 4
|
392
398
|
summary: Universal command-line interface
|
393
399
|
test_files:
|
394
|
-
- test/
|
395
|
-
- test/
|
396
|
-
- test/
|
397
|
-
- test/
|
398
|
-
- test/
|
399
|
-
- test/unit/
|
400
|
+
- test/unit/messages_test.rb
|
401
|
+
- test/unit/exception_handler_test.rb
|
402
|
+
- test/unit/modules_test.rb
|
403
|
+
- test/unit/connection_test.rb
|
404
|
+
- test/unit/completer_test.rb
|
405
|
+
- test/unit/csv_parser_test.rb
|
406
|
+
- test/unit/option_builder_test.rb
|
407
|
+
- test/unit/test_helper.rb
|
408
|
+
- test/unit/utils_test.rb
|
400
409
|
- test/unit/apipie/command_test.rb
|
401
410
|
- test/unit/apipie/option_builder_test.rb
|
402
|
-
- test/unit/apipie/option_definition_test.rb
|
403
411
|
- test/unit/apipie/test_helper.rb
|
404
412
|
- test/unit/apipie/api_connection_test.rb
|
405
|
-
- test/unit/
|
413
|
+
- test/unit/apipie/option_definition_test.rb
|
406
414
|
- test/unit/command_extensions_test.rb
|
407
|
-
- test/unit/
|
408
|
-
- test/unit/
|
409
|
-
- test/unit/
|
415
|
+
- test/unit/main_test.rb
|
416
|
+
- test/unit/options/processor_list_test.rb
|
417
|
+
- test/unit/options/validators/dsl_test.rb
|
418
|
+
- test/unit/options/sources/command_line_test.rb
|
419
|
+
- test/unit/options/sources/saved_defaults_test.rb
|
420
|
+
- test/unit/options/matcher_test.rb
|
421
|
+
- test/unit/options/option_collector_test.rb
|
422
|
+
- test/unit/options/normalizers_test.rb
|
423
|
+
- test/unit/options/option_definition_test.rb
|
424
|
+
- test/unit/settings_test.rb
|
425
|
+
- test/unit/history_test.rb
|
410
426
|
- test/unit/defaults_test.rb
|
427
|
+
- test/unit/logger_test.rb
|
428
|
+
- test/unit/output/formatters_test.rb
|
429
|
+
- test/unit/output/record_collection_test.rb
|
430
|
+
- test/unit/output/dsl_test.rb
|
431
|
+
- test/unit/output/definition_test.rb
|
432
|
+
- test/unit/output/output_test.rb
|
433
|
+
- test/unit/output/field_filter_test.rb
|
434
|
+
- test/unit/output/fields_test.rb
|
435
|
+
- test/unit/output/adapter/table_test.rb
|
436
|
+
- test/unit/output/adapter/json_test.rb
|
437
|
+
- test/unit/output/adapter/abstract_test.rb
|
438
|
+
- test/unit/output/adapter/yaml_test.rb
|
439
|
+
- test/unit/output/adapter/csv_test.rb
|
440
|
+
- test/unit/output/adapter/base_test.rb
|
441
|
+
- test/unit/abstract_test.rb
|
442
|
+
- test/unit/i18n_test.rb
|
411
443
|
- test/unit/fixtures/apipie/architectures.json
|
412
444
|
- test/unit/fixtures/apipie/documented.json
|
413
|
-
- test/unit/fixtures/certs/ca_cert.pem
|
414
|
-
- test/unit/fixtures/certs/non_ca_cert.pem
|
415
|
-
- test/unit/fixtures/defaults/defaults.yml
|
416
445
|
- test/unit/fixtures/defaults/defaults_dashed.yml
|
417
|
-
- test/unit/fixtures/
|
446
|
+
- test/unit/fixtures/defaults/defaults.yml
|
418
447
|
- test/unit/fixtures/json_input/valid.json
|
419
|
-
- test/unit/
|
420
|
-
- test/unit/
|
448
|
+
- test/unit/fixtures/json_input/invalid.json
|
449
|
+
- test/unit/fixtures/certs/ca_cert.pem
|
450
|
+
- test/unit/fixtures/certs/non_ca_cert.pem
|
451
|
+
- test/unit/bash_test.rb
|
421
452
|
- test/unit/help/definition/section_test.rb
|
422
453
|
- test/unit/help/definition/list_test.rb
|
423
|
-
- test/unit/help/definition/note_test.rb
|
424
454
|
- test/unit/help/definition/text_test.rb
|
455
|
+
- test/unit/help/definition/abstract_item_test.rb
|
456
|
+
- test/unit/help/definition/note_test.rb
|
425
457
|
- test/unit/help/definition_test.rb
|
458
|
+
- test/unit/help/builder_test.rb
|
426
459
|
- test/unit/help/text_builder_test.rb
|
427
|
-
- test/unit/
|
428
|
-
- test/
|
429
|
-
- test/
|
430
|
-
- test/
|
431
|
-
- test/
|
432
|
-
- test/
|
433
|
-
- test/unit/option_builder_test.rb
|
434
|
-
- test/unit/options/matcher_test.rb
|
435
|
-
- test/unit/options/normalizers_test.rb
|
436
|
-
- test/unit/options/option_collector_test.rb
|
437
|
-
- test/unit/options/option_definition_test.rb
|
438
|
-
- test/unit/options/processor_list_test.rb
|
439
|
-
- test/unit/options/sources/command_line_test.rb
|
440
|
-
- test/unit/options/sources/saved_defaults_test.rb
|
441
|
-
- test/unit/options/validators/dsl_test.rb
|
442
|
-
- test/unit/output/adapter/abstract_test.rb
|
443
|
-
- test/unit/output/adapter/base_test.rb
|
444
|
-
- test/unit/output/adapter/csv_test.rb
|
445
|
-
- test/unit/output/adapter/json_test.rb
|
446
|
-
- test/unit/output/adapter/table_test.rb
|
447
|
-
- test/unit/output/adapter/yaml_test.rb
|
448
|
-
- test/unit/output/dsl_test.rb
|
449
|
-
- test/unit/output/field_filter_test.rb
|
450
|
-
- test/unit/output/fields_test.rb
|
451
|
-
- test/unit/output/record_collection_test.rb
|
452
|
-
- test/unit/output/formatters_test.rb
|
453
|
-
- test/unit/output/definition_test.rb
|
454
|
-
- test/unit/output/output_test.rb
|
455
|
-
- test/unit/settings_test.rb
|
456
|
-
- test/unit/test_helper.rb
|
457
|
-
- test/unit/utils_test.rb
|
458
|
-
- test/unit/exception_handler_test.rb
|
460
|
+
- test/unit/ca_cert_manager_test.rb
|
461
|
+
- test/functional/help_test.rb
|
462
|
+
- test/functional/test_helper.rb
|
463
|
+
- test/functional/nil_values_test.rb
|
464
|
+
- test/functional/defaults_test.rb
|
465
|
+
- test/test_helper.rb
|