slack_bot 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/slack_bot/notify.rb +3 -2
- data/lib/slack_bot.rb +7 -2
- data/lib/slack_bot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55757c5bcdfcb40455084cb97de7862bfbe44183
|
4
|
+
data.tar.gz: aa900cf5b3d70eaeabb5ab0eea502b69d226dbba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7789083f5dc11f484708572aacc81088399ff728dfc5e4e1d832ca6d948d02dafe8e62e1f2f650ddcde4b739d5aa1723559906749346ce44c999d1878018f8d8
|
7
|
+
data.tar.gz: 29a7154d0a447aa21198fb5c7ad47e3344709ca5c36c2069e8c622a23765e3a0e37b0aced143ab17f2b0df807cd138bc2464f243796c015ef7e2a7487b71f195
|
@@ -1,13 +1,14 @@
|
|
1
1
|
module SlackBot
|
2
2
|
class Notify < ActiveRecord::Base
|
3
3
|
|
4
|
-
def self.execute(body, bot_name, channel)
|
4
|
+
def self.execute(body, bot_name, channel, icon_url)
|
5
5
|
return 'SlackBot is unactive mode.' if SlackBot.unactive
|
6
6
|
query = {
|
7
7
|
token: ::SlackBot.token,
|
8
8
|
channel: channel,
|
9
9
|
text: body,
|
10
|
-
username: bot_name
|
10
|
+
username: bot_name,
|
11
|
+
icon_url: icon_url
|
11
12
|
}
|
12
13
|
uri = Addressable::URI.parse(::SlackBot.endpoint)
|
13
14
|
uri.query_values ||= {}
|
data/lib/slack_bot.rb
CHANGED
@@ -18,6 +18,10 @@ module SlackBot
|
|
18
18
|
'https://slack.com/api/chat.postMessage'
|
19
19
|
end
|
20
20
|
|
21
|
+
mattr_accessor :icon_url do
|
22
|
+
'https://qiita-image-store.s3.amazonaws.com/0/48274/9dbacfb2-4a39-4a2c-b8f1-e252bcb12a4e.png'
|
23
|
+
end
|
24
|
+
|
21
25
|
mattr_accessor :body do
|
22
26
|
'error occured at test'
|
23
27
|
end
|
@@ -34,7 +38,8 @@ module SlackBot
|
|
34
38
|
yield self if block_given?
|
35
39
|
end
|
36
40
|
|
37
|
-
def self.notify(body: SlackBot.body, bot_name: SlackBot.bot_name,
|
38
|
-
|
41
|
+
def self.notify(body: SlackBot.body, bot_name: SlackBot.bot_name,
|
42
|
+
channel: SlackBot.channel, icon_url: SlackBot.icon_url)
|
43
|
+
Notify.execute(body, bot_name, channel, icon_url)
|
39
44
|
end
|
40
45
|
end
|
data/lib/slack_bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kidachi_
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|