Campfiyah
A simple faraday backed library for campfire. It comes with an in-memory adapter to make working with campfire's API in dev/test a lot easier.
Given a subdomain and a token, Campfiyah gives you two things.
- List all rooms the token can access on a campfire subdomain
- Send messages to specific rooms
Installation
Add this line to your application's Gemfile:
gem 'campfiyah'
Then require it in your code
require 'campfiyah'
Usage
account = Campfiyah::Account.new(default_subdomain, default_token)
room = account.room_by_name("The Danger Room")
room.message("woot")
Or you can find rooms by id
account = Campfiyah::Account.new(default_subdomain, default_token)
room = account.room_by_id(123456)
room.message("woot")
Or you can find information on users
account = Campfiyah::Account.new(default_subdomain, default_token)
user = account.user_by_id(123456)
user.email
user.name
You can also enable the in-memory adapter for development or tests.
Campfiyah.enable_mock!
This won't hit the network at all but give you a consistent interface.
Contributing
- Create new Pull Request
WTF is up with the name?
Dylan... Dylan.. Dylan, Dylan, and Dylan. Because I spit hot fiyah.