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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 736adb6d0eb4fe6c40d33a2a13273bc06ba55c53
4
- data.tar.gz: 7baf65d13e6d7c3aae15a713c95c598e2a5f9701
3
+ metadata.gz: 55757c5bcdfcb40455084cb97de7862bfbe44183
4
+ data.tar.gz: aa900cf5b3d70eaeabb5ab0eea502b69d226dbba
5
5
  SHA512:
6
- metadata.gz: 038da27ac951cee011987511e7ffa83595758e1944f03f8597579c615b9cf2d58b9c9a9b18e287e3da908217d02a152a393ef43df0d11fe551e9ec21efcc93f0
7
- data.tar.gz: 100c7d55a5c6723c20f1e7dfe7f63df70d5a8ec265d009403a09f94b44c427c67929bada07525293fab10ad57869cbef6ecebcfc5cff615e377f729c258b6347
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 ||= {}
@@ -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, channel: SlackBot.channel)
38
- Notify.execute(body, bot_name, channel)
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
@@ -1,3 +1,3 @@
1
1
  module SlackBot
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
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-09-25 00:00:00.000000000 Z
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails