inspec 4.6.4 → 4.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/lib/inspec/base_cli.rb +27 -0
- data/lib/inspec/cli.rb +0 -20
- data/lib/inspec/version.rb +1 -1
- 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: 2f5b73cc4ec9d1e11867bb9e7d0cc7eeb1007ef4b10f56485d817bd56811d662
|
4
|
+
data.tar.gz: 12b23768ff808f509c88b7ce0558a73e04a328d8d9a6e37da6b6ac74208e891e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39a2cdcd01416f61101a2436ce3a01bc754cd3212010d348a094b14b1ac8a7b07e9dbc4b2da1795c5b75ea628e760c4cf5ddb84a446531531bdad78f3d24f183
|
7
|
+
data.tar.gz: 25b1c69962503c6567ec46f8122edddc614bdfa16b475b6a64ad4c488e7e115830aeb59a215826cfb6b9ac1b67b9b9a6c6c1de395c7d0dce3689bc4ae88121b9
|
data/Gemfile
CHANGED
data/lib/inspec/base_cli.rb
CHANGED
@@ -2,6 +2,7 @@ require "thor"
|
|
2
2
|
require "inspec/log"
|
3
3
|
require "inspec/ui"
|
4
4
|
require "inspec/config"
|
5
|
+
require "inspec/dist"
|
5
6
|
require "inspec/utils/deprecation/global_method"
|
6
7
|
|
7
8
|
# Allow end of options during array type parsing
|
@@ -24,6 +25,32 @@ module Inspec
|
|
24
25
|
attr_accessor :inspec_cli_command
|
25
26
|
end
|
26
27
|
|
28
|
+
def self.start(given_args = ARGV, config = {})
|
29
|
+
check_license! if config[:enforce_license] || config[:enforce_license].nil?
|
30
|
+
|
31
|
+
super(given_args, config)
|
32
|
+
end
|
33
|
+
|
34
|
+
# EULA acceptance
|
35
|
+
def self.check_license!
|
36
|
+
allowed_commands = ["-h", "--help", "help", "-v", "--version", "version"]
|
37
|
+
|
38
|
+
require "license_acceptance/acceptor"
|
39
|
+
begin
|
40
|
+
if (allowed_commands & ARGV.map(&:downcase)).empty? && # Did they use a non-exempt command?
|
41
|
+
!ARGV.empty? # Did they supply at least one command?
|
42
|
+
LicenseAcceptance::Acceptor.check_and_persist(
|
43
|
+
Inspec::Dist::EXEC_NAME,
|
44
|
+
Inspec::VERSION,
|
45
|
+
logger: Inspec::Log
|
46
|
+
)
|
47
|
+
end
|
48
|
+
rescue LicenseAcceptance::LicenseNotAcceptedError
|
49
|
+
Inspec::Log.error "#{Inspec::Dist::PRODUCT_NAME} cannot execute without accepting the license"
|
50
|
+
Inspec::UI.new.exit(:license_not_accepted)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
27
54
|
# https://github.com/erikhuda/thor/issues/244
|
28
55
|
def self.exit_on_failure?
|
29
56
|
true
|
data/lib/inspec/cli.rb
CHANGED
@@ -419,26 +419,6 @@ end
|
|
419
419
|
#=====================================================================#
|
420
420
|
|
421
421
|
help_commands = ["-h", "--help", "help"]
|
422
|
-
version_commands = ["-v", "--version", "version"]
|
423
|
-
commands_exempt_from_license_check = help_commands + version_commands
|
424
|
-
|
425
|
-
#---------------------------------------------------------------------#
|
426
|
-
# EULA acceptance
|
427
|
-
#---------------------------------------------------------------------#
|
428
|
-
require "license_acceptance/acceptor"
|
429
|
-
begin
|
430
|
-
if (commands_exempt_from_license_check & ARGV.map(&:downcase)).empty? && # Did they use a non-exempt command?
|
431
|
-
!ARGV.empty? # Did they supply at least one command?
|
432
|
-
LicenseAcceptance::Acceptor.check_and_persist(
|
433
|
-
"inspec",
|
434
|
-
Inspec::VERSION,
|
435
|
-
logger: Inspec::Log
|
436
|
-
)
|
437
|
-
end
|
438
|
-
rescue LicenseAcceptance::LicenseNotAcceptedError
|
439
|
-
Inspec::Log.error "InSpec cannot execute without accepting the license"
|
440
|
-
Inspec::UI.new.exit(:license_not_accepted)
|
441
|
-
end
|
442
422
|
|
443
423
|
#---------------------------------------------------------------------#
|
444
424
|
# Adjustments for help handling
|
data/lib/inspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.6.
|
4
|
+
version: 4.6.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef InSpec Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: train
|