A simple gem for sending messages to the Slack.com communications platform.
Add this line to your application's Gemfile:
gem 'slackr'
And then execute:
$ bundle
Or install it yourself as:
$ gem install slackr
Send a message to slack:
require 'slackr'
slack = Slackr::Webhook.new("my_team_name","my_api_key")
slack.say "this is a test"
Say a message to slack using some customization:
require 'slackr'
slack = Slackr::Webhook.new("my_team_name","my_api_key",{:icon_emoji => ":ghost:"})
slack.say("this is a test as a ghost")
slack.say("this is a test as a ghost with a custom name",{:username => "casper"}
Available customizations include:
# slack_options
# {
# "channel" => "#myroom",
# "username" => "my_bot_name",
# "icon_url" => "https://slack.com/img/icons/app-57.png",
# "icon_emoji" => ":ghost:"
# }
- More/better tests
- Link parsing and attachments
- CLI
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request