slackpost 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +1 -1
- data/README.md +16 -5
- data/lib/slackpost.rb +2 -5
- data/lib/slackpost/exceptions.rb +6 -1
- data/lib/slackpost/version.rb +1 -1
- data/slackpost-0.1.2.gem +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6441d0718cb39f08857c3ecf961da28cdc52ca1cd48124d6cdc6c81c1cc20ac0
|
4
|
+
data.tar.gz: 645c6919885f3de58726871c5478c0a0c649650e02f7191d296b45fa8b93655b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bde72522d222aa428ed26d1083ff70452431f9ff8b0005f1b5441a89a12edb99d629a3dd7da9d7c29abcf5127af4b8b132b8d89bda0eaa9cbbb70aeff833dfc0
|
7
|
+
data.tar.gz: 49883e69af291f12f07c70a37d81315d39bcbd69a213c7c2f1617831e4ddb69316dfde3fd7326abff533ab0554abd9bb4bcefcdcd28145022bebd6703d549c77
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -29,17 +29,23 @@ token do you need, refer to this page: https://api.slack.com/incoming-webhooks
|
|
29
29
|
require 'slackpost'
|
30
30
|
|
31
31
|
Slackpost.configure do |config|
|
32
|
-
config.slack_token =
|
32
|
+
config.slack_token = 'T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
|
33
33
|
end
|
34
34
|
```
|
35
35
|
|
36
36
|
That's it! And now you can use the static methods `send_message` and `send_attachemnt`, like this:
|
37
37
|
|
38
38
|
```ruby
|
39
|
-
Slackpost.send_message(
|
39
|
+
Slackpost.send_message('This is a test', 'test_channel')
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
attachment = { fallback: 'Fallback message',
|
42
|
+
color: '#fab01a',
|
43
|
+
fields: [{ title: 'Attachment title',
|
44
|
+
value: 'Attachment text' }] }
|
45
|
+
Slackpost.send_attachment('This will send a single attachment', 'test_channel', attachment)
|
46
|
+
|
47
|
+
attachments = [attachment, attachment, attachment]
|
48
|
+
Slackpost.send_attachment('This will send multiple attachments', 'test_channel', attachments)
|
43
49
|
|
44
50
|
```
|
45
51
|
|
@@ -52,9 +58,14 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
52
58
|
|
53
59
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
54
60
|
|
61
|
+
|
55
62
|
## Contributing
|
56
63
|
|
57
|
-
|
64
|
+
1. Fork it ( https://github.com/guillermijas/slackpost/fork )
|
65
|
+
2. Create your feature branch (`git checkout -b features/new_feature`)
|
66
|
+
3. Commit your changes (`git commit -am 'Descriptive comment about the feature'`)
|
67
|
+
4. Push to the branch (`git push origin features/new_feature`)
|
68
|
+
5. Create new Pull Request
|
58
69
|
|
59
70
|
## License
|
60
71
|
|
data/lib/slackpost.rb
CHANGED
@@ -25,14 +25,11 @@ module Slackpost
|
|
25
25
|
send_slack(body)
|
26
26
|
end
|
27
27
|
|
28
|
-
def send_attachment(msg, channel,
|
28
|
+
def send_attachment(msg, channel, attachments)
|
29
29
|
body = { channel: channel,
|
30
30
|
link_names: 1,
|
31
31
|
text: msg,
|
32
|
-
attachments: [
|
33
|
-
color: att_color,
|
34
|
-
fields: [{ title: att_title,
|
35
|
-
value: att_value }] }] }
|
32
|
+
attachments: [attachments].flatten }
|
36
33
|
send_slack(body)
|
37
34
|
end
|
38
35
|
|
data/lib/slackpost/exceptions.rb
CHANGED
data/lib/slackpost/version.rb
CHANGED
data/slackpost-0.1.2.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slackpost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillermo Mora
|
@@ -94,11 +94,11 @@ files:
|
|
94
94
|
- Rakefile
|
95
95
|
- bin/console
|
96
96
|
- bin/setup
|
97
|
-
- certs/slackpost-cert.pem
|
98
97
|
- lib/slackpost.rb
|
99
98
|
- lib/slackpost/configuration.rb
|
100
99
|
- lib/slackpost/exceptions.rb
|
101
100
|
- lib/slackpost/version.rb
|
101
|
+
- slackpost-0.1.2.gem
|
102
102
|
- slackpost.gemspec
|
103
103
|
homepage: https://github.com/guillermijas/slackpost
|
104
104
|
licenses:
|
metadata.gz.sig
CHANGED
Binary file
|