lita-hipchat 3.0.0 → 3.0.1
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 +4 -4
- data/lib/lita/adapters/hipchat.rb +8 -0
- data/lita-hipchat.gemspec +1 -1
- data/spec/lita/adapters/hipchat_spec.rb +8 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14e8a9c29b30288cdf23cc2152e022c9fbc659c0
|
4
|
+
data.tar.gz: 1bd2d780bc512de631bfdc9d14155eb23ac9674c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4148ec0cd38054cc3264519ef0ecb08b29795d30f3fc02d3e7e180ac71853b8a101f02e820c54ab417a4d6916f97a935185bcadc7a313ed8b75316822859eb8d
|
7
|
+
data.tar.gz: ab4941c2d694788943f8b0ad5c21af729ef229afeef9867b75cb8c227715ebb633e7dc204aa1e7b879549091bfe571fb70373ea5189abbc77eec3428abf7be8e
|
@@ -42,6 +42,7 @@ module Lita
|
|
42
42
|
connector.connect
|
43
43
|
robot.trigger(:connected)
|
44
44
|
join_persisted_rooms
|
45
|
+
create_room_objects
|
45
46
|
sleep
|
46
47
|
rescue Interrupt
|
47
48
|
shut_down
|
@@ -67,6 +68,13 @@ module Lita
|
|
67
68
|
|
68
69
|
private
|
69
70
|
|
71
|
+
def create_room_objects
|
72
|
+
connector.list_rooms(muc_domain).each do |room|
|
73
|
+
room.sub!("@#{muc_domain}", '')
|
74
|
+
Room.create_or_update(room)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
70
78
|
def join_all_rooms?
|
71
79
|
config.rooms == :all
|
72
80
|
end
|
data/lita-hipchat.gemspec
CHANGED
@@ -12,6 +12,7 @@ describe Lita::Adapters::HipChat, lita: true do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
allow(described_class::Connector).to receive(:new).and_return(connector)
|
15
|
+
allow(connector).to receive(:list_rooms).and_return(rooms)
|
15
16
|
end
|
16
17
|
|
17
18
|
subject { described_class.new(robot) }
|
@@ -19,7 +20,7 @@ describe Lita::Adapters::HipChat, lita: true do
|
|
19
20
|
let(:robot) { Lita::Robot.new(registry) }
|
20
21
|
let(:connector) { instance_double("Lita::Adapters::HipChat::Connector") }
|
21
22
|
let(:domain) { "conf.hipchat.com" }
|
22
|
-
let(:rooms) { %w(room_1
|
23
|
+
let(:rooms) { %w(room_1 room_2) }
|
23
24
|
|
24
25
|
it "registers with Lita" do
|
25
26
|
expect(Lita.adapters[:hipchat]).to eql(described_class)
|
@@ -67,6 +68,12 @@ describe Lita::Adapters::HipChat, lita: true do
|
|
67
68
|
subject.run
|
68
69
|
end
|
69
70
|
|
71
|
+
it "creates room objects in redis" do
|
72
|
+
expect(Lita::Room).to receive(:create_or_update).with 'room_1'
|
73
|
+
expect(Lita::Room).to receive(:create_or_update).with 'room_2'
|
74
|
+
subject.run
|
75
|
+
end
|
76
|
+
|
70
77
|
context "with a custom domain" do
|
71
78
|
let(:domain) { "foo.bar.com" }
|
72
79
|
|
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: 3.0.
|
4
|
+
version: 3.0.1
|
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-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.4.5
|
155
|
+
rubygems_version: 2.4.5.1
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: A HipChat adapter for the Lita chat robot.
|