inspec 4.17.15 → 4.17.17

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: 41fd45d0bd5150ea65469cdd93220c166c9fb63524b44c724aa2b0b06cd2d257
4
- data.tar.gz: 0f8791ceebfb6763e15f157d751472ae5c1a3dfefb7fe6d2d038248bfd02611d
3
+ metadata.gz: 1834559fb185f5d2d7477563f319605dc3111db8f598777c7d78d0e32b1fd11c
4
+ data.tar.gz: 17b3b6a638f067cf14cdfa836940a1f620de0ae1310b7b3d45bf27b4d7a0552b
5
5
  SHA512:
6
- metadata.gz: 289fb8774e764bdb2177f457062fd73de5dfb31a6a5c5f436f75b6fe53e7e29bacadcc385eb95bce0b621a68d130962d9eee188b8f94938c9d0e9e2903291eab
7
- data.tar.gz: 8112b33205d77f7d13d2228e03fd5cedfbde00845d873342351219a2f8b5a4af222a7f7aaa6e5b81f1afebf56f97378485362912b07b27617406ac73f7c5f808
6
+ metadata.gz: 282930a4ab520be61d4d187aba3e7721a628882c0a6ded0f5df619ac681ed1f8951ffdc11212913066e77ebf9905e4d8ed47c4c275da0fada0a7e8c8a99c9704
7
+ data.tar.gz: c1797f51e7552ea8930c50dfe3a25719430eb3221dd9d0799b32cf3e0a1290ae369c5df11c0d83a20e19a3928d176dade29a12fa904f8d5dd140164bb71bdd17
@@ -17,6 +17,10 @@ module Inspec
17
17
  @action.call("describe.one", @checks, nil)
18
18
  end
19
19
 
20
+ def method_missing(method_name, *arguments)
21
+ Inspec::DSL.method_missing_resource(inspec, method_name, *arguments)
22
+ end
23
+
20
24
  def describe(*args, &block)
21
25
  @checks.push(["describe", args, block])
22
26
  end
@@ -0,0 +1,9 @@
1
+ module Inspec::Resources
2
+ class Noop < Inspec.resource(1)
3
+ name "noop"
4
+
5
+ def to_s
6
+ "No-op"
7
+ end
8
+ end
9
+ end
@@ -227,9 +227,7 @@ module Inspec
227
227
  msg = "Skipped control due to #{skip_check[:type]} condition."
228
228
  end
229
229
 
230
- # TODO: we use os as the carrier here, but should consider
231
- # a separate resource to do skipping
232
- resource = rule.os
230
+ resource = rule.noop
233
231
  resource.skip_resource(msg)
234
232
  [["describe", [resource], nil]]
235
233
  end
@@ -344,14 +342,13 @@ module Inspec
344
342
  def with_dsl(block)
345
343
  return nil if block.nil?
346
344
 
347
- if self.class.resource_dsl
348
- dsl = self.class.resource_dsl
349
- proc do |*args|
350
- include dsl
351
- instance_exec(*args, &block)
352
- end
353
- else
354
- block
345
+ dsl = self.class.resource_dsl
346
+
347
+ return block unless dsl
348
+
349
+ proc do |*args|
350
+ include dsl
351
+ instance_exec(*args, &block)
355
352
  end
356
353
  end
357
354
 
@@ -1,3 +1,3 @@
1
1
  module Inspec
2
- VERSION = "4.17.15".freeze
2
+ VERSION = "4.17.17".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.17.15
4
+ version: 4.17.17
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-09-30 00:00:00.000000000 Z
11
+ date: 2019-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: train
@@ -584,6 +584,7 @@ files:
584
584
  - lib/inspec/resources/mysql_session.rb
585
585
  - lib/inspec/resources/nginx.rb
586
586
  - lib/inspec/resources/nginx_conf.rb
587
+ - lib/inspec/resources/noop.rb
587
588
  - lib/inspec/resources/npm.rb
588
589
  - lib/inspec/resources/ntp_conf.rb
589
590
  - lib/inspec/resources/oneget.rb