slack-notify 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/LICENSE.txt +1 -1
- data/README.md +5 -4
- data/lib/slack-notify/payload.rb +7 -1
- data/lib/slack-notify/version.rb +1 -1
- data/slack-notify.gemspec +1 -1
- data/spec/slack-notify/client_spec.rb +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a34f17a8acb5c086b0e0b443cf114559c8c51d29
|
4
|
+
data.tar.gz: 7f49fd573c45047acf618cba1671b03f34ec7b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2811b3ac411fca7cb958698d0dcd3f04cfd7b0af9fde18b569e0217ea51b6ba5326f26f0e4c34b2bfeeaede77b3f2a55e7ea8efe39cea75419422ef346a4fe99
|
7
|
+
data.tar.gz: 3f65785e6f256961155f26a632539288e5a1a6f0e4fef040ef871f82d990d64659b856f04bdb8f2e00e85eb3bedb299ee495bbe3f85a30c1cbabeee99e741446
|
data/.travis.yml
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -37,19 +37,20 @@ require "slack-notify"
|
|
37
37
|
Initialize client:
|
38
38
|
|
39
39
|
```ruby
|
40
|
-
client = SlackNotify::Client.new("slack webhook url")
|
40
|
+
client = SlackNotify::Client.new(webhook_url: "slack webhook url")
|
41
41
|
```
|
42
42
|
|
43
43
|
Initialize with options:
|
44
44
|
|
45
45
|
```ruby
|
46
|
-
client = SlackNotify::Client.new(
|
46
|
+
client = SlackNotify::Client.new(
|
47
|
+
webhook_url: "slack webhook url",
|
47
48
|
channel: "#development",
|
48
49
|
username: "mybot",
|
49
50
|
icon_url: "http://mydomain.com/myimage.png",
|
50
51
|
icon_emoji: ":shipit:",
|
51
52
|
link_names: 1
|
52
|
-
|
53
|
+
)
|
53
54
|
```
|
54
55
|
|
55
56
|
Initialize via shorthand method:
|
@@ -86,6 +87,6 @@ rake console
|
|
86
87
|
|
87
88
|
## License
|
88
89
|
|
89
|
-
Copyright (c) 2013-
|
90
|
+
Copyright (c) 2013-2015 Dan Sosedoff, <dan.sosedoff@gmail.com>
|
90
91
|
|
91
92
|
MIT License
|
data/lib/slack-notify/payload.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
module SlackNotify
|
2
2
|
class Payload
|
3
|
-
attr_accessor :username,
|
3
|
+
attr_accessor :username,
|
4
|
+
:text,
|
5
|
+
:channel,
|
6
|
+
:icon_url,
|
7
|
+
:icon_emoji,
|
8
|
+
:link_names,
|
9
|
+
:unfurl_links
|
4
10
|
|
5
11
|
def initialize(options = {})
|
6
12
|
@username = options[:username] || "webhookbot"
|
data/lib/slack-notify/version.rb
CHANGED
data/slack-notify.gemspec
CHANGED
@@ -24,6 +24,6 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "rspec", "~> 2.13"
|
25
25
|
spec.add_development_dependency "webmock", "~> 1.0"
|
26
26
|
|
27
|
-
spec.add_dependency "faraday", "~> 0.9
|
27
|
+
spec.add_dependency "faraday", "~> 0.9"
|
28
28
|
spec.add_dependency "json", "~> 1.8"
|
29
29
|
end
|
@@ -51,7 +51,7 @@ describe SlackNotify::Client do
|
|
51
51
|
before do
|
52
52
|
stub_request(:post, "https://hooks.slack.com/services/foo/bar").
|
53
53
|
with(:body => {"{\"text\":\"Message\",\"username\":\"webhookbot\",\"channel\":\"#general\",\"icon_url\":\"foobar\",\"unfurl_links\":\"1\"}"=>true},
|
54
|
-
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded'
|
54
|
+
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded'}).
|
55
55
|
to_return(:status => 200, :body => "", :headers => {})
|
56
56
|
end
|
57
57
|
|
@@ -71,7 +71,7 @@ describe SlackNotify::Client do
|
|
71
71
|
before do
|
72
72
|
stub_request(:post, "https://hooks.slack.com/services/foo/bar").
|
73
73
|
with(:body => {"{\"text\":\"Message\",\"username\":\"webhookbot\",\"channel\":\"#general\",\"icon_emoji\":\"foobar\",\"unfurl_links\":\"1\"}"=>true},
|
74
|
-
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded'
|
74
|
+
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded'}).
|
75
75
|
to_return(:status => 200, :body => "", :headers => {})
|
76
76
|
end
|
77
77
|
|
@@ -91,7 +91,7 @@ describe SlackNotify::Client do
|
|
91
91
|
before do
|
92
92
|
stub_request(:post, "https://hooks.slack.com/services/foo/bar").
|
93
93
|
with(:body => {"{\"text\":\"Message\",\"username\":\"webhookbot\",\"channel\":\"#general\",\"link_names\":1,\"unfurl_links\":\"1\"}"=>true},
|
94
|
-
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded'
|
94
|
+
:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/x-www-form-urlencoded'}).
|
95
95
|
to_return(:status => 200, :body => "", :headers => {})
|
96
96
|
end
|
97
97
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-notify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Sosedoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.9
|
89
|
+
version: '0.9'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.9
|
96
|
+
version: '0.9'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: json
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
version: '0'
|
154
154
|
requirements: []
|
155
155
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.4.6
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Send notifications to a Slack channel
|