inspec-core 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: 64e2d79bf71e70d0783fd31ef43cda6c21715ed91298f19dad9ea248c2039d71
4
- data.tar.gz: aa3b9a599db467490ec0915dab797942f7d230b86a7ddeba63ccbd939dd9c967
3
+ metadata.gz: 4a36d31d9a7cd2c45ff3bb9d4ac89eb91f8ce0c9604819b48e27a300b00614f7
4
+ data.tar.gz: 0f063d8f8c1d02310c9188fd3fb9bdbb8027aaf7c8bf19d975f6a5730a5af723
5
5
  SHA512:
6
- metadata.gz: 9b284df3e68d6273a6d07bddff97e5afd9bbe4b9481413c1e27b0576e6543ac69cc20cc4e51dae33f4a9d1f136bc375aa2e6978d387be909b3b7f22208ea6b4d
7
- data.tar.gz: d11d0ad527dbf68930bfcbaf1d4c6185a601307d5f89c662948c96bbf51516ad7b3b2cf9cea38ee8fa8959a93d7ea228a8efc3c1a59702bdb2a25d34cee27b48
6
+ metadata.gz: bf4d30d1c1514bd164be327a15f04f100502b83e07b06e132ff80b81a8d8b61d1972909d12b778e7fbd2d8f22778cc2e0f5554eb22a86f804af242d32b6bbec4
7
+ data.tar.gz: 8d70d967677ba4186edb18f02036e87b8b1aa16cd9e4d8e82f5d7786a8ff08875f3e5fa8b73c565ee1e811dd26adb848ae1f16d3a9cb5897aa78c32b66b109a8
@@ -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
@@ -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-core
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
  - Dominik Richter
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-core