lita-slack 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/lita/adapters/slack.rb +3 -3
- data/lita-slack.gemspec +1 -1
- data/spec/lita/adapters/slack_spec.rb +14 -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: 94fa7740895d09a183b18621b296e01c0b9bf4ba
|
4
|
+
data.tar.gz: 8d092bb60ea02b23c43f53551e6ca691d5654d00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9478684ba8c9c77579c3224559cff79b49a7fcf2f30c361997d2e1d53ee777269e6da9bcd0b542fac591a1b7ed20ce27a708ad25db19675bd7ca51367c83cb2b
|
7
|
+
data.tar.gz: 1746b869ac92e8a99d3cc8bcad47ea21707625b28dbc6607d6b8684d023e118eb8ec6cc06ed89082607ebf428a18de6bc3055da3eb32c1a59d062560d9650a42
|
data/README.md
CHANGED
@@ -18,15 +18,24 @@ gem "lita-slack"
|
|
18
18
|
|
19
19
|
**Note**: When using lita-slack, the adapter will overwrite the bot's name and mention name with the values set on the server, so `config.robot.name` and `config.robot.mention_name` will have no effect.
|
20
20
|
|
21
|
+
### config.robot.admins
|
22
|
+
|
23
|
+
Each Slack user has a unique ID that never changes even if their real name or username changes. To populate the `config.robot.admins` attribute, you'll need to use these IDs for each user you want to mark as an administrator. If you're using Lita version 4.1 or greater, you can get a user's ID by sending Lita the command `users find NICKNAME_OF_USER`.
|
24
|
+
|
21
25
|
### Example
|
22
26
|
|
23
27
|
``` ruby
|
24
28
|
Lita.configure do |config|
|
25
29
|
config.robot.adapter = :slack
|
30
|
+
config.robot.admins = ["U012A3BCD"]
|
26
31
|
config.adapters.slack.token = "abcd-1234567890-hWYd21AmMH2UHAkx29vb5c1Y"
|
27
32
|
end
|
28
33
|
```
|
29
34
|
|
35
|
+
## Joining rooms
|
36
|
+
|
37
|
+
Lita will join your default channel after initial setup. To have it join additional channels or private groups, simply invite it to them via your Slack client as you would any normal user.
|
38
|
+
|
30
39
|
## Events
|
31
40
|
|
32
41
|
* `:connected` - When the robot has connected to Slack. No payload.
|
data/lib/lita/adapters/slack.rb
CHANGED
data/lita-slack.gemspec
CHANGED
@@ -40,6 +40,9 @@ describe Lita::Adapters::Slack, lita: true do
|
|
40
40
|
let(:room_source) { Lita::Source.new(room: 'C024BE91L') }
|
41
41
|
let(:user) { Lita::User.new('U023BECGF') }
|
42
42
|
let(:user_source) { Lita::Source.new(user: user) }
|
43
|
+
let(:private_message_source) do
|
44
|
+
Lita::Source.new(room: 'C024BE91L', user: user, private_message: true)
|
45
|
+
end
|
43
46
|
|
44
47
|
it "sends messages to rooms" do
|
45
48
|
expect(rtm_connection).to receive(:send_messages).with(room_source.room, ['foo'])
|
@@ -56,7 +59,17 @@ describe Lita::Adapters::Slack, lita: true do
|
|
56
59
|
|
57
60
|
subject.run
|
58
61
|
|
59
|
-
subject.send_messages(
|
62
|
+
subject.send_messages(user_source, ['foo'])
|
63
|
+
end
|
64
|
+
|
65
|
+
it "sends messages to users when the source is marked as a private message" do
|
66
|
+
allow(rtm_connection).to receive(:im_for).with(user.id).and_return('D024BFF1M')
|
67
|
+
|
68
|
+
expect(rtm_connection).to receive(:send_messages).with('D024BFF1M', ['foo'])
|
69
|
+
|
70
|
+
subject.run
|
71
|
+
|
72
|
+
subject.send_messages(private_message_source, ['foo'])
|
60
73
|
end
|
61
74
|
end
|
62
75
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken J.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.
|
224
|
+
rubygems_version: 2.4.5
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: Lita adapter for Slack.
|