lita-hipchat 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3caf3e5aa475e362c0df849d97d9fb9aa6e357e9
|
4
|
+
data.tar.gz: ed234aaa8462ea9ef2879be9a107df398d5a90f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a31c0c64b0d43365ad850eb21e7b2a98b9a65ad333495c3147259e2e27742dade106900a91a4b33fcf44c5a119a9bd9d31c38c9cf564daf53aebe2fd30bfe370
|
7
|
+
data.tar.gz: 04616bc35f867a8116d81f27c36920493cac185b011fee812343c1cd0cf63c5c1766da88fffac25c9eb7f7f0bdf20aa8ff32119e2a1f3a8938942dfb1688a23b
|
@@ -28,6 +28,7 @@ module Lita
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def connect
|
31
|
+
register_exception_handler
|
31
32
|
client_connect
|
32
33
|
load_roster
|
33
34
|
register_message_callback
|
@@ -114,6 +115,12 @@ module Lita
|
|
114
115
|
client.auth(@password)
|
115
116
|
end
|
116
117
|
|
118
|
+
def register_exception_handler
|
119
|
+
client.on_exception do |error, connection, error_source|
|
120
|
+
robot.shut_down
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
117
124
|
def register_message_callback
|
118
125
|
Callback.new(robot, roster).private_message(client)
|
119
126
|
end
|
data/lita-hipchat.gemspec
CHANGED
@@ -9,6 +9,7 @@ describe Lita::Adapters::HipChat::Connector, lita: true do
|
|
9
9
|
allow(client).to receive(:auth)
|
10
10
|
allow(client).to receive(:connect)
|
11
11
|
allow(client).to receive(:send)
|
12
|
+
allow(client).to receive(:on_exception)
|
12
13
|
client
|
13
14
|
end
|
14
15
|
|
@@ -97,6 +98,11 @@ describe Lita::Adapters::HipChat::Connector, lita: true do
|
|
97
98
|
expect(robot).to receive(:mention_name=).with("LitaBot")
|
98
99
|
subject.connect
|
99
100
|
end
|
101
|
+
|
102
|
+
it "registers an error handler with the XMPP client" do
|
103
|
+
expect(client).to receive(:on_exception)
|
104
|
+
subject.connect
|
105
|
+
end
|
100
106
|
end
|
101
107
|
|
102
108
|
describe "#join" do
|
@@ -104,12 +104,6 @@ describe Lita::Adapters::HipChat, lita: true do
|
|
104
104
|
allow(subject).to receive(:sleep).and_raise(Interrupt)
|
105
105
|
subject.run
|
106
106
|
end
|
107
|
-
|
108
|
-
it "disconnects gracefully on connection reset" do
|
109
|
-
expect(subject).to receive(:shut_down)
|
110
|
-
allow(subject).to receive(:sleep).and_raise(Errno::ECONNRESET)
|
111
|
-
subject.run
|
112
|
-
end
|
113
107
|
end
|
114
108
|
|
115
109
|
describe "#send_messages" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-hipchat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Cuadra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|