hammer_cli 3.13.0 → 3.14.0

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: a2103a3d5f699dc9f9cf3b64eb5c3260cc2e957541c4398b37575ac7477a2e09
4
- data.tar.gz: dc19532200b475062bf5b6d4350fc4156f27280fa43bdefb34cce314388c0280
3
+ metadata.gz: 682498506056a4d18876c29924250c7050dbc143878fcf03d8bec72140dcfdb4
4
+ data.tar.gz: 4c135d71447e67d75bf6b763d90fcc5b30e41f360683f4205066862854cc3fe3
5
5
  SHA512:
6
- metadata.gz: de4a2168586c87cd4526b36ee39f3cd7a4d634457f96f9c5643c76dc512784a3b9c7f2bce7a343ae16fac74597c68969ea6aa2d1f536dce11ba89f6943d4bf2b
7
- data.tar.gz: a2bd15bcf78b0304fa12f8d0667d5389bc8752071681e593480eeab96c7fd4e7442d29386ae1884129944cd770bc34c1f7ea138d95e2a78e066b087a86a5c699
6
+ metadata.gz: 1451af2336736479bd7a630b1717d42a3563ae8e24261a778e705417e060d18c286c2524e696f723b46059e5e4077ac5b5fb5e16f445f6297a2b87db0dcdb0b1
7
+ data.tar.gz: '0937139414c830add628ce0042ec4575a4972ab9e0d860babac4ef3d3c2976e53f5819464bc8e1e8e781a5cf8c5c93d45d01fde3f810645f5f135c60e9f90a76'
data/doc/release_notes.md CHANGED
@@ -1,5 +1,15 @@
1
1
  Release notes
2
2
  =============
3
+ ### 3.14.0 (2025-02-20)
4
+ * Check better for parent option desc injection, [#38126](http://projects.theforeman.org/issues/38126)
5
+ * Bump apipie-bindings to 0.7.0
6
+ * Don't build hidden params as options ([PR #390](https://github.com/theforeman/hammer-cli/pull/390)), [#38077](http://projects.theforeman.org/issues/38077)
7
+ * Use master branch of apipie-bindings in ci
8
+ * Drop el 8 from packit config
9
+ * Use non-deprecated gpl-3.0-only license tag
10
+ * Pin ffi to < 1.17 for ruby 2.7 ([PR #387](https://github.com/theforeman/hammer-cli/pull/387))
11
+ * Bump to 3.14.0-develop
12
+
3
13
  ### 3.13.0 (2024-11-08)
4
14
  * Bump to 3.13.0-develop
5
15
 
@@ -30,6 +30,7 @@ module HammerCLI::Apipie
30
30
  def options_for_params(params, filter, resource_name_map, opts = {})
31
31
  options = []
32
32
  params.each do |p|
33
+ next unless p.show?
33
34
  exists = opts[:command].find_option(option_switch(p, resource_name_map))
34
35
  next if filter.include?(p.name) || filter.include?(p.name.to_sym) || exists
35
36
 
@@ -85,6 +86,7 @@ module HammerCLI::Apipie
85
86
  opts[:attribute_name] = HammerCLI.option_accessor_name(param.name)
86
87
  opts[:referenced_resource] = resource_name(param)
87
88
  opts[:aliased_resource] = aliased_name(resource_name(param), resource_name_map)
89
+ opts[:show] = param.show?
88
90
 
89
91
  return opts
90
92
  end
@@ -30,6 +30,8 @@ module HammerCLI
30
30
  @context_target = options[:context_target]
31
31
  @deprecated_switches = options[:deprecated]
32
32
  @family = options[:family]
33
+ # We expect a value from API param docs, but in case it's not there, we want to show it in help by default
34
+ @show = options.fetch(:show, true)
33
35
  super
34
36
  end
35
37
 
@@ -153,6 +155,10 @@ module HammerCLI
153
155
  @family.children.include?(self)
154
156
  end
155
157
 
158
+ def show?
159
+ @show
160
+ end
161
+
156
162
  private
157
163
 
158
164
  def format_deprecation_msg(option_desc, deprecation_msg)
@@ -27,7 +27,7 @@ module HammerCLI
27
27
  def description
28
28
  types = all.map(&:type).map { |s| s.split('_').last.to_s }
29
29
  .map(&:downcase).join('/')
30
- parent_desc = @parent.help[1].gsub(IDS_REGEX) { |w| w.gsub(/\b.+\b/, types) }
30
+ parent_desc = @parent.help[1].gsub(IDS_REGEX) { |w| types.include?(w.strip.downcase) ? w.gsub(/\b.+\b/, types) : w }
31
31
  desc = @options[:description] || parent_desc.strip.empty? ? @options[:description] : parent_desc
32
32
  if @options[:deprecation].class <= String
33
33
  format_deprecation_msg(desc, _('Deprecated: %{deprecated_msg}') % { deprecated_msg: @options[:deprecation] })
@@ -1,5 +1,5 @@
1
1
  module HammerCLI
2
2
  def self.version
3
- @version ||= Gem::Version.new "3.13.0"
3
+ @version ||= Gem::Version.new "3.14.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
Binary file
Binary file
@@ -178,4 +178,14 @@ describe HammerCLI::Apipie::OptionBuilder do
178
178
  end
179
179
  end
180
180
 
181
+ context "hidden parameters" do
182
+ let(:action) { resource.action(:create) }
183
+
184
+ it "should skip options for params with show? false" do
185
+ option_switches = options.map(&:long_switch)
186
+ refute_includes(option_switches, "--hidden")
187
+ refute_includes(option_switches, "--documented-scope")
188
+ end
189
+ end
190
+
181
191
  end
@@ -75,6 +75,16 @@
75
75
  "examples": [],
76
76
  "errors": [],
77
77
  "params": [
78
+ {
79
+ "allow_null": false,
80
+ "name": "documented_scope",
81
+ "full_name": "documented_scope",
82
+ "validator": "Must be String",
83
+ "description": "",
84
+ "expected_type": "string",
85
+ "required": false,
86
+ "show": false
87
+ },
78
88
  {
79
89
  "allow_null": false,
80
90
  "name": "documented",
@@ -110,6 +120,16 @@
110
120
  "expected_type": "array",
111
121
  "description": "",
112
122
  "required": true
123
+ },
124
+ {
125
+ "name": "hidden",
126
+ "allow_null": false,
127
+ "full_name": "documented[hidden]",
128
+ "validator": "Must be number",
129
+ "expected_type": "number",
130
+ "description": "",
131
+ "required": false,
132
+ "show": false
113
133
  }
114
134
  ]
115
135
  }
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: 3.13.0
4
+ version: 3.14.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: 2024-11-08 00:00:00.000000000 Z
12
+ date: 2025-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
@@ -121,14 +121,14 @@ dependencies:
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 0.6.0
124
+ version: 0.7.0
125
125
  type: :runtime
126
126
  prerelease: false
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 0.6.0
131
+ version: 0.7.0
132
132
  description: 'Hammer cli provides universal extendable CLI interface for ruby apps
133
133
 
134
134
  '
@@ -367,7 +367,7 @@ files:
367
367
  - test/unit/utils_test.rb
368
368
  homepage: https://github.com/theforeman/hammer-cli
369
369
  licenses:
370
- - GPL-3.0
370
+ - GPL-3.0-only
371
371
  metadata: {}
372
372
  post_install_message:
373
373
  rdoc_options: []