inspec-core 3.6.2 → 3.6.4

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: 540ae71a1d966748d37cddcb1f171f7921e34f9bfcc6781702934756904476f9
4
- data.tar.gz: 52a9a03513892e4e266eaba4a24eee0cee01749c6b96d99845c335616544b962
3
+ metadata.gz: f150b52c3fea0f1aa08699459007ae99caac3fa2e98a4cc5fe2edd89ad57c9d0
4
+ data.tar.gz: a0c9f594dbda3b1c68d97f20995f0a4eabb3330d7f263ff083d609f6490dd425
5
5
  SHA512:
6
- metadata.gz: b13e81a88b36ee456597ffcacb701e84c1702d402f80e8ac1f2c9e135af14c3990394f366230969d6ca6968dad4b973cb09ada2a919e16789282e77cfcf38348
7
- data.tar.gz: 1a27aa7f35b92b4b5b974123bee5ef33ab0d942e6bc90a478521927a771a564d92c9b1063f359a7d4d457b1e401229e96a5938cb62dd38b7fa6e10f57cab8778
6
+ metadata.gz: 2b8a12508f77b3df920bcb1f0d05b5cb424bbb9ea5cd59291313bcdb4516aec94ff9ba21f702524006cae12b5dd6b6dd1186ae64168cb69c9790f077ff7b3025
7
+ data.tar.gz: fbe74d4eeb961b351ef938fbd9c12860c21ba803f718d826039cade5f74b80c116672772ae02afa427909717ee976314082b52bd0082a365e4d4632db60bfa6b
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-core
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-core