Project

campy

0.01
No commit activity in last 3 years
No release in over 3 years
Tiny Campfire Ruby client so you can get on with it.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.6.1
~> 1.8.5
 Project Readme

Campy: A Tiny Zero-Dependency Campfire Ruby client

Gem Version Build Status Code Climate Dependency Status

Tiny Campfire Ruby client so you can get on with it. It's implemented on top of Net::HTTP with no external dependencies for Ruby compatibilities.

Installation

Add this line to your application's Gemfile:

gem 'campy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install campy

Usage

First create a campfire.yml file in your home directory:

$ cat <<CAMPFIRE_YAML > $HOME/.campfire.yml
:account: mysubdomain
:token: mytoken123
:room: House of Hubot
CAMPFIRE_YAML

campy Command

Campy comes with the campy command so you can send messages from the command line:

$ campy speak "Campy says yello"
$ campy paste "Long pastes are long"
$ campy play ohmy

Or pipe in your message:

$ echo "Campy tries to honor unix conventions" | campy speak
$ cat ~/stackdump.log | campy paste
$ echo ohmy | campy play

Ruby Library

There's not much to the API; create a Campy::Room and go:

require 'campy'

campy = Campy::Room.new(:account => "mysubdomain",
  :token => "mytoken123", :room => "House of Hubot")
campy.speak "Campy says yello"
campy.paste "Long pastes are long"
campy.play "ohmy"

If you know the room ID and would prefer to use that instead of the name:

require 'campy'

campy = Campy::Room.new(:account => "mysubdomain",
  :token => "mytoken123", :room_id => "12345")
campy.speak "Campy says yello"
campy.paste "Long pastes are long"
campy.play "ohmy"

Why not use the campfire.yml config? Let's do that:

require 'campy'
require 'yaml'

campy = Campy::Room.new(YAML.load_file(
  File.expand_path("~/.campfire.yml")))
campy.speak "Campy says yello"
campy.paste "Long pastes are long"
campy.play "ohmy"

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Authors

Created and maintained by Fletcher Nichol (fnichol@nichol.ca)

License

MIT (see LICENSE)