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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ad7f231798e72ad24098c645a8fb7eeeba583f3
4
- data.tar.gz: c39205b24b33b1e0274fab0575d97a873ecebffa
3
+ metadata.gz: 14e8a9c29b30288cdf23cc2152e022c9fbc659c0
4
+ data.tar.gz: 1bd2d780bc512de631bfdc9d14155eb23ac9674c
5
5
  SHA512:
6
- metadata.gz: d461fa2c0b10cfeccea84474ba310f11130ef29b0578de1861af6290ffed2be679a6476c3bf09b214638cc107d28e24f99766ff8d4487d3c165dcbd1e4a47753
7
- data.tar.gz: b1cf4ae4f3d3e5a92c043dc149c72193973fb04e792db88889ee5c6b867fcf013a7ead3dd11e1948069c74bd8160d4661e236b18605eaad022a2f5a4edcf5fd6
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-hipchat"
3
- spec.version = "3.0.0"
3
+ spec.version = "3.0.1"
4
4
  spec.authors = ["Jimmy Cuadra"]
5
5
  spec.email = ["jimmy@jimmycuadra.com"]
6
6
  spec.description = %q{A HipChat adapter for Lita.}
@@ -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, room_2) }
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.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-06-18 00:00:00.000000000 Z
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.