train-core 3.7.2 → 3.7.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: 017550b023185b37f89bc36e7e1cc920079543ac11fe6d7788813b5363934ed4
4
- data.tar.gz: bbd262ace02d7da95ae1ecce35e1c42514cf7a1fcd83f2ae7725b82b8fa65a3f
3
+ metadata.gz: 6ccf18cbe443b73ae4ddf1d26acd7bd86730482130481d2d1ab4110311829cba
4
+ data.tar.gz: 4e377e9a24cfe32eefa8b4a09a5c54a65f1acf8d1d120eb76e4170e45238dc3f
5
5
  SHA512:
6
- metadata.gz: e7792c1fa21fb7207d23b1c283dbc0a4c989f0d1593747b5d1954b8e349ab9d5b209d5146f2af7442de1e79c519de152e376d7cf240cd1983440da0ed4ddea17
7
- data.tar.gz: 55f506d5dbc20b38f89c5f150ffa69f4d6067a20311c891068ece4ce705ee5af01c6c740ced8fc0e52788cd9ab13c25000d47d2800ab7d023580bf18e1a147a8
6
+ metadata.gz: 23bec0bbce7a152996c8c881211fc46908637720f768c3e1254b44409b7da2091984806165d6545e08354b2291d7652f9c1db0b9f930e6a6998a0e5506553d48
7
+ data.tar.gz: 0eb390214488b1b6ae193235b4c9addc1c3750349b8e5ec59c8314dc5a746ab9533d47b8774bb872baabd339768dd1f0e8b6c7c84edb1fbb7a95b2cadf2a71ba
@@ -12,7 +12,7 @@ module Train
12
12
  @spath = path.gsub(/[<>"|?*]/, "")
13
13
  end
14
14
 
15
- def basename(suffix = nil, sep = '\\')
15
+ def basename(suffix = nil, sep = "\\")
16
16
  super(suffix, sep)
17
17
  end
18
18
 
@@ -190,8 +190,23 @@ module Train::Transports
190
190
  script = "$ProgressPreference='SilentlyContinue';" + cmd
191
191
  encoded_script = Base64.strict_encode64(script)
192
192
  # TODO: no way to safely implement timeouts here.
193
- @pipe.puts(encoded_script)
194
- @pipe.flush
193
+ begin
194
+ @pipe.puts(encoded_script)
195
+ @pipe.flush
196
+ rescue Errno::EPIPE
197
+ # Retry once if the pipe went away
198
+ begin
199
+ # Maybe the pipe went away, but the server didn't? Reset it, to get a clean start.
200
+ close
201
+ rescue Errno::EIO
202
+ # Ignore - server already went away
203
+ end
204
+ @pipe = acquire_pipe
205
+ raise PipeError if @pipe.nil?
206
+
207
+ @pipe.puts(encoded_script)
208
+ @pipe.flush
209
+ end
195
210
  res = OpenStruct.new(JSON.parse(Base64.decode64(@pipe.readline)))
196
211
  Local::CommandResult.new(res.stdout, res.stderr, res.exitstatus)
197
212
  end
@@ -216,12 +231,10 @@ module Train::Transports
216
231
 
217
232
  # PowerShell needs time to create pipe.
218
233
  100.times do
219
- begin
220
- pipe = open("//./pipe/#{pipe_name}", "r+")
221
- break
222
- rescue
223
- sleep 0.1
224
- end
234
+ pipe = open("//./pipe/#{pipe_name}", "r+")
235
+ break
236
+ rescue
237
+ sleep 0.1
225
238
  end
226
239
 
227
240
  pipe
data/lib/train/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
3
3
 
4
4
  module Train
5
- VERSION = "3.7.2".freeze
5
+ VERSION = "3.7.4".freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.2
4
+ version: 3.7.4
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: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable