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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8bb84b8222dcb5484737f5e157abb050765d3d988a1153c9ddff8e770415fe3
4
- data.tar.gz: ef6f2c3a982ffd20ee7cbde1908ae3f0c27dd45c04bd46be6a69713f03a7d776
3
+ metadata.gz: 2f5b73cc4ec9d1e11867bb9e7d0cc7eeb1007ef4b10f56485d817bd56811d662
4
+ data.tar.gz: 12b23768ff808f509c88b7ce0558a73e04a328d8d9a6e37da6b6ac74208e891e
5
5
  SHA512:
6
- metadata.gz: 79ac61b9b4d8d4703a8f3f1f08a2fdebdc81590cb759c8dbee6cfb23d66ce558e3458662c54dd19b7f3a1da801bbc65dad2d6da81e2caef5d3ce8b94e5fd9c49
7
- data.tar.gz: 36c93530a71e46988ef3da4716669cd3cc97073c10e7ebf770c97b69c2d5607da7d9b6a512765f810dfdbac6e570fe596d1e47958257c0ed57d2c18acf14fa48
6
+ metadata.gz: 39a2cdcd01416f61101a2436ce3a01bc754cd3212010d348a094b14b1ac8a7b07e9dbc4b2da1795c5b75ea628e760c4cf5ddb84a446531531bdad78f3d24f183
7
+ data.tar.gz: 25b1c69962503c6567ec46f8122edddc614bdfa16b475b6a64ad4c488e7e115830aeb59a215826cfb6b9ac1b67b9b9a6c6c1de395c7d0dce3689bc4ae88121b9
data/Gemfile CHANGED
@@ -28,7 +28,6 @@ group :test do
28
28
  gem "mocha", "~> 1.1"
29
29
  gem "ruby-progressbar", "~> 1.8"
30
30
  gem "webmock", "~> 3.0"
31
- gem "passgen"
32
31
  gem "m"
33
32
  gem "pry", "~> 0.10"
34
33
  gem "pry-byebug"
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Inspec
2
- VERSION = "4.6.4".freeze
2
+ VERSION = "4.6.9".freeze
3
3
  end
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
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-06-19 00:00:00.000000000 Z
11
+ date: 2019-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: train