hammer_cli 3.15.0 → 3.17.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/doc/creating_commands.md +7 -6
- data/doc/release_notes.md +10 -0
- data/lib/hammer_cli/logger.rb +1 -1
- data/lib/hammer_cli/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/hammer-cli.mo +0 -0
- data/locale/cs_CZ/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/ka/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 +15 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9bf543fcc7917f68a8c4adb7340d31dcc73899f5a9d48bca75cdb0df888aa62f
|
|
4
|
+
data.tar.gz: 757b1497c0af570c01aa6e2571340869a0afc5be7415e73d0a93e64deee17961
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb0b0c74c751c0b5fcdfe1c6dc321b4db416c5bbf07d6c54340bfa9db28b49235bb622e294d379f580b0d88ee72ff4e49b9bf2cdde971ce3215814c7d663b4a1
|
|
7
|
+
data.tar.gz: 757c1319f0634e4ce9ce5b7218533c8ae19b506f3334a9f3bfa1d7e8ed3955d43b1586ad37a90638d7ae41c6f31a087cfe0f1437cccddaae33fdfa0dea5bd152
|
data/doc/creating_commands.md
CHANGED
|
@@ -755,7 +755,7 @@ def adapter
|
|
|
755
755
|
end
|
|
756
756
|
```
|
|
757
757
|
|
|
758
|
-
#### Deprecating fields
|
|
758
|
+
#### Deprecating and replacing fields
|
|
759
759
|
To deprecate a field, add `:deprecated => true` as an option for the field. This will print a warning message to stderr whenever the field is displayed. Consider removing this field from the default set so it is not displayed without a `--fields` param:
|
|
760
760
|
|
|
761
761
|
```
|
|
@@ -770,18 +770,19 @@ Warning: Field 'Deprecated field' is deprecated and may be removed in future ver
|
|
|
770
770
|
Deprecated field: bar
|
|
771
771
|
```
|
|
772
772
|
|
|
773
|
-
Additionally, a field may be 'replaced by' another field using `:replaced_by =>
|
|
773
|
+
Additionally, a field may be 'replaced by' another field using `:replaced_by => [_('Path'), _('To'), _('New'), _('Field')].join('/')`. Translating each string segment independently ensures the resulting translation is identical to the path the user will enter. This will mark the replaced field as deprecated and print a warning message to stderr whenever the field is displayed:
|
|
774
774
|
|
|
775
775
|
```
|
|
776
|
-
field :rep_fld, _("
|
|
776
|
+
field :rep_fld, _("Old field"), Fields::Field, :sets => ['ALL'], :replaced_by => [_('Bar'), _('New Field')].join('/')
|
|
777
777
|
```
|
|
778
778
|
|
|
779
779
|
Example output:
|
|
780
780
|
|
|
781
781
|
```
|
|
782
|
-
$ hammer foo info --fields "
|
|
783
|
-
Warning: Field '
|
|
784
|
-
|
|
782
|
+
$ hammer foo info --fields "Old field"
|
|
783
|
+
Warning: Field 'Foo/Old field' is deprecated. Consider using 'Bar/New field' instead.
|
|
784
|
+
Foo:
|
|
785
|
+
Old field: bar
|
|
785
786
|
```
|
|
786
787
|
|
|
787
788
|
#### Verbosity
|
data/doc/release_notes.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
Release notes
|
|
2
2
|
=============
|
|
3
|
+
### 3.17.0 (2025-11-11)
|
|
4
|
+
* Update logger for #inspect of ruby 3.1+, [#38894](http://projects.theforeman.org/issues/38894)
|
|
5
|
+
* Add packit commit trigger job
|
|
6
|
+
* Add github actions workflow for release process
|
|
7
|
+
* Bump to 3.17.0-develop
|
|
8
|
+
|
|
9
|
+
### 3.16.0 (2025-08-13)
|
|
10
|
+
* Update field documentation to reflect replaced_by translation ([PR #398](https://github.com/theforeman/hammer-cli/pull/398)), [#38427](http://projects.theforeman.org/issues/38427)
|
|
11
|
+
* Bump to 3.16.0-develop
|
|
12
|
+
|
|
3
13
|
### 3.15.0 (2025-05-14)
|
|
4
14
|
* Translate warning message ([PR #396](https://github.com/theforeman/hammer-cli/pull/396)), [#38410](http://projects.theforeman.org/issues/38410)
|
|
5
15
|
* Add mechanism for deprecating displayed fields ([PR #395](https://github.com/theforeman/hammer-cli/pull/395)), [#38410](http://projects.theforeman.org/issues/38410)
|
data/lib/hammer_cli/logger.rb
CHANGED
|
@@ -28,7 +28,7 @@ module Logging
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
# add password filter: *password => "***"
|
|
31
|
-
Logging::LogEvent.add_data_filter(/(password(\e\[0;\d{2}m|\e\[0m|\s
|
|
31
|
+
Logging::LogEvent.add_data_filter(/(password(\e\[0;\d{2}m|\e\[0m|\s|=>|:|")+\")[^\"]*\"/, '\1***"')
|
|
32
32
|
|
|
33
33
|
module HammerCLI
|
|
34
34
|
module Logger
|
data/lib/hammer_cli/version.rb
CHANGED
|
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
|
data/test/unit/abstract_test.rb
CHANGED
|
@@ -147,7 +147,11 @@ describe HammerCLI::AbstractCommand do
|
|
|
147
147
|
it "should have logger.watch output without colors" do
|
|
148
148
|
test_command = Class.new(TestLogCmd4).new("")
|
|
149
149
|
test_command.run []
|
|
150
|
-
|
|
150
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.1') # TODO: remove when Ruby 3.0 is not supported
|
|
151
|
+
_(@log_output.read).must_include "DEBUG TestLogCmd4 : Test\n{\n :a => \"a\"\n}"
|
|
152
|
+
else
|
|
153
|
+
_(@log_output.read).must_include "DEBUG TestLogCmd4 : Test\n{\n a: \"a\"\n}"
|
|
154
|
+
end
|
|
151
155
|
end
|
|
152
156
|
|
|
153
157
|
class TestLogCmd5 < HammerCLI::AbstractCommand
|
|
@@ -162,7 +166,11 @@ describe HammerCLI::AbstractCommand do
|
|
|
162
166
|
HammerCLI::Settings.clear
|
|
163
167
|
HammerCLI::Settings.load(:watch_plain => true)
|
|
164
168
|
test_command.run []
|
|
165
|
-
|
|
169
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.1') # TODO: remove when Ruby 3.0 is not supported
|
|
170
|
+
_(@log_output.read).must_include "DEBUG TestLogCmd5 : Test\n{\n :a => \"a\"\n}"
|
|
171
|
+
else
|
|
172
|
+
_(@log_output.read).must_include "DEBUG TestLogCmd5 : Test\n{\n a: \"a\"\n}"
|
|
173
|
+
end
|
|
166
174
|
end
|
|
167
175
|
|
|
168
176
|
class TestLogCmd6 < HammerCLI::AbstractCommand
|
|
@@ -177,7 +185,11 @@ describe HammerCLI::AbstractCommand do
|
|
|
177
185
|
HammerCLI::Settings.clear
|
|
178
186
|
HammerCLI::Settings.load(:watch_plain => true)
|
|
179
187
|
test_command.run []
|
|
180
|
-
|
|
188
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.1') # TODO: remove when Ruby 3.0 is not supported
|
|
189
|
+
_(@log_output.read).must_include "DEBUG TestLogCmd6 : Test\n{\n :password => \"***\",\n \"password\" => \"***\"\n}"
|
|
190
|
+
else
|
|
191
|
+
_(@log_output.read).must_include "DEBUG TestLogCmd6 : Test\n{\n password: \"***\",\n \"password\" => \"***\"\n}"
|
|
192
|
+
end
|
|
181
193
|
end
|
|
182
194
|
|
|
183
195
|
it "password parameters should be hidden in logs" do
|
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.
|
|
4
|
+
version: 3.17.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: 2025-
|
|
12
|
+
date: 2025-11-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: amazing_print
|