laraib
Laraib is an attempt to produce a Ruby flavored client library for the pump.io network.
The majority of the work on this library will be done through the repo at gitorious. The Github repo is merely a mirror, please do not make pull requests there.
Laundry List
Bug reports and feature requests can be found on jpope's flyspray instance. A sane redirect will be provided soon.
Testing
laraib uses MiniTest and the default Rake task is to run the tests. Simply
run rake
to kick off the full test suite.
As of the oauth_experiments
merge, there is no test coverage. The next
logical step is to begin stubbing out replies from pump.io while work on
convenience methods begins.
VCR and webmock are being added to isolate interactions with pump itself. For now, you can run a local non-federated pump instance for testing laraib if you don't want to deal with public instances.
Installation
The laraib gem won't be uploaded again until v0.0.2 or until a name change due to craziness with rubygems.org. For the time being, you can build laraib yourself from the source directory:
gem build laraib.gemspec
gem install laraib-0.0.1.gem
See this bug report for details.
Usage
Laraib requires a configuration file to exist in order to function. It should look something like this:
---
:url: https://your.pump.io
:consumer_secret: SUPER_SECRET
:consumer_key: MY_GOD_ITS_FULL_OF_ASCII
:token: HASHES_ALL_UP_IN_THIS_FILE
:token_secret: HASHY_MC_HASHINGTON_THE_THIRD
If you do not already have a configuration set, you can generate one with
the bin/laraib-genconf
script. No batteries are included with that
script, it's a complete procedural hack (good luck; have fun).
Once you've got a configuration file built, you can make a new Laraib client object thusly:
l = Laraib::Client.new('/path/to/your/conf.yaml')
That should be all that's necessary. Basic post
and get
wrappers
have been provided. The traditional first test is to grab a feed:
l.get('/api/user/your_name/feed')
See the pump.io API for payload details. A typical post might look something like this:
{
"verb": "post",
"object": {
"objectType": "note",
"content": "your message here"
}
}
Enjoy!