GrowlCar
Sending notifications to the growl provider on boxcar.io
Installation
Add this line to your application's Gemfile:
gem 'growl_car'
And then execute:
$ bundle
Or install it yourself as:
$ gem install growl_car
Usage
You will need to enable the Growl provider on your boxcar account.
Sample Usage
require 'growl_car'
GrowlCar.configure do |config|
config.username = "YOUR_BOXCAR_USERNAME"
config.password = "YOUR_BOXCAR_PASSWORD"
end
GrowlCar.send_growl_notification("GrowlCar-test", "This message is from GrowlCar")
It is also possible to instantiate a GrowlCar::Client
to handle multiple users:
matt = GrowlCar::Client.new(username: MATT_BOXCAR_USERNAME, password: MATT_BOXCAR_PASSWORD)
alex = GrowlCar::Client.new(username: ALEX_BOXCAR_USERNAME, password: ALEX_BOXCAR_PASSWORD)
matt.send_growl_notification("GrowlCar-matt", "Hey how's it going?")
alex.send_growl_notification("GrowlCar-alex", "The Food is ready")
Errors
the send_growl_notification
method can raise errors if it encounters any issues with boxcar.
If is unable to log in (unauthorized response) it will raise a GrowlCar::Error::UnauthorizedError
For any response that is not a 200 or 401 (unauthorized) it will raise a GrowlCar::Error::HttpError
Documentation
You can find the latest documentation of the master branch here: http://rubydoc.info/github/matthewshafer/growl_car/
Contributing
Issues
Issues can be reported right here on the github repo. Everyone is encouraged to write an issue if they find a bug or have a request.
Pull Requests
Everyone can also submit pull requests. Here are some guidelines:
- Fork the repo
- Create a branch (make the name descriptive)
- Write tests and work on your changes
- Make sure all tests pass and your code is covered
- Open a pull request and write a description of what you did