Project

campfiyah

0.0
No commit activity in last 3 years
No release in over 3 years
A simple faraday based Campfire API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
>= 0

Runtime

 Project Readme

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

  1. Create new Pull Request

WTF is up with the name?

Dylan... Dylan.. Dylan, Dylan, and Dylan. Because I spit hot fiyah.