ruby_expect 1.4 → 1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ruby_expect/expect.rb +5 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67fbc97f76219863f2cf105e4c65bcfe8a7c9f38
4
- data.tar.gz: 085868d14d640f2a0d886b57f82d346377d35362
3
+ metadata.gz: aae7564291f071fcddf3d57a076cd2fa88c26cbb
4
+ data.tar.gz: 49e142d0d9a17e8c27461938915573cc7ccae623
5
5
  SHA512:
6
- metadata.gz: c653fc4005be1c60476b1732b61aecc7d0867e51bf275437aaaac0d7ac47d482982c1aaef596b62cd91345a91dbec9787dda87570a5a1d3f514859e3a4b14511
7
- data.tar.gz: fbd3ffc2cb0178e209ca41f99569d524d8ad81ed40049a68b21aa802cd2c349a612e681f1c119d3428a2ef7ffe6b521bba9c097e4019ae6c041bb8629e5e4932
6
+ metadata.gz: fe85ffc733d458dfa2d026a4f836acd878edf2188dbf2fb69802fa760d84ba7770066e2ba2181827b2ff9ab2aac6c8da24f89d11e6d9a62120e3f17f5aad0069
7
+ data.tar.gz: 79bca0c7efff5f225082680cb5a34f935902012770ef0ba8c5afe380fc3834cc8701943191849998245a8b5053ae1b6037fef3b6e75ab1f8abb70e5dec663158
@@ -264,7 +264,7 @@ module RubyExpect
264
264
  # the spawned process or connected filehandle/socket is closed
265
265
  #
266
266
  def soft_close
267
- while (! @read_fh.eof?)
267
+ while (! @read_fh.closed?)
268
268
  read_proc
269
269
  end
270
270
  @read_fh.close unless (@read_fh.closed?)
@@ -294,12 +294,16 @@ module RubyExpect
294
294
  end
295
295
  end
296
296
  rescue EOFError => e
297
+ rescue Errno::EIO => e
298
+ @read_fh.close
299
+ return false
297
300
  rescue Exception => e
298
301
  unless (e.to_s == 'stream closed')
299
302
  STDERR.puts "Exception in read_loop:"
300
303
  STDERR.puts "#{e}"
301
304
  STDERR.puts "\t#{e.backtrace.join("\n\t")}"
302
305
  end
306
+ @read_fh.close
303
307
  return false
304
308
  end
305
309
  return true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_expect
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.4'
4
+ version: '1.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Bates