slack_notifier_wrapper 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cee7fec8842e42b01a23019cd389fa0751d078b6
4
- data.tar.gz: a2d8fa9464e6b25406145c19007ac858edd04c69
3
+ metadata.gz: 227ce10f0481221683c970ddf96e9a516620e58d
4
+ data.tar.gz: fc30a39bbf6029491d730cdc75b5cde4a79dfbdb
5
5
  SHA512:
6
- metadata.gz: b8c4780829b49bd34bf1884918579d0e874ba690ec8611255b9eef74e7d33b7390ae94ea2fb41e83c680881432684ef9c34ba93eb713385fc2f07575c2df0fd9
7
- data.tar.gz: 4d64040b704474121e54f888de54393ee8bf7f7d44a9676a66f34d3a645e0723dea2090d998f52edaf33945a4f3967d0c802fda053e4c1cf93c7eb7b584c9fce
6
+ metadata.gz: 4102a5d0c31a8079c1bb4a5861b4c133fcfbc650f0a82f5f10fc76a468fb6331982820271efdddd17a5acf4c54b20adf696d55b406f578b96a72ad98ecd83179
7
+ data.tar.gz: 7ceaaee631f59844ed9be242375860598f08334293501c7177faa8e54d964179c06b49f4031e57863188f5af4e4c521e30b291c240d4980f17445ccb04eaf06b
data/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  # SlackNotifierWrapper
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/slack_notifier_wrapper`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [slack-notifier](https://github.com/stevenosloan/slack-notifier) is an awesome gem for sending notifications to Slack with Ruby and this wrapper gem lets you push Slack notifications with a different syntax.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
6
5
 
7
- ## Installation
6
+ ## Installation & Setup
8
7
 
9
8
  Add this line to your application's Gemfile:
10
9
 
@@ -12,27 +11,33 @@ Add this line to your application's Gemfile:
12
11
  gem 'slack_notifier_wrapper'
13
12
  ```
14
13
 
15
- And then execute:
14
+ Configure the gem with default settings:
16
15
 
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install slack_notifier_wrapper
22
-
23
- ## Usage
16
+ ```ruby
17
+ SlackNotifierWrapper.config do
18
+ slack_webhook_url "webhook url"
19
+ default_channel "#some-channel"
20
+ username "Bob"
21
+ icon_emoji ":bob:"
22
+ end
23
+ ```
24
24
 
25
- TODO: Write usage instructions here
25
+ Use the gem to speak messages to the default Slack channel:
26
26
 
27
- ## Development
27
+ ```ruby
28
+ SlackNotifierWrapper.speak("This is some message")
29
+ ```
28
30
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
31
+ Access the notifier object directly and specify overrides if you'd like to override the defaults:
30
32
 
31
- 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).
33
+ ```ruby
34
+ notifier = SlackNotifierWrapper.notifier
35
+ notifier.ping "Whatever", channel: "#devnull"
36
+ ```
32
37
 
33
38
  ## Contributing
34
39
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/slack_notifier_wrapper.
40
+ Bug reports and pull requests are welcome on GitHub at https://github.com/MrPowers/slack_notifier_wrapper.
36
41
 
37
42
 
38
43
  ## License
@@ -5,7 +5,7 @@ module SlackNotifierWrapper
5
5
  begin
6
6
  send(method_name)
7
7
  rescue Exception => e
8
- attachment_message = "#{self.class}##{method_name} failed to execute"
8
+ attachment_message = "#{self.class}##{method_name} failed to execute: #{e.message}"
9
9
  SlackNotifierWrapper.speak_attachments({ color: "danger", attachment_message: attachment_message })
10
10
  raise e
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module SlackNotifierWrapper
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack_notifier_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MrPowers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2015-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler