hammer_cli 2.1.1 → 2.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e7d0cc6fea99d3276fb653e462448bddc6b8977e0e5ed9df2a1f257365bee84
4
- data.tar.gz: 72123cef1ffaafb8979ff5e6bac55ca0fa9776e88800327ad41b48404a3a6284
3
+ metadata.gz: ef5d5eb556461a6873fe0b3b05bcc8a30aea17f88719b3c10c25106c73224884
4
+ data.tar.gz: 564721c9765ccd22b82fee81eea83be8b29da7ee0e415fd492deece64ca55b53
5
5
  SHA512:
6
- metadata.gz: 1514dfe8e1059a70da7af58887e9763d604eaec59ec438af136b2a430338ba0c4c9222e4e86f275fb12135165dabb1f51281daaba5ba48924e32d206307bd94e
7
- data.tar.gz: a17a67150e2bf0fb293f167d72cc5425e0fe0ebc9eb57c30144e5be952dbb45d8e370257408893727cfadcf3ce6d2607e098f90a1eb40955ff0dc98dc1ac39f1
6
+ metadata.gz: efde2a000ba9e27da2a466496232399da3861bb69705631ca9113ecc88920cc0af9ff344536c858fe4fbb77e60fe886582919885983d03b4235da70b0e80a6dd
7
+ data.tar.gz: a2673ec7bb6c5ed621c7a068e67962fec2c038f99b12abe1f0f19fa85fad3711598aaa3abf52e7896e72db938f74c7726b350e8bebcd5eaf04c6ef02806c96f5
data/bin/hammer-complete CHANGED
@@ -5,9 +5,7 @@ require 'English'
5
5
  $LOAD_PATH.unshift(File.join(@project_root, 'lib'))
6
6
  HAMMER = ENV['HAMMER'] || File.join(@project_root, 'bin/hammer')
7
7
 
8
- require 'yaml'
9
-
10
- completion_cache_file = ENV['HAMMER_COMPLETION_CACHE'] || '~/.cache/hammer_completion.yml'
8
+ completion_cache_file = ENV['HAMMER_COMPLETION_CACHE'] || '~/.cache/hammer_completion.json'
11
9
  completion_cache_file = File.expand_path(completion_cache_file)
12
10
 
13
11
  # build the cache if it does not exist
@@ -45,7 +45,7 @@
45
45
  #:log_pattern: '[%5l %d %c] %m'
46
46
 
47
47
  # Location of cache for bash completion
48
- :completion_cache_file: '~/.cache/hammer_completion.yml'
48
+ :completion_cache_file: '~/.cache/hammer_completion.json'
49
49
 
50
50
  # SSL auth options
51
51
  #:ssl:
data/doc/installation.md CHANGED
@@ -144,7 +144,7 @@ executable specified in `/etc/bash_completion.d/hammer`.
144
144
 
145
145
  Bash completion for hammer needs pre-built cache that holds description of
146
146
  all subcommands and its parameters. The cache is located by default in
147
- `~/.cache/hammer_completion.yml`. The location can be changed in hammer's
147
+ `~/.cache/hammer_completion.json`. The location can be changed in hammer's
148
148
  config file. The cache can be built manually with
149
149
  `hammer prebuild-bash-completion` or is built automatically when completion is
150
150
  used and the cache is missing (this may cause slight delay). The cache expires
@@ -1,8 +1,8 @@
1
1
  ### Installation from RPMs
2
2
 
3
- #### Step 1: setup yum repositories
3
+ #### Step 1: set up yum repositories
4
4
 
5
- For Foreman 1.3 stable the hammer packages are part of your installation repo and you can skip this step.
5
+ For Foreman 1.3 stable, the hammer packages are part of your installation repo and you can skip this step.
6
6
 
7
7
  You can choose from stable or nightly repo. Nightly has more recent version of hammer packages, but it was subject to less testing so there is a higher risk of issues.
8
8
  Add the Foreman yum repository to your yum repo files. For Fedora installations replace 'el6' with 'f18' or 'f19' as appropriate.
@@ -8,6 +8,7 @@ Clone and install CLI core
8
8
  ```bash
9
9
  $ git clone https://github.com/theforeman/hammer-cli.git
10
10
  $ cd hammer-cli
11
+ $ bundle install
11
12
  $ rake install
12
13
  $ cd ..
13
14
  ```
@@ -17,6 +18,7 @@ clone plugin with foreman commands
17
18
  ```bash
18
19
  $ git clone https://github.com/theforeman/hammer-cli-foreman.git
19
20
  $ cd hammer-cli-foreman
21
+ $ bundle install
20
22
  $ rake install
21
23
  $ cd ..
22
24
  ```
@@ -25,7 +27,8 @@ and optionally other plugins.
25
27
 
26
28
 
27
29
  #### Step 2: enable and configure the plugins
28
- You'll have to copy configuration files to proper locations manually.
29
- Please check our [configuration instructions](installation.md#configuration)
30
+ - Add the plugin as a gem to `Gemfile.local.rb`
31
+ - Copy the configuration files to proper locations manually,
32
+ please check our [configuration instructions](installation.md#configuration)
30
33
  and see how to proceed.
31
34
 
data/doc/release_notes.md CHANGED
@@ -1,9 +1,23 @@
1
1
  Release notes
2
2
  =============
3
- ### 2.1.1 (2020-05-29)
3
+ ### 2.4.0 (2021-02-01)
4
+ * Expand path for bash completion file, [#30639](http://projects.theforeman.org/issues/30639)
5
+ * Remove release notes written twice
6
+ * Bump to 2.4.0-develop
7
+
8
+ ### 2.3.0 (2020-11-03)
9
+ * Stop sending empty compute attrs param, [#30815](http://projects.theforeman.org/issues/30815)
10
+ * Make fuzzy search work in hammer shell ([PR #335](https://github.com/theforeman/hammer-cli/pull/335)), [#30747](http://projects.theforeman.org/issues/30747)
11
+ * Add details to installation from source doc ([PR #334](https://github.com/theforeman/hammer-cli/pull/334)), [#30666](http://projects.theforeman.org/issues/30666)
12
+ * Bump to 2.3.0-develop
13
+ * Bump to 2.2.0
14
+
15
+ ### 2.2.0 (2020-08-11)
16
+ * Update installation_rpm.md ([PR #333](https://github.com/theforeman/hammer-cli/pull/333))
4
17
  * Clean gem_release.ipynb up
5
18
  * Replace awesome_print with amazing_print ([PR #330](https://github.com/theforeman/hammer-cli/pull/330)), [#29846](http://projects.theforeman.org/issues/29846)
6
19
  * Fix typo: s/filed/feild/ ([PR #331](https://github.com/theforeman/hammer-cli/pull/331))
20
+ * Bump to 2.2.0-develop
7
21
 
8
22
  ### 2.1.0 (2020-05-14)
9
23
  * Hammer full-help returns correct output, [#29697](http://projects.theforeman.org/issues/29697)
@@ -10,11 +10,11 @@ module HammerCLI::Apipie
10
10
  opts = {}
11
11
 
12
12
  params.each do |p|
13
- if p.expected_type == :hash
13
+ if p.expected_type == :hash && !p.params.empty?
14
14
  opts[p.name] = method_options_for_params(p.params, options)
15
15
  else
16
16
  p_name = HammerCLI.option_accessor_name(p.name)
17
- if options.has_key?(p_name)
17
+ if options.key?(p_name)
18
18
  opts[p.name] = options[p_name]
19
19
  elsif respond_to?(p_name, true)
20
20
  opt = send(p_name)
@@ -3,10 +3,12 @@ module HammerCLI
3
3
  class PrebuildCompletionCommand < HammerCLI::AbstractCommand
4
4
  def execute
5
5
  map = HammerCLI::MainCommand.completion_map
6
- cache_file = HammerCLI::Settings.get(:completion_cache_file)
6
+ cache_file = File.expand_path(
7
+ HammerCLI::Settings.get(:completion_cache_file)
8
+ )
7
9
  cache_dir = File.dirname(cache_file)
8
10
  FileUtils.mkdir_p(cache_dir) unless File.directory?(cache_dir)
9
- File.write(File.expand_path(cache_file), map.to_json)
11
+ File.write(cache_file, map.to_json)
10
12
 
11
13
  HammerCLI::EX_OK
12
14
  end
@@ -61,25 +61,6 @@ module HammerCLI
61
61
  label = HighLine.color(label, :bold) if @richtext
62
62
  puts label
63
63
  end
64
-
65
- private
66
-
67
- def expand_invocation_path(path)
68
- bits = path.split(' ')
69
- parent_command = HammerCLI::MainCommand
70
- new_path = (bits[1..-1] || []).each_with_object([]) do |bit, names|
71
- subcommand = parent_command.find_subcommand(bit)
72
- next if subcommand.nil?
73
-
74
- names << if subcommand.names.size > 1
75
- "<#{subcommand.names.join('|')}>"
76
- else
77
- subcommand.names.first
78
- end
79
- parent_command = subcommand.subcommand_class
80
- end
81
- new_path.unshift(bits.first).join(' ')
82
- end
83
64
  end
84
65
  end
85
66
  end
@@ -67,7 +67,7 @@ module HammerCLI
67
67
  def self.default_settings
68
68
  {
69
69
  :use_defaults => true,
70
- :completion_cache_file => '~/.cache/hammer_completion.yml'
70
+ :completion_cache_file => '~/.cache/hammer_completion.json'
71
71
  }
72
72
  end
73
73
 
@@ -121,7 +121,7 @@ module HammerCLI
121
121
  bits = path.split(' ')
122
122
  parent_command = HammerCLI::MainCommand
123
123
  new_path = (bits[1..-1] || []).each_with_object([]) do |bit, names|
124
- subcommand = parent_command.find_subcommand(bit)
124
+ subcommand = parent_command.find_subcommand(bit, fuzzy: false)
125
125
  next if subcommand.nil?
126
126
 
127
127
  names << if subcommand.names.size > 1
@@ -1,5 +1,5 @@
1
1
  module HammerCLI
2
2
  def self.version
3
- @version ||= Gem::Version.new "2.1.1"
3
+ @version ||= Gem::Version.new "2.4.0"
4
4
  end
5
5
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/man/hammer.1.gz CHANGED
Binary file
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: 2.1.1
4
+ version: 2.4.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-05-29 00:00:00.000000000 Z
12
+ date: 2021-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
@@ -145,7 +145,7 @@ 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
@@ -153,26 +153,26 @@ executables:
153
153
  extensions: []
154
154
  extra_rdoc_files:
155
155
  - doc/commands_extension.md
156
- - doc/commands_modification.md
157
- - doc/creating_apipie_commands.md
158
- - doc/creating_commands.md
156
+ - doc/release_notes.md
159
157
  - doc/design.png
160
- - doc/design.uml
161
- - doc/developer_docs.md
162
- - doc/development_tips.md
163
- - doc/help_modification.md
164
- - doc/i18n.md
158
+ - doc/commands_modification.md
165
159
  - doc/installation.md
160
+ - doc/development_tips.md
161
+ - doc/writing_a_plugin.md
162
+ - doc/output.md
163
+ - doc/developer_docs.md
166
164
  - doc/installation_deb.md
167
- - doc/installation_gem.md
165
+ - doc/option_normalizers.md
168
166
  - doc/installation_rpm.md
167
+ - doc/installation_gem.md
168
+ - doc/help_modification.md
169
+ - doc/creating_commands.md
169
170
  - doc/installation_source.md
170
171
  - doc/option_builders.md
171
- - doc/option_normalizers.md
172
- - doc/output.md
172
+ - doc/i18n.md
173
173
  - doc/review_checklist.md
174
- - doc/writing_a_plugin.md
175
- - doc/release_notes.md
174
+ - doc/creating_apipie_commands.md
175
+ - doc/design.uml
176
176
  - config/cli.modules.d/module_config_template.yml
177
177
  - config/cli_config.template.yml
178
178
  - config/hammer.completion
@@ -394,75 +394,75 @@ required_rubygems_version: !ruby/object:Gem::Requirement
394
394
  - !ruby/object:Gem::Version
395
395
  version: '0'
396
396
  requirements: []
397
- rubygems_version: 3.1.2
397
+ rubygems_version: 3.0.8
398
398
  signing_key:
399
399
  specification_version: 4
400
400
  summary: Universal command-line interface
401
401
  test_files:
402
- - test/functional/defaults_test.rb
403
- - test/functional/help_test.rb
404
- - test/functional/nil_values_test.rb
405
- - test/functional/test_helper.rb
406
- - test/test_helper.rb
407
- - test/unit/abstract_test.rb
408
- - test/unit/apipie/api_connection_test.rb
402
+ - test/unit/messages_test.rb
403
+ - test/unit/exception_handler_test.rb
404
+ - test/unit/modules_test.rb
405
+ - test/unit/connection_test.rb
406
+ - test/unit/completer_test.rb
407
+ - test/unit/csv_parser_test.rb
408
+ - test/unit/option_builder_test.rb
409
+ - test/unit/test_helper.rb
410
+ - test/unit/utils_test.rb
409
411
  - test/unit/apipie/command_test.rb
410
412
  - test/unit/apipie/option_builder_test.rb
411
- - test/unit/apipie/option_definition_test.rb
412
413
  - test/unit/apipie/test_helper.rb
413
- - test/unit/bash_test.rb
414
- - test/unit/ca_cert_manager_test.rb
414
+ - test/unit/apipie/api_connection_test.rb
415
+ - test/unit/apipie/option_definition_test.rb
415
416
  - test/unit/command_extensions_test.rb
416
- - test/unit/completer_test.rb
417
- - test/unit/connection_test.rb
418
- - test/unit/csv_parser_test.rb
417
+ - test/unit/main_test.rb
418
+ - test/unit/options/processor_list_test.rb
419
+ - test/unit/options/option_family_test.rb
420
+ - test/unit/options/validators/dsl_test.rb
421
+ - test/unit/options/sources/command_line_test.rb
422
+ - test/unit/options/sources/saved_defaults_test.rb
423
+ - test/unit/options/matcher_test.rb
424
+ - test/unit/options/option_collector_test.rb
425
+ - test/unit/options/normalizers_test.rb
426
+ - test/unit/options/option_definition_test.rb
427
+ - test/unit/settings_test.rb
428
+ - test/unit/history_test.rb
419
429
  - test/unit/defaults_test.rb
420
- - test/unit/exception_handler_test.rb
430
+ - test/unit/logger_test.rb
431
+ - test/unit/output/formatters_test.rb
432
+ - test/unit/output/record_collection_test.rb
433
+ - test/unit/output/dsl_test.rb
434
+ - test/unit/output/definition_test.rb
435
+ - test/unit/output/output_test.rb
436
+ - test/unit/output/field_filter_test.rb
437
+ - test/unit/output/fields_test.rb
438
+ - test/unit/output/adapter/table_test.rb
439
+ - test/unit/output/adapter/json_test.rb
440
+ - test/unit/output/adapter/abstract_test.rb
441
+ - test/unit/output/adapter/yaml_test.rb
442
+ - test/unit/output/adapter/csv_test.rb
443
+ - test/unit/output/adapter/base_test.rb
444
+ - test/unit/abstract_test.rb
445
+ - test/unit/i18n_test.rb
421
446
  - test/unit/fixtures/apipie/architectures.json
422
447
  - test/unit/fixtures/apipie/documented.json
423
- - test/unit/fixtures/certs/ca_cert.pem
424
- - test/unit/fixtures/certs/non_ca_cert.pem
425
- - test/unit/fixtures/defaults/defaults.yml
426
448
  - test/unit/fixtures/defaults/defaults_dashed.yml
427
- - test/unit/fixtures/json_input/invalid.json
449
+ - test/unit/fixtures/defaults/defaults.yml
428
450
  - test/unit/fixtures/json_input/valid.json
429
- - test/unit/help/builder_test.rb
430
- - test/unit/help/definition/abstract_item_test.rb
431
- - test/unit/help/definition/list_test.rb
432
- - test/unit/help/definition/note_test.rb
451
+ - test/unit/fixtures/json_input/invalid.json
452
+ - test/unit/fixtures/certs/ca_cert.pem
453
+ - test/unit/fixtures/certs/non_ca_cert.pem
454
+ - test/unit/bash_test.rb
433
455
  - test/unit/help/definition/section_test.rb
456
+ - test/unit/help/definition/list_test.rb
434
457
  - test/unit/help/definition/text_test.rb
458
+ - test/unit/help/definition/abstract_item_test.rb
459
+ - test/unit/help/definition/note_test.rb
435
460
  - test/unit/help/definition_test.rb
461
+ - test/unit/help/builder_test.rb
436
462
  - test/unit/help/text_builder_test.rb
437
- - test/unit/history_test.rb
438
- - test/unit/i18n_test.rb
439
- - test/unit/logger_test.rb
440
- - test/unit/main_test.rb
441
- - test/unit/messages_test.rb
442
- - test/unit/modules_test.rb
443
- - test/unit/option_builder_test.rb
444
- - test/unit/options/matcher_test.rb
445
- - test/unit/options/normalizers_test.rb
446
- - test/unit/options/option_collector_test.rb
447
- - test/unit/options/option_definition_test.rb
448
- - test/unit/options/option_family_test.rb
449
- - test/unit/options/processor_list_test.rb
450
- - test/unit/options/sources/command_line_test.rb
451
- - test/unit/options/sources/saved_defaults_test.rb
452
- - test/unit/options/validators/dsl_test.rb
453
- - test/unit/output/adapter/abstract_test.rb
454
- - test/unit/output/adapter/base_test.rb
455
- - test/unit/output/adapter/csv_test.rb
456
- - test/unit/output/adapter/json_test.rb
457
- - test/unit/output/adapter/table_test.rb
458
- - test/unit/output/adapter/yaml_test.rb
459
- - test/unit/output/definition_test.rb
460
- - test/unit/output/dsl_test.rb
461
- - test/unit/output/field_filter_test.rb
462
- - test/unit/output/fields_test.rb
463
- - test/unit/output/formatters_test.rb
464
- - test/unit/output/output_test.rb
465
- - test/unit/output/record_collection_test.rb
466
- - test/unit/settings_test.rb
467
- - test/unit/test_helper.rb
468
- - test/unit/utils_test.rb
463
+ - test/unit/ca_cert_manager_test.rb
464
+ - test/functional/help_test.rb
465
+ - test/functional/test_helper.rb
466
+ - test/functional/nil_values_test.rb
467
+ - test/functional/defaults_test.rb
468
+ - test/test_helper.rb