expectr 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/expectr/version.rb +1 -1
  2. data/lib/expectr.rb +10 -3
  3. metadata +2 -2
@@ -1,3 +1,3 @@
1
1
  class Expectr
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
data/lib/expectr.rb CHANGED
@@ -3,6 +3,7 @@ require 'timeout'
3
3
  require 'thread'
4
4
 
5
5
  require 'expectr/error'
6
+ require 'expectr/version'
6
7
 
7
8
  # Public: Expectr is an API to the functionality of Expect (see
8
9
  # http://expect.nist.gov) implemented in ruby.
@@ -142,10 +143,15 @@ class Expectr
142
143
  old_tty = `stty -g`
143
144
  `stty -icanon min 1 time 0 -echo`
144
145
 
145
- # SIGINT should be set along to the program
146
- oldtrap = trap 'INT' do
146
+ # SIGINT should be sent along to the process.
147
+ old_int_trap = trap 'INT' do
147
148
  send "\C-c"
148
149
  end
150
+
151
+ # SIGTSTP should be sent along to the process as well.
152
+ old_tstp_trap = trap 'TSTP' do
153
+ send "\C-z"
154
+ end
149
155
 
150
156
  interact = Thread.new do
151
157
  input = ''.encode("UTF-8")
@@ -156,7 +162,8 @@ class Expectr
156
162
  end
157
163
  end
158
164
 
159
- trap 'INT', oldtrap
165
+ trap 'INT', old_int_trap
166
+ trap 'TSTP', old_tstp_trap
160
167
  `stty #{old_tty}`
161
168
  @interact = false
162
169
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expectr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-27 00:00:00.000000000 Z
12
+ date: 2012-12-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Expectr is an interface to the functionality of Expect in Ruby
15
15
  email: chris@chriswuest.com