hammer_cli 3.11.0 → 3.13.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: 28417298b7d1b18023350ab1f517ae82f6661b8883f9083fb767cc60aef2e95c
4
- data.tar.gz: 9e877483c4e92d62cfb1fca2b0913d75abed07ab0e5af0340240b61b5a583182
3
+ metadata.gz: a2103a3d5f699dc9f9cf3b64eb5c3260cc2e957541c4398b37575ac7477a2e09
4
+ data.tar.gz: dc19532200b475062bf5b6d4350fc4156f27280fa43bdefb34cce314388c0280
5
5
  SHA512:
6
- metadata.gz: 1999f20631b422871d571b2fa3fbeecc83c3220b319b092fbe201a0a6429ff478b189e427d2f4c736c08bac701304cce6673ddd999f91dfbecb636e080d4946f
7
- data.tar.gz: ad2058c279f4f5cc2c7160dde467017508fe288ee30277a322ee1a433cae698d4808150d769ca15760cb9d7842003fa053f99d7d4843a1ed097cbc49e726c174
6
+ metadata.gz: de4a2168586c87cd4526b36ee39f3cd7a4d634457f96f9c5643c76dc512784a3b9c7f2bce7a343ae16fac74597c68969ea6aa2d1f536dce11ba89f6943d4bf2b
7
+ data.tar.gz: a2bd15bcf78b0304fa12f8d0667d5389bc8752071681e593480eeab96c7fd4e7442d29386ae1884129944cd770bc34c1f7ea138d95e2a78e066b087a86a5c699
@@ -2,26 +2,29 @@
2
2
 
3
3
  #### Step 1: setup apt 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
+ Since Foreman 1.3 the hammer packages are part of your installation repo.
6
+ It is only necessary to setup apt repositories if you are installing Hammer separatly from Foreman.
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 highr risk of issues.
8
+ You can choose from a specific version or nightly repo.
9
+ Nightly has more recent version of hammer packages that have only had limited testing so there is a higher risk of issues.
8
10
 
