inspec-core 4.24.8 → 4.26.4
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/Gemfile +9 -14
- data/inspec-core.gemspec +9 -8
- data/lib/bundles/inspec-supermarket/api.rb +2 -2
- data/lib/bundles/inspec-supermarket/target.rb +1 -1
- data/lib/inspec/archive/tar.rb +1 -1
- data/lib/inspec/archive/zip.rb +3 -3
- data/lib/inspec/base_cli.rb +4 -2
- data/lib/inspec/cached_fetcher.rb +1 -1
- data/lib/inspec/cli.rb +1 -1
- data/lib/inspec/config.rb +19 -6
- data/lib/inspec/dependencies/cache.rb +1 -1
- data/lib/inspec/env_printer.rb +2 -2
- data/lib/inspec/fetcher/git.rb +3 -3
- data/lib/inspec/fetcher/local.rb +1 -1
- data/lib/inspec/fetcher/url.rb +4 -4
- data/lib/inspec/file_provider.rb +4 -4
- data/lib/inspec/input.rb +3 -0
- data/lib/inspec/input_registry.rb +5 -3
- data/lib/inspec/metadata.rb +1 -1
- data/lib/inspec/plugin/v1/plugins.rb +2 -2
- data/lib/inspec/plugin/v2.rb +5 -0
- data/lib/inspec/plugin/v2/config_file.rb +1 -1
- data/lib/inspec/plugin/v2/filter.rb +2 -2
- data/lib/inspec/plugin/v2/installer.rb +5 -5
- data/lib/inspec/plugin/v2/loader.rb +1 -1
- data/lib/inspec/plugin/v2/registry.rb +2 -2
- data/lib/inspec/profile.rb +3 -3
- data/lib/inspec/profile_context.rb +1 -1
- data/lib/inspec/reporters/automate.rb +2 -2
- data/lib/inspec/reporters/json.rb +1 -1
- data/lib/inspec/reporters/json_automate.rb +1 -1
- data/lib/inspec/resources.rb +5 -5
- data/lib/inspec/resources/apt.rb +1 -1
- data/lib/inspec/resources/auditd.rb +1 -1
- data/lib/inspec/resources/csv.rb +1 -1
- data/lib/inspec/resources/dh_params.rb +1 -1
- data/lib/inspec/resources/file.rb +1 -1
- data/lib/inspec/resources/http.rb +1 -1
- data/lib/inspec/resources/iis_website.rb +1 -1
- data/lib/inspec/resources/interfaces.rb +1 -1
- data/lib/inspec/resources/json.rb +2 -2
- data/lib/inspec/resources/key_rsa.rb +1 -1
- data/lib/inspec/resources/mssql_session.rb +5 -1
- data/lib/inspec/resources/mysql_session.rb +1 -1
- data/lib/inspec/resources/nginx.rb +1 -1
- data/lib/inspec/resources/nginx_conf.rb +40 -1
- data/lib/inspec/resources/npm.rb +1 -1
- data/lib/inspec/resources/oracledb_session.rb +2 -2
- data/lib/inspec/resources/parse_config.rb +5 -2
- data/lib/inspec/resources/port.rb +1 -1
- data/lib/inspec/resources/postgres_session.rb +1 -1
- data/lib/inspec/resources/ppa.rb +1 -1
- data/lib/inspec/resources/processes.rb +1 -1
- data/lib/inspec/resources/rabbitmq_conf.rb +1 -1
- data/lib/inspec/resources/registry_key.rb +1 -1
- data/lib/inspec/resources/ssh_config.rb +24 -2
- data/lib/inspec/resources/sshd_config.rb +1 -1
- data/lib/inspec/resources/ssl.rb +2 -2
- data/lib/inspec/resources/toml.rb +1 -1
- data/lib/inspec/resources/vbscript.rb +1 -1
- data/lib/inspec/resources/windows_registry_key.rb +1 -1
- data/lib/inspec/resources/wmi.rb +1 -1
- data/lib/inspec/resources/x509_certificate.rb +1 -1
- data/lib/inspec/resources/xml.rb +1 -1
- data/lib/inspec/runner.rb +2 -2
- data/lib/inspec/schema.rb +1 -1
- data/lib/inspec/schema/output_schema.rb +1 -1
- data/lib/inspec/schema/primitives.rb +1 -1
- data/lib/inspec/shell_detector.rb +2 -2
- data/lib/inspec/utils/command_wrapper.rb +1 -1
- data/lib/inspec/utils/deprecation/config_file.rb +2 -2
- data/lib/inspec/utils/json_log.rb +1 -1
- data/lib/inspec/utils/run_data_filters.rb +7 -5
- data/lib/inspec/utils/telemetry/collector.rb +1 -1
- data/lib/inspec/utils/telemetry/data_series.rb +1 -1
- data/lib/inspec/version.rb +1 -1
- data/lib/plugins/inspec-artifact/lib/inspec-artifact/base.rb +5 -5
- data/lib/plugins/inspec-compliance/README.md +1 -1
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb +3 -3
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/http.rb +2 -2
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/target.rb +2 -2
- data/lib/plugins/inspec-habitat/lib/inspec-habitat/profile.rb +3 -3
- data/lib/plugins/inspec-init/lib/inspec-init/cli.rb +1 -1
- data/lib/plugins/inspec-init/lib/inspec-init/cli_profile.rb +1 -1
- data/lib/plugins/inspec-init/lib/inspec-init/renderer.rb +2 -2
- data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb +3 -3
- data/lib/plugins/inspec-reporter-html2/lib/inspec-reporter-html2/reporter.rb +1 -1
- data/lib/plugins/inspec-reporter-json-min/lib/inspec-reporter-json-min/reporter.rb +1 -1
- data/lib/plugins/inspec-reporter-junit/lib/inspec-reporter-junit/reporter.rb +1 -1
- data/lib/plugins/shared/core_plugin_test_helper.rb +6 -6
- metadata +63 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d272d9e12d62df3c7913ac77ae8eb39afe94c53ca0bb1b6cb4e51909cfa2169d
|
|
4
|
+
data.tar.gz: c0f4245b7a361e2736827bf4512098640aa58c1f7ec5e02754a72d47a3e91895
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d62a4be7c3c74b09d0fa7d99bb7af2e26b45fcafd9e14d51bd5719d0c1a1c816cf5e133458c07ed3354a3966b6a571cf24a5147a887713671aa8ecca1ac7328d
|
|
7
|
+
data.tar.gz: '006889d328e75a0d339f082e4c17b57474660fd5b3855bbe3100a7b67ae0a0e98f06cef3ec914ff0232779cf76c01e11fa63797451221afe33d3b00624a6b3a6'
|
data/Gemfile
CHANGED
|
@@ -9,13 +9,17 @@ gem "inspec", path: "."
|
|
|
9
9
|
# in it in order to package the executable. Hence the odd backwards dependency.
|
|
10
10
|
gem "inspec-bin", path: "./inspec-bin"
|
|
11
11
|
|
|
12
|
-
gem "ffi", ">= 1.9.14", "!= 1.13.0"
|
|
12
|
+
gem "ffi", ">= 1.9.14", "!= 1.13.0", "!= 1.14.2"
|
|
13
13
|
|
|
14
14
|
if Gem.ruby_version.to_s.start_with?("2.5")
|
|
15
15
|
# 16.7.23 required ruby 2.6+
|
|
16
16
|
gem "chef-utils", "< 16.7.23" # TODO: remove when we drop ruby 2.5
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
# inspec tests depend text output that changed in the 3.10 release
|
|
20
|
+
# but our runtime dep is still 3.9+
|
|
21
|
+
gem "rspec", ">= 3.10"
|
|
22
|
+
|
|
19
23
|
group :omnibus do
|
|
20
24
|
gem "rb-readline"
|
|
21
25
|
gem "appbundler"
|
|
@@ -24,10 +28,10 @@ group :omnibus do
|
|
|
24
28
|
end
|
|
25
29
|
|
|
26
30
|
group :test do
|
|
27
|
-
gem "chefstyle", "~> 1.
|
|
31
|
+
gem "chefstyle", "~> 1.5.7"
|
|
28
32
|
gem "concurrent-ruby", "~> 1.0"
|
|
29
33
|
gem "html-proofer", platforms: :ruby # do not attempt to run proofer on windows
|
|
30
|
-
gem "json_schemer", ">= 0.2.1", "< 0.2.
|
|
34
|
+
gem "json_schemer", ">= 0.2.1", "< 0.2.18"
|
|
31
35
|
gem "m"
|
|
32
36
|
gem "minitest-sprint", "~> 1.0"
|
|
33
37
|
gem "minitest", "~> 5.5"
|
|
@@ -37,19 +41,10 @@ group :test do
|
|
|
37
41
|
gem "pry", "~> 0.10"
|
|
38
42
|
gem "rake", ">= 10"
|
|
39
43
|
gem "ruby-progressbar", "~> 1.8"
|
|
40
|
-
gem "simplecov",
|
|
44
|
+
gem "simplecov", "~> 0.18"
|
|
41
45
|
gem "webmock", "~> 3.0"
|
|
42
46
|
end
|
|
43
47
|
|
|
44
|
-
group :integration do
|
|
45
|
-
gem "berkshelf"
|
|
46
|
-
gem "test-kitchen", ">= 2.8"
|
|
47
|
-
gem "kitchen-vagrant", ">= 1.7"
|
|
48
|
-
gem "kitchen-inspec", ">= 2.0"
|
|
49
|
-
gem "kitchen-dokken", ">= 2.11"
|
|
50
|
-
gem "git"
|
|
51
|
-
end
|
|
52
|
-
|
|
53
48
|
group :deploy do
|
|
54
49
|
gem "inquirer"
|
|
55
|
-
end
|
|
50
|
+
end
|
data/inspec-core.gemspec
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
lib = File.expand_path("
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
require "inspec/version"
|
|
4
4
|
|
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.license = "Apache-2.0"
|
|
14
14
|
spec.require_paths = ["lib"]
|
|
15
15
|
|
|
16
|
-
spec.required_ruby_version = "
|
|
16
|
+
spec.required_ruby_version = ">= 2.5"
|
|
17
17
|
|
|
18
18
|
# the gemfile and gemspec are necessary for appbundler so don't remove it
|
|
19
19
|
spec.files =
|
|
@@ -27,20 +27,21 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
spec.add_dependency "license-acceptance", ">= 0.2.13", "< 3.0"
|
|
28
28
|
spec.add_dependency "thor", ">= 0.20", "< 2.0"
|
|
29
29
|
spec.add_dependency "method_source", ">= 0.8", "< 2.0"
|
|
30
|
-
spec.add_dependency "rubyzip", "
|
|
31
|
-
spec.add_dependency "rspec", "
|
|
30
|
+
spec.add_dependency "rubyzip", ">= 1.2.2", "< 3.0"
|
|
31
|
+
spec.add_dependency "rspec", ">= 3.9", "< 3.11"
|
|
32
32
|
spec.add_dependency "rspec-its", "~> 1.2"
|
|
33
33
|
spec.add_dependency "pry", "~> 0.13"
|
|
34
|
-
spec.add_dependency "hashie", "
|
|
34
|
+
spec.add_dependency "hashie", ">= 3.4", "< 5.0"
|
|
35
35
|
spec.add_dependency "mixlib-log", "~> 3.0"
|
|
36
36
|
spec.add_dependency "sslshake", "~> 1.2"
|
|
37
37
|
spec.add_dependency "parallel", "~> 1.9"
|
|
38
|
-
spec.add_dependency "faraday", ">= 0.9.0", "< 1.
|
|
38
|
+
spec.add_dependency "faraday", ">= 0.9.0", "< 1.4"
|
|
39
|
+
spec.add_dependency "faraday_middleware", "~> 1.0"
|
|
39
40
|
spec.add_dependency "tty-table", "~> 0.10"
|
|
40
41
|
spec.add_dependency "tty-prompt", "~> 0.17"
|
|
41
|
-
spec.add_dependency "tomlrb", "
|
|
42
|
+
spec.add_dependency "tomlrb", ">= 1.2", "< 2.1"
|
|
42
43
|
spec.add_dependency "addressable", "~> 2.4"
|
|
43
|
-
spec.add_dependency "parslet", "
|
|
44
|
+
spec.add_dependency "parslet", ">= 1.5", "< 2.0" # Pinned < 2.0, see #5389
|
|
44
45
|
spec.add_dependency "semverse", "~> 3.0"
|
|
45
46
|
spec.add_dependency "multipart-post", "~> 2.0"
|
|
46
47
|
|
data/lib/inspec/archive/tar.rb
CHANGED
data/lib/inspec/archive/zip.rb
CHANGED
data/lib/inspec/base_cli.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require "thor"
|
|
1
|
+
require "thor" # rubocop:disable Chef/Ruby/UnlessDefinedRequire
|
|
2
2
|
require "inspec/log"
|
|
3
3
|
require "inspec/ui"
|
|
4
4
|
require "inspec/config"
|
|
@@ -118,6 +118,8 @@ module Inspec
|
|
|
118
118
|
desc: "Disable SSL verification on select targets"
|
|
119
119
|
option :target_id, type: :string,
|
|
120
120
|
desc: "Provide a ID which will be included on reports"
|
|
121
|
+
option :winrm_shell_type, type: :string, default: "powershell",
|
|
122
|
+
desc: "Specify a shell type for winrm (eg. 'elevated' or 'powershell')"
|
|
121
123
|
end
|
|
122
124
|
|
|
123
125
|
def self.profile_options
|
|
@@ -136,7 +138,7 @@ module Inspec
|
|
|
136
138
|
banner: "one two:/output/file/path",
|
|
137
139
|
desc: "Enable one or more output reporters: cli, documentation, html, progress, json, json-min, json-rspec, junit, yaml"
|
|
138
140
|
option :reporter_message_truncation, type: :string,
|
|
139
|
-
desc: "Number of characters to truncate failure messages in report data to (default: no truncation)"
|
|
141
|
+
desc: "Number of characters to truncate failure messages and code_desc in report data to (default: no truncation)"
|
|
140
142
|
option :reporter_backtrace_inclusion, type: :boolean,
|
|
141
143
|
desc: "Include a code backtrace in report data (default: true)"
|
|
142
144
|
option :input, type: :array, banner: "name1=value1 name2=value2",
|
data/lib/inspec/cli.rb
CHANGED
data/lib/inspec/config.rb
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Represents InSpec configuration. Merges defaults, config file options,
|
|
2
2
|
# and CLI arguments.
|
|
3
3
|
|
|
4
|
-
require "pp"
|
|
5
|
-
require "stringio"
|
|
6
|
-
require "forwardable"
|
|
7
|
-
require "thor"
|
|
8
|
-
require "base64"
|
|
4
|
+
require "pp" unless defined?(PP)
|
|
5
|
+
require "stringio" unless defined?(StringIO)
|
|
6
|
+
require "forwardable" unless defined?(Forwardable)
|
|
7
|
+
require "thor" unless defined?(Thor)
|
|
8
|
+
require "base64" unless defined?(Base64)
|
|
9
9
|
require "inspec/plugin/v2/filter"
|
|
10
10
|
|
|
11
11
|
module Inspec
|
|
@@ -128,12 +128,25 @@ module Inspec
|
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
#-----------------------------------------------------------------------#
|
|
131
|
-
#
|
|
131
|
+
# Handling Plugin Data
|
|
132
132
|
#-----------------------------------------------------------------------#
|
|
133
133
|
def fetch_plugin_config(plugin_name)
|
|
134
134
|
Thor::CoreExt::HashWithIndifferentAccess.new(@plugin_cfg[plugin_name] || {})
|
|
135
135
|
end
|
|
136
136
|
|
|
137
|
+
def set_plugin_config(plugin_name, plugin_config)
|
|
138
|
+
plugin_name = plugin_name.to_s unless plugin_name.is_a? String
|
|
139
|
+
|
|
140
|
+
@plugin_cfg[plugin_name] = plugin_config
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def merge_plugin_config(plugin_name, additional_plugin_config)
|
|
144
|
+
plugin_name = plugin_name.to_s unless plugin_name.is_a? String
|
|
145
|
+
|
|
146
|
+
@plugin_cfg[plugin_name] = {} if @plugin_cfg[plugin_name].nil?
|
|
147
|
+
@plugin_cfg[plugin_name].merge!(additional_plugin_config)
|
|
148
|
+
end
|
|
149
|
+
|
|
137
150
|
# clear the cached config
|
|
138
151
|
def self.__reset
|
|
139
152
|
@cached_config = nil
|
data/lib/inspec/env_printer.rb
CHANGED
data/lib/inspec/fetcher/git.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
require "tmpdir"
|
|
2
|
-
require "fileutils"
|
|
3
|
-
require "mixlib/shellout"
|
|
1
|
+
require "tmpdir" unless defined?(Dir.mktmpdir)
|
|
2
|
+
require "fileutils" unless defined?(FileUtils)
|
|
3
|
+
require "mixlib/shellout" unless defined?(Mixlib::ShellOut)
|
|
4
4
|
require "inspec/log"
|
|
5
5
|
|
|
6
6
|
module Inspec::Fetcher
|
data/lib/inspec/fetcher/local.rb
CHANGED
data/lib/inspec/fetcher/url.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
require "uri"
|
|
2
|
-
require "openssl"
|
|
3
|
-
require "tempfile"
|
|
4
|
-
require "open-uri"
|
|
1
|
+
require "uri" unless defined?(URI)
|
|
2
|
+
require "openssl" unless defined?(OpenSSL)
|
|
3
|
+
require "tempfile" unless defined?(Tempfile)
|
|
4
|
+
require "open-uri" unless defined?(OpenURI)
|
|
5
5
|
|
|
6
6
|
module Inspec::Fetcher
|
|
7
7
|
class Url < Inspec.fetcher(1)
|
data/lib/inspec/file_provider.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
require "rubygems/package"
|
|
2
|
-
require "pathname"
|
|
3
|
-
require "zlib"
|
|
4
|
-
require "zip"
|
|
1
|
+
require "rubygems/package" unless defined?(Gem::Package)
|
|
2
|
+
require "pathname" unless defined?(Pathname)
|
|
3
|
+
require "zlib" unless defined?(Zlib)
|
|
4
|
+
require "zip" unless defined?(Zip)
|
|
5
5
|
|
|
6
6
|
module Inspec
|
|
7
7
|
class FileProvider
|
data/lib/inspec/input.rb
CHANGED
|
@@ -14,14 +14,17 @@ module Inspec
|
|
|
14
14
|
class Input
|
|
15
15
|
|
|
16
16
|
class Error < Inspec::Error; end
|
|
17
|
+
|
|
17
18
|
class ValidationError < Error
|
|
18
19
|
attr_accessor :input_name
|
|
19
20
|
attr_accessor :input_value
|
|
20
21
|
attr_accessor :input_type
|
|
21
22
|
end
|
|
23
|
+
|
|
22
24
|
class TypeError < Error
|
|
23
25
|
attr_accessor :input_type
|
|
24
26
|
end
|
|
27
|
+
|
|
25
28
|
class RequiredError < Error
|
|
26
29
|
attr_accessor :input_name
|
|
27
30
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require "forwardable"
|
|
2
|
-
require "singleton"
|
|
1
|
+
require "forwardable" unless defined?(Forwardable)
|
|
2
|
+
require "singleton" unless defined?(Singleton)
|
|
3
3
|
require "inspec/input"
|
|
4
4
|
require "inspec/secrets"
|
|
5
5
|
require "inspec/exceptions"
|
|
@@ -14,9 +14,11 @@ module Inspec
|
|
|
14
14
|
extend Forwardable
|
|
15
15
|
|
|
16
16
|
class Error < Inspec::Error; end
|
|
17
|
+
|
|
17
18
|
class ProfileLookupError < Error
|
|
18
19
|
attr_accessor :profile_name
|
|
19
20
|
end
|
|
21
|
+
|
|
20
22
|
class InputLookupError < Error
|
|
21
23
|
attr_accessor :profile_name
|
|
22
24
|
attr_accessor :input_name
|
|
@@ -199,7 +201,7 @@ module Inspec
|
|
|
199
201
|
value = YAML.load(value)
|
|
200
202
|
rescue Psych::SyntaxError => yaml_error
|
|
201
203
|
# It could be that we just tried to run JSON through the YAML parser.
|
|
202
|
-
require "json"
|
|
204
|
+
require "json" unless defined?(JSON)
|
|
203
205
|
begin
|
|
204
206
|
value = JSON.parse(value)
|
|
205
207
|
rescue JSON::ParserError => json_error
|
data/lib/inspec/metadata.rb
CHANGED
|
@@ -216,7 +216,7 @@ module Inspec
|
|
|
216
216
|
end
|
|
217
217
|
|
|
218
218
|
def self.from_yaml(ref, content, profile_id, logger = nil)
|
|
219
|
-
require "erb"
|
|
219
|
+
require "erb" unless defined?(Erb)
|
|
220
220
|
res = Metadata.new(ref, logger)
|
|
221
221
|
res.params = YAML.load(ERB.new(content).result)
|
|
222
222
|
res.content = content
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require "forwardable"
|
|
1
|
+
require "forwardable" unless defined?(Forwardable)
|
|
2
2
|
|
|
3
3
|
module Inspec
|
|
4
4
|
# Resource Plugins
|
|
@@ -36,7 +36,7 @@ module Inspec
|
|
|
36
36
|
.flatten
|
|
37
37
|
|
|
38
38
|
# load bundled plugins
|
|
39
|
-
bundled_dir =
|
|
39
|
+
bundled_dir = __dir__
|
|
40
40
|
@paths += Dir[File.join(bundled_dir, "..", "bundles", "inspec-*.rb")].flatten
|
|
41
41
|
|
|
42
42
|
# map paths to names
|
data/lib/inspec/plugin/v2.rb
CHANGED
|
@@ -6,17 +6,22 @@ module Inspec
|
|
|
6
6
|
class Exception < Inspec::Error; end
|
|
7
7
|
class ConfigError < Inspec::Plugin::V2::Exception; end
|
|
8
8
|
class LoadError < Inspec::Plugin::V2::Exception; end
|
|
9
|
+
|
|
9
10
|
class GemActionError < Inspec::Plugin::V2::Exception
|
|
10
11
|
attr_accessor :plugin_name
|
|
11
12
|
attr_accessor :version
|
|
12
13
|
end
|
|
14
|
+
|
|
13
15
|
class InstallError < Inspec::Plugin::V2::GemActionError; end
|
|
16
|
+
|
|
14
17
|
class PluginExcludedError < Inspec::Plugin::V2::InstallError
|
|
15
18
|
attr_accessor :details
|
|
16
19
|
end
|
|
20
|
+
|
|
17
21
|
class UpdateError < Inspec::Plugin::V2::GemActionError
|
|
18
22
|
attr_accessor :from_version, :to_version
|
|
19
23
|
end
|
|
24
|
+
|
|
20
25
|
class UnInstallError < Inspec::Plugin::V2::GemActionError; end
|
|
21
26
|
class SearchError < Inspec::Plugin::V2::GemActionError; end
|
|
22
27
|
end
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# This file is not required by default.
|
|
2
2
|
|
|
3
|
-
require "singleton"
|
|
4
|
-
require "forwardable"
|
|
5
|
-
require "fileutils"
|
|
6
|
-
require "uri"
|
|
3
|
+
require "singleton" unless defined?(Singleton)
|
|
4
|
+
require "forwardable" unless defined?(Forwardable)
|
|
5
|
+
require "fileutils" unless defined?(FileUtils)
|
|
6
|
+
require "uri" unless defined?(URI)
|
|
7
7
|
|
|
8
8
|
# Gem extensions for doing unusual things - not loaded by Gem default
|
|
9
|
-
require "rubygems/package"
|
|
9
|
+
require "rubygems/package" unless defined?(Gem::Package)
|
|
10
10
|
require "rubygems/name_tuple"
|
|
11
11
|
require "rubygems/uninstaller"
|
|
12
12
|
require "rubygems/remote_fetcher"
|
|
@@ -130,7 +130,7 @@ module Inspec::Plugin::V2
|
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
def self.plugin_gem_path
|
|
133
|
-
require "rbconfig"
|
|
133
|
+
require "rbconfig" unless defined?(RbConfig)
|
|
134
134
|
ruby_abi_version = RbConfig::CONFIG["ruby_version"]
|
|
135
135
|
# TODO: why are we installing under the api directory for plugins?
|
|
136
136
|
base_dir = Inspec.config_dir
|
data/lib/inspec/profile.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Copyright 2015 Dominik Richter
|
|
2
2
|
|
|
3
|
-
require "forwardable"
|
|
4
|
-
require "openssl"
|
|
5
|
-
require "pathname"
|
|
3
|
+
require "forwardable" unless defined?(Forwardable)
|
|
4
|
+
require "openssl" unless defined?(OpenSSL)
|
|
5
|
+
require "pathname" unless defined?(Pathname)
|
|
6
6
|
require "inspec/input_registry"
|
|
7
7
|
require "inspec/cached_fetcher" # TODO: split or rename
|
|
8
8
|
require "inspec/source_reader"
|