inspec 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: d453fd4901acccda0f5a0e8de3fc2bc430ed23e4577d239bc33b49823df00c3e
4
- data.tar.gz: 8dd4196875d5f02b501517df0b8316e05b9e7e2b1ee59ffb30aa59a68edd7c4e
3
+ metadata.gz: 17d4755a71b5ff3f54c357d4f1af43aa021f9bf451352b26796532b82eff8171
4
+ data.tar.gz: b6adb4d407d16e0c458247f6f66df68d34defee4d237b68e491733c16be6172a
5
5
  SHA512:
6
- metadata.gz: 4492befd82753e4fd2134c01c67a4e867703634ff41d708cf13d23cc8b11c6740f88129af56aa7a1b0c926fe890bf8cc00ef07e2bc8fe0b94eeee82a9dff9cf9
7
- data.tar.gz: b8c87a88dd89f526d001de7eb0d71224e0166192d2854793b30de72bf23187ac3118840c76211fb74027f607a28a7d7e98b4da9927977b21bc8efec6b92d7150
6
+ metadata.gz: 2ff8d76a9eba7a9d4fb62ccd28e3832b86f2d9c0e462e2c5725010182785a9308f0f5a157011008145578742189a3820d9912ddac3e34e3f7be7495e5ee71e4b
7
+ data.tar.gz: 121d494b210eecbb5cc8a82484efb017b8f6f16317172a916b4f62a2519b3a3ce8253e50d1cd15063230f1f9a081da3f06811db2c11ef5c3bfc4f69c1c23e8d7
@@ -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
@@ -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
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
  - Chef InSpec Team
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