em-ssh 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -129,14 +129,16 @@ module EventMachine
129
129
 
130
130
  begin
131
131
  on(:connected) do |session|
132
+ @connected = true
132
133
  succeed(session, @host)
133
134
  end
134
135
  on(:error) do |e|
135
136
  fail(e)
136
137
  close_connection
137
138
  end
139
+
138
140
  @nocon = on(:closed) do
139
- fail(SshError.new(@host))
141
+ fail(ConnectionFailed.new(@host))
140
142
  close_connection
141
143
  end
142
144
  @contimeout = EM::Timer.new(@timeout) do
@@ -144,6 +146,12 @@ module EventMachine
144
146
  close_connection
145
147
  end
146
148
 
149
+ @nonego = on(:closed) do
150
+ fail(ConnectionTerminated.new(@host))
151
+ close_connection
152
+ end
153
+ on(:version_negotiated) { @nonego.cancel }
154
+
147
155
  @error_callback = lambda do |code|
148
156
  fail(SshError.new(code))
149
157
  close_connection
@@ -1,5 +1,5 @@
1
1
  module EventMachine
2
2
  class Ssh
3
- VERSION='0.4.0'
3
+ VERSION='0.4.1'
4
4
  end # class::Ssh
5
5
  end # module::EventMachine
data/lib/em-ssh.rb CHANGED
@@ -25,6 +25,7 @@ module EventMachine
25
25
  class Disconnected < SshError; end
26
26
  class ConnectionFailed < SshError; end
27
27
  class ConnectionTimeout < ConnectionFailed; end
28
+ class ConnectionTerminated < SshError; end
28
29
 
29
30
 
30
31
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
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-07-25 00:00:00.000000000 Z
12
+ date: 2012-08-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine