foreman_scap_client 0.5.2 → 0.5.3

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: 825ce2dba8229d5ed21451e89686f8b5d496d11a7b8520cc69e5e0b46be0f08c
4
- data.tar.gz: fdde4a6929aaf4318acec62faf415121977f03cdb5a0034a09195520527ed83e
3
+ metadata.gz: cdea1319b49e7e730c03aad7fda81efe05ca03b40fbc4e935ef8be35a86a1dd8
4
+ data.tar.gz: 86281c1e0396bfde58cbff6b2f607e2d6bc2bda7d2428ae44180fc3adb20f4ee
5
5
  SHA512:
6
- metadata.gz: '086cbe81e50cbacdc9955ee9f5e65354fbd34e4a2c05937dbf333e37d890dc236508ca6dc6bd49d99d268178a7090a967c62e1debbfceed198135d09d6b35b56'
7
- data.tar.gz: dfafef66458765b284a1b5ff37ec8ce94a083f881adecafb6bbc0b489f7686a17a36b648f1efaf29c4bc4b899f65c7e1f7346e218e2b6f706aa96c51218b5d55
6
+ metadata.gz: e0a30cc7e90e5e0b5c024a2ba035d8a8534b6fc8ffc01a81f732aa987e46fd97af5878da3f444ac115905902a74d588757e6f0b000972e5d9322b84045410ddb
7
+ data.tar.gz: 88b379a4e4b3f1aee52e6c4d2d2b85c38646b2170874132fd0a375ce76a87e34b82b23b2b38f477fb0c6af4ae067114e52209e147ecc4950c3c5721fc0a08151
@@ -1,4 +1,3 @@
1
- require 'rubygems' if RUBY_VERSION.start_with? '1.8'
2
1
  require 'yaml'
3
2
  require 'tmpdir'
4
3
  require 'net/http'
@@ -71,17 +70,13 @@ module ForemanScapClient
71
70
  puts "DEBUG: running: " + scan_command
72
71
  puts "with ENV vars: #{scan_command_env_vars}" unless scan_command_env_vars.empty?
73
72
 
74
- if RUBY_VERSION.start_with? '1.8'
75
- legacy_run_scan
76
- else
77
- run_scan
78
- end
73
+ run_scan
79
74
  end
80
75
 
81
76
  def run_scan
82
77
  stdout_str, error_str, result = Open3.capture3(scan_command_env_vars, scan_command)
83
78
  if result.success? || result.exitstatus == 2
84
- puts error_str.scrub("?").split("\n").select { |item| item.start_with?('WARNING:') || item.start_with?('Downloading') }.join("\n")
79
+ error_str.each_line { |item| print item if item.start_with?('WARNING:') || item.start_with?('Downloading') }
85
80
  @report = results_path
86
81
  else
87
82
  puts 'Scan failed'
@@ -91,19 +86,6 @@ module ForemanScapClient
91
86
  end
92
87
  end
93
88
 
94
- def legacy_run_scan
95
- warn_proxy_not_supported
96
- result = `#{scan_command}`
97
-
98
- if $?.success? || $?.exitstatus == 2
99
- @report = results_path
100
- else
101
- puts 'Scan failed'
102
- puts result
103
- exit(2)
104
- end
105
- end
106
-
107
89
  def scan_command_env_vars
108
90
  if http_proxy_uri
109
91
  {
@@ -130,10 +112,6 @@ module ForemanScapClient
130
112
  "#{results_path}.bz2"
131
113
  end
132
114
 
133
- def warn_proxy_not_supported
134
- puts 'Configuration for HTTP(S) proxy found but not supported for ruby 1.8' if http_proxy_uri
135
- end
136
-
137
115
  def bzip_command
138
116
  "/usr/bin/env bzip2 #{results_path}"
139
117
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanScapClient
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_scap_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-12-15 00:00:00.000000000 Z
13
+ date: 2024-05-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler