ellen-slack 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/ellen/adapters/slack.rb +13 -1
- data/lib/ellen/slack/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10f864351ee2de7cd8fba72209681b7e1e3c1835
|
4
|
+
data.tar.gz: 10c4aa03f35fe1bfffb9ae82ced8d92e05629a59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5729686d59587ea52b3a1735edbd3bfa73429e2a0ee6bdc96d22774bb0a9e4d694b36548d6e3e49b62ce7421df9fcf456163baddec9d7267cc8449cbd4b2605
|
7
|
+
data.tar.gz: 41c9eb7a74e99514b5548ba78477bde3b24b1b3cca20f462779840677e2cb372555b387c81c884749eb81644de3d55a8e3f4cf9f4d72465a6296011bfc4d7c10
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -15,5 +15,5 @@ SLACK_CHANNEL - Channel name the bot logs in at first
|
|
15
15
|
SLACK_PASSWORD - Account's IRC password (See https://my.slack.com/account/gateways)
|
16
16
|
SLACK_TEAM - Account's team name
|
17
17
|
SLACK_USERNAME - Account's username, which must match the name on Slack account
|
18
|
-
SLACK_NO_SSL - Pass 1 if you don't want to use SSL connection
|
18
|
+
SLACK_NO_SSL - Pass 1 if you don't want to use SSL connection (optional)
|
19
19
|
```
|
data/lib/ellen/adapters/slack.rb
CHANGED
@@ -4,6 +4,8 @@ require "yaml"
|
|
4
4
|
module Ellen
|
5
5
|
module Adapters
|
6
6
|
class Slack < Base
|
7
|
+
INTERVAL = 0.1
|
8
|
+
|
7
9
|
env :SLACK_CHANNEL, "Channel name the bot logs in at first"
|
8
10
|
env :SLACK_PASSWORD, "Account's IRC password (See https://my.slack.com/account/gateways)"
|
9
11
|
env :SLACK_TEAM, "Account's team name"
|
@@ -16,7 +18,10 @@ module Ellen
|
|
16
18
|
end
|
17
19
|
|
18
20
|
def say(body, options = {})
|
19
|
-
|
21
|
+
body.split("\n").each do |line|
|
22
|
+
client.privmsg(channel, ":#{line}")
|
23
|
+
wait
|
24
|
+
end
|
20
25
|
end
|
21
26
|
|
22
27
|
private
|
@@ -70,6 +75,13 @@ module Ellen
|
|
70
75
|
def connect
|
71
76
|
client.run!
|
72
77
|
end
|
78
|
+
|
79
|
+
# Wait for Slack IRC Gateway to process message queue.
|
80
|
+
# If we send 2 messages in too short time,
|
81
|
+
# sometimes the slack double-renders the first message by mistake.
|
82
|
+
def wait
|
83
|
+
sleep(INTERVAL)
|
84
|
+
end
|
73
85
|
end
|
74
86
|
end
|
75
87
|
end
|
data/lib/ellen/slack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ellen-slack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zircon
|
@@ -94,3 +94,4 @@ signing_key:
|
|
94
94
|
specification_version: 4
|
95
95
|
summary: Slack adapter for Ellen.
|
96
96
|
test_files: []
|
97
|
+
has_rdoc:
|