0.07
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Send notifications to a Slack channel
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.3
>= 10
>= 2.13
>= 0.7
>= 1.0

Runtime

>= 0.9
>= 1.8
 Project Readme

slack-notify

Send notifications to Slack via webhooks.

Build Status Code Climate Gem Version

Installation

Add this line to your application's Gemfile:

gem "slack-notify"

And then execute:

$ bundle

Or install it yourself as:

$ gem install slack-notify

Usage

Require:

require "slack-notify"

Initialize client:

client = SlackNotify::Client.new(webhook_url: "slack webhook url")

Initialize with options:

client = SlackNotify::Client.new(
  webhook_url: "slack webhook url",
  channel: "#development",
  username: "mybot",
  icon_url: "http://mydomain.com/myimage.png",
  icon_emoji: ":shipit:",
  link_names: 1
)

Initialize via shorthand method:

client = SlackNotify.new(options)

Send test request:

client.test

Send message:

client.notify("Hello There!")
client.notify("Another message", "#channel2")
client.notify("Message", ["#channel1", "#channel2"])

Send direct message:

client.notify("Hello There!", "@username")

You can also test gem via rake console:

rake console

License

Copyright (c) 2013-2015 Dan Sosedoff, dan.sosedoff@gmail.com

MIT License