inspec 3.6.2 → 3.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f21d273a5f589e59c3372160534b3d64f153747d82c307c2fd52cc9a2b530953
4
- data.tar.gz: ace00ac950f3ef46b82aab22a342fe89104cabefbad95d47b6e6eca11efc66ca
3
+ metadata.gz: 4bd30e84acea77b1a9eec7c3d7ad6b70a429426f5d9509a492530c33e7d56500
4
+ data.tar.gz: 4c7bdaa11806e392213811053d9d742abb07064f95be42ca3ca54663ee7b8287
5
5
  SHA512:
6
- metadata.gz: d0870ac680ec73a25b013b4b6cfabd9aaea4402f041dcda0c2607296a45e98fd29ad418c37f64937b1df27ffab9d5d6f8b3112f7372a1fd3b2cca02f292dd47e
7
- data.tar.gz: da77a786f41d832f0a502729dfa8bb256c61899413f2ceb3966b57e8e6135f3a6058b461e05417f9d95d02a1048e7e7f0b9455cbff06ce449dad821642e034e6
6
+ metadata.gz: '0690a4812aa05a6b4393322e0910b7698498bd8a0b76609f7a0cee9e108f511c071b3dd946f8979390471dd678b1a98587c0a0daaeb42d47142ef84acd2cd498'
7
+ data.tar.gz: 404249ed309a38bd4add6f0f583e6eadccb9097cf76a6ab46c29d91005978c587c3f06bbc9998607f89cc47cc323ea1c3d7affbf6442ebc17d2c0f75c1234742
data/lib/inspec/config.rb CHANGED
@@ -177,8 +177,15 @@ module Inspec
177
177
  path
178
178
  end
179
179
 
180
+ # When reading STDIN, read it once into a class variable and cache it.
181
+ # Don't cache other IO objects though, as we use several different StringIOs
182
+ # during unit testing. Refs #3792
183
+ def self.stdin_contents # rubocop: disable Lint/IneffectiveAccessModifier
184
+ @stdin_content ||= STDIN.read
185
+ end
186
+
180
187
  def read_cfg_file_io(cfg_io)
181
- contents = cfg_io.read
188
+ contents = cfg_io == STDIN ? self.class.stdin_contents : cfg_io.read
182
189
  begin
183
190
  @cfg_file_contents = JSON.parse(contents)
184
191
  validate_config_file_contents!
@@ -4,5 +4,5 @@
4
4
  # author: Christoph Hartmann
5
5
 
6
6
  module Inspec
7
- VERSION = '3.6.2'
7
+ VERSION = '3.6.4'
8
8
  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: 3.6.2
4
+ version: 3.6.4
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-02-07 00:00:00.000000000 Z
11
+ date: 2019-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: train