hammer_cli_foreman_bootdisk 0.4.0 → 0.4.1

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: a6a7c3f5abe5275511c75954d6aaa5979dd143fc11fd3b9cae08c7513cf37f41
4
- data.tar.gz: 9be6c7b102a5e1bd0974c8ab76fb383f12fdc7d948be9f3146fff7bb2ad6da9a
3
+ metadata.gz: eeae46c6448b539f6b3abd2816e8e2dbc9defe2386f4dc18adc6c7df3047b845
4
+ data.tar.gz: bf7711c09fe7f4d9a76ddb025026fd9e9cdbca78c0c4288891290e743ccf2c48
5
5
  SHA512:
6
- metadata.gz: 27dfa33a66f56e5493a2127c2b553a635bcf91137c833998f96b68d44f1daba15472664091340b23c80074634da744849d03d09e4adba0604396aecc0fa4bd0f
7
- data.tar.gz: 8b78e5216fa350a7040cca19a8981746140f74d164ba9172f8af3f3798509d37269961b7a53150f9fbe6c837cdfd802d40e175fc1b8fe2967df47a6572f2aa13
6
+ metadata.gz: a8b5e9a7ee46a5676a15ac0549f5d0bdabf88ba6a7f137fad56a5999f086eaad46a0253c22b2cc959f6c6404ba95390d95edd8e8b4438411e8c1e04a01fab56a
7
+ data.tar.gz: 033fb715befe76c59caad752c8b70fbd4b1de96bc030e67f22e452e0abecb0ae27422150bdbf6f26499c3419dde1fbfc53408ba3407fcf509b76a82887461c08
@@ -8,29 +8,27 @@ module HammerCLIForemanBootdisk
8
8
  option "--sudo", :flag, _("Use sudo to write to device")
9
9
 
10
10
  def print_data(record)
11
- server_filename = $1 if record.headers[:content_disposition] =~ /filename=["']?([^\s,;"']+)/
11
+ server_filename = ::Regexp.last_match(1) if record.headers[:content_disposition].match?(/filename=["']?([^\s,;"']+)/)
12
12
  file = options[HammerCLI.option_accessor_name('file')] || server_filename || 'bootdisk.iso'
13
- if !options[HammerCLI.option_accessor_name('force')] && File.exist?(file) && !File.file?(file)
14
- raise(HammerCLIForeman::OperationNotSupportedError, _("Destination %s already exists and isn't a regular file, use '--force' if you are sure you wish to write to it") % file)
15
- end
13
+ raise(HammerCLIForeman::OperationNotSupportedError, _("Destination %s already exists and isn't a regular file, use '--force' if you are sure you wish to write to it") % file) if !options[HammerCLI.option_accessor_name('force')] && File.exist?(file) && !File.file?(file)
16
14
 
17
15
  if options[HammerCLI.option_accessor_name('sudo')]
18
16
  temp_file = Tempfile.new('bootdisk')
19
17
  begin
20
- File.open(temp_file, 'w') { |f| f.write(record) }
18
+ File.write(temp_file, record)
21
19
  system('sudo', 'dd', "if=#{temp_file.path}", "of=#{file}", 'bs=1024')
22
20
  ensure
23
21
  temp_file.close
24
22
  temp_file.unlink
25
23
  end
26
24
  else
27
- File.open(file, 'w') { |f| f.write(record) }
25
+ File.write(file, record)
28
26
  end
29
- print_message (success_message % file) if success_message
27
+ print_message(success_message % file) if success_message
30
28
  end
31
29
 
32
30
  def request_options
33
- {:response => :raw}
31
+ { response: :raw }
34
32
  end
35
33
  end
36
34
  end
@@ -2,9 +2,7 @@ require 'hammer_cli/i18n'
2
2
 
3
3
  module HammerCLIForemanBootdisk
4
4
  module I18n
5
-
6
5
  class LocaleDomain < HammerCLI::I18n::LocaleDomain
7
-
8
6
  def translated_files
9
7
  Dir.glob(File.join(File.dirname(__FILE__), '../**/*.rb'))
10
8
  end
@@ -17,7 +15,6 @@ module HammerCLIForemanBootdisk
17
15
  'hammer_cli_foreman_bootdisk'
18
16
  end
19
17
  end
20
-
21
18
  end
22
19
  end
23
20
 
@@ -1,5 +1,5 @@
1
1
  module HammerCLIForemanBootdisk
2
2
  def self.version
3
- @version ||= Gem::Version.new '0.4.0'
3
+ @version ||= Gem::Version.new '0.4.1'
4
4
  end
5
5
  end
@@ -10,11 +10,10 @@ module HammerCLIForemanBootdisk
10
10
  require 'hammer_cli_foreman_bootdisk/version'
11
11
 
12
12
  HammerCLI::MainCommand.lazy_subcommand('bootdisk', _("Download boot disks"),
13
- 'HammerCLIForemanBootdisk::Bootdisk', 'hammer_cli_foreman_bootdisk/bootdisk'
14
- )
15
- rescue => e
16
- handler = HammerCLIForeman::ExceptionHandler.new(:context => {}, :adapter => :base)
13
+ 'HammerCLIForemanBootdisk::Bootdisk', 'hammer_cli_foreman_bootdisk/bootdisk')
14
+ rescue StandardError => e
15
+ handler = HammerCLIForeman::ExceptionHandler.new(context: {}, adapter: :base)
17
16
  handler.handle_exception(e)
18
- raise HammerCLI::ModuleLoadingError.new(e)
17
+ raise HammerCLI::ModuleLoadingError, e
19
18
  end
20
19
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman_bootdisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-07 00:00:00.000000000 Z
11
+ date: 2024-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hammer_cli_foreman
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.2
19
+ version: '3.10'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.2
26
+ version: '3.10'
27
27
  description: Foreman boot disk commands for Hammer CLI
28
28
  email: dcleal@redhat.com
29
29
  executables: []
@@ -77,7 +77,7 @@ homepage: https://github.com/theforeman/hammer_cli_foreman_bootdisk
77
77
  licenses:
78
78
  - GPL-3.0+
79
79
  metadata: {}
80
- post_install_message:
80
+ post_install_message:
81
81
  rdoc_options: []
82
82
  require_paths:
83
83
  - lib
@@ -85,15 +85,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: '0'
88
+ version: '2.7'
89
+ - - "<"
90
+ - !ruby/object:Gem::Version
91
+ version: '4'
89
92
  required_rubygems_version: !ruby/object:Gem::Requirement
90
93
  requirements:
91
94
  - - ">="
92
95
  - !ruby/object:Gem::Version
93
96
  version: '0'
94
97
  requirements: []
95
- rubygems_version: 3.2.33
96
- signing_key:
98
+ rubygems_version: 3.1.6
99
+ signing_key:
97
100
  specification_version: 4
98
101
  summary: Foreman boot disk commands for Hammer
99
102
  test_files: []