inspec-core 4.7.18 → 4.7.24

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: 28c863490aac987ef4d371231c350cb4a8b49a1f1ba115e31099a125b6017af9
4
- data.tar.gz: b004afbe062795dc0e5a0169e370e3845c8d8361bf5767e3513bd7e84612adaf
3
+ metadata.gz: d8ebdd6aaafd9ef4f423418a420b3e46658f013f1f95c6117be5d1a19ae9a609
4
+ data.tar.gz: 8e11217be61503e5f478a30586aad4b9247752f37354caebf7746fa0483da8b0
5
5
  SHA512:
6
- metadata.gz: 18bafe0200e418478fe85a6880b7760e2fea9ac486cb4704af9a866822fcf2e48deb728dc636527d555b3668ca60ee7ea4a9926d05605f75388d0587cfce386f
7
- data.tar.gz: 13cb08637d64a0d3fbbdda987abb9d06fff11307d9bff88b5405da6e273e2758be067df9db46c75e05a3f1ef1fda9f60c5902417e58af89950db2765560035e1
6
+ metadata.gz: c4cee03272408e51c0870fd0dc2fca4e743a94a5d8f2d3f1b4d423540062c1f913c6971526cd3c5f647eb5e6ac617dd9722f6ecd3d4788c49ac5e130b1e022ac
7
+ data.tar.gz: 269f2962d1011a85f72a80fa3d22ca59bc727cb4d8e197e2bc2bb4bddc1941cc097a59ee2272ed4a104107597a977756be27ceea638bb436ade579fd7a48b066
@@ -328,7 +328,7 @@ module Inspec::Plugin::V2
328
328
 
329
329
  # OK, perform the installation.
330
330
  # Ignore deps here, because any needed deps should already be baked into new_plugin_dependency
331
- request_set.install_into(gem_path, true, ignore_dependencies: true)
331
+ request_set.install_into(gem_path, true, ignore_dependencies: true, document: [])
332
332
 
333
333
  # Painful aspect of rubygems: the VendorSet request set type needs to be able to find a gemspec
334
334
  # file within the source of the gem (and not all gems include it in their source tree; they are
@@ -165,7 +165,11 @@ module Inspec::Resources
165
165
  end
166
166
 
167
167
  def to_s
168
- "File #{source_path}"
168
+ if file
169
+ "File #{source_path}"
170
+ else
171
+ "Bad File on %s" % [inspec.backend.class]
172
+ end
169
173
  end
170
174
 
171
175
  private
@@ -26,5 +26,33 @@ module Inspec::Resources
26
26
  skip_resource "The `sys_info.hostname` resource is not supported on your OS yet."
27
27
  end
28
28
  end
29
+
30
+ # returns the Manufacturer of the local system
31
+ def manufacturer
32
+ os = inspec.os
33
+ if os.darwin?
34
+ "Apple Inc."
35
+ elsif os.linux?
36
+ inspec.command("cat /sys/class/dmi/id/sys_vendor").stdout.chomp
37
+ elsif os.windows?
38
+ inspec.powershell("Get-CimInstance -ClassName Win32_ComputerSystem | Select Manufacturer -ExpandProperty Manufacturer").stdout.chomp
39
+ else
40
+ skip_resource "The `sys_info.manufacturer` resource is not supported on your OS yet."
41
+ end
42
+ end
43
+
44
+ # returns the ServerModel of the local system
45
+ def model
46
+ os = inspec.os
47
+ if os.darwin?
48
+ inspec.command("sysctl -n hw.model").stdout.chomp
49
+ elsif os.linux?
50
+ inspec.command("cat /sys/class/dmi/id/product_name").stdout.chomp
51
+ elsif os.windows?
52
+ inspec.powershell("Get-CimInstance -ClassName Win32_ComputerSystem | Select Model -ExpandProperty Model").stdout.chomp
53
+ else
54
+ skip_resource "The `sys_info.model` resource is not supported on your OS yet."
55
+ end
56
+ end
29
57
  end
30
58
  end
data/lib/inspec/runner.rb CHANGED
@@ -255,7 +255,7 @@ module Inspec
255
255
 
256
256
  resource = arg[0]
257
257
  # check to see if we are using a filtertable object
258
- resource = arg[0].resource if arg[0].class.superclass == FilterTable::Table
258
+ resource = resource.resource if resource.is_a? FilterTable::Table
259
259
  if resource.respond_to?(:resource_skipped?) && resource.resource_skipped?
260
260
  return rspec_skipped_block(arg, opts, resource.resource_exception_message)
261
261
  end
@@ -1,3 +1,3 @@
1
1
  module Inspec
2
- VERSION = "4.7.18".freeze
2
+ VERSION = "4.7.24".freeze
3
3
  end
@@ -104,7 +104,6 @@ end
104
104
  # Deprecated: You should not use this matcher anymore
105
105
  RSpec::Matchers.define :be_running do
106
106
  match do |service|
107
- Inspec.deprecate(:serverspec_compatibility, "The service `be_running?` matcher is deprecated.")
108
107
  service.running? == true
109
108
  end
110
109
 
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.7.18
4
+ version: 4.7.24
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-07-18 00:00:00.000000000 Z
11
+ date: 2019-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: train-core