README.md

ClubhouseRuby

Clubhouse is a radical project management tool
particularly well suited to software development. If you're not familiar with
them, go check them out! ❤️

This gem is built with the philosophy that a good API wrapper is a simpler
alternative to a comprehensive client library and can provide a nice interface
to the API using dynamic Ruby metaprogramming techniques rather than mapping
functionality from the API to the library piece by piece.

This enables the wrapper to be loosely coupled to the current implementation of
the API, which makes it more resilient to change. Also, this approach takes much
less code and maintenance effort, allowing the developer to be lazy. A
reasonable person might fairly assume this to be the true rationale behind the
philosophy. They'd be right.

Installation

Add this line to your application's Gemfile:

gem 'clubhouse_ruby'

And then execute:

$ bundle

Or install it globally:

$ gem install clubhouse_ruby

Or transcribe the code by carving it character by character into the
mechanically articulated hand built stone sculpture you've developed that
operates as an effective turing machine when lubricated with oil.

Usage

This gem is a lightweight API wrapper. That means you'll need to refer to the
API documentation to figure out what resources
and actions exist.

On the plus side, once you know what you want to do, using this gem should be
simple.

Instantiate an object to interface with the API:

clubhouse =ClubhouseRuby::Clubhouse.new(<YOURCLUBHOUSEAPITOKEN>)

The API can also provide responses in CSV format instead of the default JSON:

Then, call methods on the object matching the resource(s) and action you are
interested in. For example, if you want to list all available epics, you need to
access the endpoint at https://api.clubhouse.io/api/v1/epics. The
clubhouse_ruby gem uses an explicit action:

If the endpoint you want is nested, you can build a path by chaining method
calls, providing any required parent resource id as an argument to that method
in the chain. For example, if you wanted to list all the stories associated
with a particular project:

Version

The current version of the clubhouse_ruby gem supports the current version of
the API, version 2. If you want something that definitely works with v1, use
version 0.2.0 of clubhouse_ruby.

Development

After checking out the repo, run bin/setup to install dependencies and
following the instructions. Specifically, you can choose to provide a genuine
Clubhouse API token in the .env file. This will be important if you want to
use bin/console for an interactive prompt that allows you to experiment with
the gem and real API responses.

Use rake spec to run the tests. The tests don't make external requests but
rather use VCR for stubbed responses. If you want to play with the tests and
get real API responses (perhaps to extend the suite or for a new feature) then
you'll need to have an API token in the env as described above.

Note that the current test suite is far from exhaustive and could do with some
love.

NB: If you have implemented a feature that requires a new cassette, make sure
you change the uri referenced by the cassette you added to remove the API token
if you have updated the environment to use your token. Otherwise your API token
will be in publically visible from the code in this repo.