9
- Choose stable (don't forget to replace "squeeze" with version name of your system)
11
+ Here are a few examples for combinations of Linux-distributions and Foreman releases.
12
+ Remember to adjust these as necessary, visit http://deb.theforeman.org/ for up to date information.
10
13
 
11
- ```bash
12
- echo "deb http://deb.theforeman.org/ squeeze stable" > /etc/apt/sources.list.d/foreman.list
13
- ```
14
-
15
- or nightly
14
+ ##### Ubuntu Focal (20.04) with Foreman 3.10
16
15
 
17
16
  ```bash
18
- echo "deb http://deb.theforeman.org/ squeeze nightly" > /etc/apt/sources.list.d/foreman.list
17
+ mkdir -p /etc/apt/keyrings
18
+ wget -qO- https://deb.theforeman.org/foreman.asc > /etc/apt/keyrings/foreman.asc
19
+ echo "deb [signed-by=/etc/apt/keyrings/foreman.asc] http://deb.theforeman.org/ focal 3.10" > /etc/apt/sources.list.d/foreman.list
19
20
  ```
20
21
 
21
- and update the keys
22
+ ##### Debian Bullseye (11) with Foreman nightly
22
23
 
23
24
  ```bash
24
- wget -q https://deb.theforeman.org/foreman.asc -O- | apt-key add -
25
+ mkdir -p /etc/apt/keyrings
26
+ wget -qO- https://deb.theforeman.org/foreman.asc > /etc/apt/keyrings/foreman.asc
27
+ echo "deb [signed-by=/etc/apt/keyrings/foreman.asc] http://deb.theforeman.org/ bullseye nightly" > /etc/apt/sources.list.d/foreman.list
25
28
  ```
26
29
 
27
30
  #### Step 2: install hammer core
@@ -46,3 +49,4 @@ $ apt-get install ruby-hammer-cli-katello
46
49
  ```
47
50
 
48
51
  To install any other hammer plugin just make sure the appropriate gem is installed and follow with the [configuration](installation.md#configuration).
52
+
data/doc/release_notes.md CHANGED
@@ -1,5 +1,15 @@
1
1
  Release notes
2
2
  =============
3
+ ### 3.13.0 (2024-11-08)
4
+ * Bump to 3.13.0-develop
5
+
6
+ ### 3.12.0 (2024-08-14)
7
+ * Log module loading warning to stderr ([PR #385](https://github.com/theforeman/hammer-cli/pull/385))
8
+ * Make clear_cache safe if no completion file is set ([PR #386](https://github.com/theforeman/hammer-cli/pull/386))
9
+ * Define correct timezone behavior in unittest, [#37579](http://projects.theforeman.org/issues/37579)
10
+ * Update deb install instructions ([PR #383](https://github.com/theforeman/hammer-cli/pull/383))
11
+ * Bump to 3.12.0-develop
12
+
3
13
  ### 3.11.0 (2024-05-22)
4
14
  * Bump to 3.11.0-develop
5
15
 
@@ -54,7 +54,7 @@ module HammerCLI
54
54
  require_module(name)
55
55
  rescue Exception => e
56
56
  logger.error "Error while loading module #{name}."
57
- puts _("Warning: An error occured while loading module %s.") % name
57
+ $stderr.puts _("Warning: An error occurred while loading module %s.") % name
58
58
  # with ModuleLoadingError we assume the error is already logged by the issuer
59
59
  logger.error e unless e.is_a?(HammerCLI::ModuleLoadingError)
60
60
  raise e
@@ -55,8 +55,9 @@ module HammerCLI
55
55
  end
56
56
 
57
57
  def self.clear_cache
58
- cache_file = File.expand_path(HammerCLI::Settings.get(:completion_cache_file))
59
- File.delete(cache_file) if File.exist?(cache_file)
58
+ if (completion_file = HammerCLI::Settings.get(:completion_cache_file))
59
+ FileUtils.rm_f(File.expand_path(completion_file))
60
+ end
60
61
  end
61
62
 
62
63
  def self.interactive?
@@ -1,5 +1,5 @@
1
1
  module HammerCLI
2
2
  def self.version
3
- @version ||= Gem::Version.new "3.11.0"
3
+ @version ||= Gem::Version.new "3.13.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
data/man/hammer.1.gz CHANGED
Binary file
@@ -128,26 +128,25 @@ describe HammerCLI::Modules do
128
128
  before :each do
129
129
  HammerCLI::Modules.stubs(:require_module).raises(RuntimeError)
130
130
  @error_msg = "ERROR Modules : Error while loading module hammer_cli_tom."
131
- @warning_msg = "Warning: An error occured while loading module hammer_cli_tom."
131
+ @warning_msg = "Warning: An error occurred while loading module hammer_cli_tom."
132
132
  end
133
133
 
134
134
  it "must log an error if the load! fails" do
135
- out, _ = capture_io do
135
+ assert_output("", "#{@warning_msg}\n") do
136
136
  assert_raises(RuntimeError) { HammerCLI::Modules.load!('hammer_cli_tom') }
137
137
  end
138
- _(out).must_equal "#{@warning_msg}\n"
139
138
  _(@log_output.readline.strip).must_equal @error_msg
140
139
  end
141
140
 
142
141
  it "must log an error if the load fails" do
143
- assert_output("#{@warning_msg}\n", "") do
142
+ assert_output("", "#{@warning_msg}\n") do
144
143
  HammerCLI::Modules.load("hammer_cli_tom")
145
144
  end
146
145
  _(@log_output.readline.strip).must_equal @error_msg
147
146
  end
148
147
 
149
148
  it "must return false when load fails" do
150
- assert_output("#{@warning_msg}\n", "") do
149
+ assert_output("", "#{@warning_msg}\n") do
151
150
  _(HammerCLI::Modules.load("hammer_cli_tom")).must_equal false
152
151
  end
153
152
  end
@@ -416,6 +416,16 @@ describe HammerCLI::Options::Normalizers do
416
416
 
417
417
  end
418
418
 
419
+ def mock_env(partial_env_hash)
420
+ old_env = ENV.to_hash
421
+ ENV.update partial_env_hash
422
+ begin
423
+ yield
424
+ ensure
425
+ ENV.replace old_env
426
+ end
427
+ end
428
+
419
429
  describe 'datetime' do
420
430
 
421
431
  let(:formatter) { HammerCLI::Options::Normalizers::DateTime.new }
@@ -429,15 +439,45 @@ describe HammerCLI::Options::Normalizers do
429
439
  end
430
440
 
431
441
  it "should accept and parse iso8601" do
432
- _(formatter.format("1986-01-01T08:30:20")).must_equal("1986-01-01T08:30:20+00:00")
442
+ mock_env("TZ" => "UTC") do
443
+ _(formatter.format("1986-01-01T08:30:20")).must_equal("1986-01-01T08:30:20+00:00")
444
+ end
433
445
  end
434
446
 
435
447
  it "should accept and parse YYYY-MM-DD HH:MM:SS" do
436
- _(formatter.format("1986-01-01 08:30:20")).must_equal("1986-01-01T08:30:20+00:00")
448
+ mock_env("TZ" => "UTC") do
449
+ _(formatter.format("1986-01-01 08:30:20")).must_equal("1986-01-01T08:30:20+00:00")
450
+ end
437
451
  end
438
452
 
439
453
  it "should accept and parse YYYY/MM/DD HH:MM:SS" do
440
- _(formatter.format("1986/01/01 08:30:20")).must_equal("1986-01-01T08:30:20+00:00")
454
+ mock_env("TZ" => "UTC") do
455
+ _(formatter.format("1986/01/01 08:30:20")).must_equal("1986-01-01T08:30:20+00:00")
456
+ end
457
+ end
458
+
459
+ it "should parse iso8601 compliant timezones" do
460
+ mock_env("TZ" => "UTC") do
461
+ _(formatter.format("1986-01-01 08:30:20 +04:00")).must_equal("1986-01-01T08:30:20+04:00")
462
+ end
463
+ end
464
+
465
+ it "should not parse non iso8601 formatted timezones" do
466
+ mock_env("TZ" => "Asia/Tokyo") do
467
+ _(formatter.format("1986-01-01 08:30:20 foo")).must_equal("1986-01-01T08:30:20+09:00")
468
+ end
469
+ end
470
+
471
+ it "should use system provided timezone" do
472
+ mock_env("TZ" => "Asia/Tokyo") do
473
+ _(formatter.format("1986-01-01 08:30:20")).must_equal("1986-01-01T08:30:20+09:00")
474
+ end
475
+ end
476
+
477
+ it "should overwrite default timezone" do
478
+ mock_env("TZ" => "Asia/Tokyo") do
479
+ _(formatter.format("1986-01-01 08:30:20 +04:00")).must_equal("1986-01-01T08:30:20+04:00")
480
+ end
441
481
  end
442
482
 
443
483
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.0
4
+ version: 3.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Bačovský
8
8
  - Tomáš Strachota
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-22 00:00:00.000000000 Z
12
+ date: 2024-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
@@ -131,7 +131,7 @@ dependencies:
131
131
  version: 0.6.0
132
132
  description: 'Hammer cli provides universal extendable CLI interface for ruby apps
133
133
 
134
- '
134
+ '
135
135
  email: mbacovsk@redhat.com
136
136
  executables:
137
137
  - hammer
@@ -369,7 +369,7 @@ homepage: https://github.com/theforeman/hammer-cli
369
369
  licenses:
370
370
  - GPL-3.0
371
371
  metadata: {}
372
- post_install_message:
372
+ post_install_message:
373
373
  rdoc_options: []
374
374
  require_paths:
375
375
  - lib
@@ -385,7 +385,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
385
385
  version: '0'
386
386
  requirements: []
387
387
  rubygems_version: 3.2.33
388
- signing_key:
388
+ signing_key:
389
389
  specification_version: 4
390
390
  summary: Universal command-line interface
391
391
  test_files: