ellen-slack 0.0.2 → 0.0.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: 669c6181d5558dc776d198c7cf0d06d7f3b0a0e6
4
- data.tar.gz: 3d04a4422bd39a16d7c05e6799dca956bf5b1e6a
3
+ metadata.gz: 10f864351ee2de7cd8fba72209681b7e1e3c1835
4
+ data.tar.gz: 10c4aa03f35fe1bfffb9ae82ced8d92e05629a59
5
5
  SHA512:
6
- metadata.gz: ca783184e883255849fd13350fe3506afeecd8cfd19e681c13303265f3e562eaa28e211decf4bd477a0efc17c314b5bea6bd9634ba597a8551468d12f6efb04c
7
- data.tar.gz: 9aafaceefd3c122ab09d11dc6fb1f876f0d412b3552ed6ad4062ecc1314393f48b4a7f79dd5e85f12e5ce3b8e6e4696fbcb4b20104d109733d43b5e105c7da5a
6
+ metadata.gz: c5729686d59587ea52b3a1735edbd3bfa73429e2a0ee6bdc96d22774bb0a9e4d694b36548d6e3e49b62ce7421df9fcf456163baddec9d7267cc8449cbd4b2605
7
+ data.tar.gz: 41c9eb7a74e99514b5548ba78477bde3b24b1b3cca20f462779840677e2cb372555b387c81c884749eb81644de3d55a8e3f4cf9f4d72465a6296011bfc4d7c10
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.0.3
2
+ * Support multiline message
3
+
1
4
  ## 0.0.2
2
5
  * Fix encoding problem (forced to UTF-8)
3
6
 
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
  ```
@@ -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
- client.privmsg(channel, ":#{body}")
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
@@ -1,5 +1,5 @@
1
1
  module Ellen
2
2
  module Slack
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
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.2
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-21 00:00:00.000000000 Z
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: