hammer_cli 0.19.1 → 2.2.0
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 +4 -4
- data/bin/hammer-complete +28 -0
- data/config/cli_config.template.yml +2 -0
- data/config/hammer.completion +5 -0
- data/doc/commands_extension.md +12 -0
- data/doc/creating_commands.md +100 -0
- data/doc/installation.md +47 -4
- data/doc/installation_rpm.md +2 -2
- data/doc/release_notes.md +31 -6
- data/lib/hammer_cli.rb +1 -0
- data/lib/hammer_cli/abstract.rb +61 -4
- data/lib/hammer_cli/apipie/api_connection.rb +5 -1
- data/lib/hammer_cli/apipie/command.rb +3 -2
- data/lib/hammer_cli/apipie/option_builder.rb +15 -13
- data/lib/hammer_cli/apipie/option_definition.rb +9 -7
- 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/command_extensions.rb +21 -1
- data/lib/hammer_cli/connection.rb +4 -0
- data/lib/hammer_cli/exception_handler.rb +11 -2
- data/lib/hammer_cli/full_help.rb +8 -1
- data/lib/hammer_cli/help/builder.rb +29 -3
- data/lib/hammer_cli/logger_watch.rb +1 -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 +26 -6
- data/lib/hammer_cli/options/option_family.rb +114 -0
- data/lib/hammer_cli/options/predefined.rb +1 -1
- 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 +27 -8
- 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/subcommand.rb +25 -1
- data/lib/hammer_cli/testing/command_assertions.rb +2 -2
- data/lib/hammer_cli/utils.rb +22 -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/test/unit/abstract_test.rb +23 -2
- data/test/unit/apipie/api_connection_test.rb +1 -0
- data/test/unit/apipie/option_builder_test.rb +8 -0
- data/test/unit/bash_test.rb +138 -0
- data/test/unit/command_extensions_test.rb +67 -49
- data/test/unit/exception_handler_test.rb +44 -0
- data/test/unit/help/builder_test.rb +22 -0
- data/test/unit/options/option_family_test.rb +48 -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 +17 -6
- data/hammer_cli_complete +0 -13
@@ -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:
|
4
|
+
version: 2.2.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:
|
12
|
+
date: 2020-08-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: clamp
|
@@ -74,7 +74,7 @@ dependencies:
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
|
-
name:
|
77
|
+
name: amazing_print
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
@@ -145,10 +145,11 @@ dependencies:
|
|
145
145
|
version: 0.2.0
|
146
146
|
description: 'Hammer cli provides universal extendable CLI interface for ruby apps
|
147
147
|
|
148
|
-
'
|
148
|
+
'
|
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
|
@@ -174,13 +175,16 @@ extra_rdoc_files:
|
|
174
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
|
@@ -246,6 +252,7 @@ files:
|
|
246
252
|
- lib/hammer_cli/options/normalizers.rb
|
247
253
|
- lib/hammer_cli/options/option_collector.rb
|
248
254
|
- lib/hammer_cli/options/option_definition.rb
|
255
|
+
- lib/hammer_cli/options/option_family.rb
|
249
256
|
- lib/hammer_cli/options/option_processor.rb
|
250
257
|
- lib/hammer_cli/options/predefined.rb
|
251
258
|
- lib/hammer_cli/options/processor_list.rb
|
@@ -312,6 +319,7 @@ files:
|
|
312
319
|
- test/unit/apipie/option_builder_test.rb
|
313
320
|
- test/unit/apipie/option_definition_test.rb
|
314
321
|
- test/unit/apipie/test_helper.rb
|
322
|
+
- test/unit/bash_test.rb
|
315
323
|
- test/unit/ca_cert_manager_test.rb
|
316
324
|
- test/unit/command_extensions_test.rb
|
317
325
|
- test/unit/completer_test.rb
|
@@ -346,6 +354,7 @@ files:
|
|
346
354
|
- test/unit/options/normalizers_test.rb
|
347
355
|
- test/unit/options/option_collector_test.rb
|
348
356
|
- test/unit/options/option_definition_test.rb
|
357
|
+
- test/unit/options/option_family_test.rb
|
349
358
|
- test/unit/options/processor_list_test.rb
|
350
359
|
- test/unit/options/sources/command_line_test.rb
|
351
360
|
- test/unit/options/sources/saved_defaults_test.rb
|
@@ -385,7 +394,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
385
394
|
- !ruby/object:Gem::Version
|
386
395
|
version: '0'
|
387
396
|
requirements: []
|
388
|
-
rubygems_version: 3.0.
|
397
|
+
rubygems_version: 3.0.8
|
389
398
|
signing_key:
|
390
399
|
specification_version: 4
|
391
400
|
summary: Universal command-line interface
|
@@ -407,6 +416,7 @@ test_files:
|
|
407
416
|
- test/unit/command_extensions_test.rb
|
408
417
|
- test/unit/main_test.rb
|
409
418
|
- test/unit/options/processor_list_test.rb
|
419
|
+
- test/unit/options/option_family_test.rb
|
410
420
|
- test/unit/options/validators/dsl_test.rb
|
411
421
|
- test/unit/options/sources/command_line_test.rb
|
412
422
|
- test/unit/options/sources/saved_defaults_test.rb
|
@@ -441,6 +451,7 @@ test_files:
|
|
441
451
|
- test/unit/fixtures/json_input/invalid.json
|
442
452
|
- test/unit/fixtures/certs/ca_cert.pem
|
443
453
|
- test/unit/fixtures/certs/non_ca_cert.pem
|
454
|
+
- test/unit/bash_test.rb
|
444
455
|
- test/unit/help/definition/section_test.rb
|
445
456
|
- test/unit/help/definition/list_test.rb
|
446
457
|
- test/unit/help/definition/text_test.rb
|