0.0
The project is in a healthy, maintained state
Sending Personalized Slack Messages to a Slack channel of your choice.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
 Project Readme

Slack Messaging Maintainability Default

This is a simple project designed to post messages to a given Slack channel as a bot.

Installation

Add this line to your application's Gemfile:

gem 'slack_messaging'

And then execute:

bundle install

Or install it yourself as:

gem install slack_messaging

Usage

This project requires a config file that should look like this:

slack:
  channel: <AWESOME CHANNEL NAME>
  username: <AWESOME USER NAME>
  webhook_url: <SLACK WEBHOOK URL>
  icon_emoji: ":<SOME EMOJI>:"

The default is for the file to be named ~/.slack_messaging.yml, but a different path can be passed in like this:

$ slack-messaging --config="/PATH/TO/FILE/config.yml" slack

To obtain the webhook url, go to this link.

Okay, now the project will be ready to rock and roll.

To print a friendly message to Slack, run:

slack-messaging slack

from the main directory. Here, no specific message is being given to print to Slack, so slack_messaging will choose a random quote. The random quotes are selected using the Quotable API.

However, what if you wanted to print something specific? Well, you can! Just run:

slack-messaging slack "MESSAGE 1"

You can even print multiple messages at once:

slack-messaging slack "MESSAGE 1" "MESSAGE 2" "MESSAGE 3" ... "MESSAGE N"

The output of slack_messaging will look something like this:

I hope you enjoy printing fun and specialized messages to Slack!

Tests

To run the tests, run bundle exec rspec from the command line. GitHub Actions will also run the tests upon every commit to make sure they're up to date and that everything is working correctly. Locally, you can also run bundle exec guard to automatically run tests as you develop! There are currently only tests for the notify_slack and random_message classes. Feel free to help us add more!

Contributing

To submit a feature request, bug ticket, etc, please submit an official GitHub Issue.

To report any security vulnerabilities, please view this project's Security Policy.

This repository does have a standard Code of Conduct.

Releasing

To make a new release of this gem:

  1. Merge the pull request via the big green button
  2. Run git tag vX.X.X and git push --tag
  3. Make a new release here
  4. Run gem build *.gemspec
  5. Run gem push *.gem to push the new gem to RubyGems
  6. Run rm *.gem to clean up your local repository

To set up your local machine to push to RubyGems via the API, see the RubyGems documentation.