slack-poster 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/README.md +28 -15
- data/lib/slack-poster/version.rb +1 -1
- data/slack-poster.gemspec +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: 07c5f328765ee39ea4c597fe9448528fa872aaeb
|
4
|
+
data.tar.gz: 514f7b45a00bc1399dce1765d63c9b03f452a7fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3989d89a58f3ebd429d178754dca328a257324440e1f36a3f47de62aac6376cbb64533995a66159a179e849fc56e50a49099c66c5aac45c19b337efd854d67d8
|
7
|
+
data.tar.gz: f249d01b5721bec98080a8eaa20d5ae28f1d0d6664de7f9a993908b24dfc25719fd100b1c12826610d0914f65b19f4e0a7ec627f59b2411fa98a60052e83d893
|
data/README.md
CHANGED
@@ -8,38 +8,51 @@ slack-poster is a simple gem to make your integration with Slack easier. It supp
|
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
|
-
|
11
|
+
```console
|
12
|
+
gem 'slack-poster'
|
13
|
+
``
|
12
14
|
|
13
15
|
And then execute:
|
14
16
|
|
15
|
-
|
17
|
+
```console
|
18
|
+
$ bundle
|
19
|
+
```
|
16
20
|
|
17
21
|
Or install it yourself as:
|
18
22
|
|
19
|
-
|
23
|
+
```console
|
24
|
+
$ gem install slack-poster
|
25
|
+
```
|
20
26
|
|
21
27
|
## Usage
|
22
28
|
|
23
29
|
Just create a new poster and send the message:
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
31
|
+
```ruby
|
32
|
+
TEAM = 'my-test-team'
|
33
|
+
TOKEN = 'hd7heoo2oijd0'
|
34
|
+
|
35
|
+
poster = Slack::Poster.new(TEAM, TOKEN)
|
36
|
+
poster.send_message('Hello, world!')
|
37
|
+
``
|
29
38
|
|
30
39
|
You can use an options array if you don't want to use the settings configured directly on Slack:
|
31
40
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
41
|
+
```ruby
|
42
|
+
options = {
|
43
|
+
icon_url: 'http://example.com/image.png',
|
44
|
+
# or icon_emoji: 'emoji_name',
|
45
|
+
username: 'Tester',
|
46
|
+
channel: '#random'
|
47
|
+
}
|
48
|
+
``
|
38
49
|
|
39
50
|
And then use it as a third parameter. Note that every option is optional (no pun intended!).
|
40
51
|
|
41
|
-
|
42
|
-
|
52
|
+
```ruby
|
53
|
+
poster = Slack::Poster.new(TEAM, TOKEN, options)
|
54
|
+
poster.send('Hi!') # will send to #random with the username 'Tester'
|
55
|
+
```
|
43
56
|
|
44
57
|
That's it!
|
45
58
|
|
data/lib/slack-poster/version.rb
CHANGED
data/slack-poster.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ['oterosantos@gmail.com']
|
11
11
|
spec.summary = %q{Slack wrapper for Incoming WebHooks integrations.}
|
12
12
|
spec.description = %q{slack-poster is a gem to make your integration with Slack WebHooks easier.}
|
13
|
-
spec.homepage = ''
|
13
|
+
spec.homepage = 'https://github.com/rikas/slack-poster'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-poster
|
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
|
- Ricardo Otero
|
@@ -68,7 +68,7 @@ files:
|
|
68
68
|
- lib/slack-poster/poster.rb
|
69
69
|
- lib/slack-poster/version.rb
|
70
70
|
- slack-poster.gemspec
|
71
|
-
homepage:
|
71
|
+
homepage: https://github.com/rikas/slack-poster
|
72
72
|
licenses:
|
73
73
|
- MIT
|
74
74
|
metadata: {}
|