A Ruby gem for communicating with the Sorry™ API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/sorry
spec
.gitignore
.rspec
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
sorry-api-ruby.gemspec

README.md

Sorry™ API - Ruby

Build Status Gem Version Dependency Status

An easy to use Ruby wrapper for the Sorry™ Status Page API. For details on what you can do with the API please check our API Documentation.

Installation

To install the gem into the application you need to add it to your Gemfile.

gem "sorry-api-ruby"

Once this has been done you can run bundle install to install the gem into your bundle.

Configuration

Once the gem is installed you're ready to get up and running with it.

client = Sorry::Api::Client.new('put your access token in here')

You can also instantiate the client without an access token, and it'll look for an ENV variable called 'SORRY_ACCESS_TOKEN' which is the preferable more-secure option if you're only ever connecting to a single Sorry™ account.

Usage

Now you have your client you can begin to make requests to the API. This is done my chaining methods to match the path defined in the Documentation, and then terminate the call by the method you wish to perform i.e. get(), create(), update() or delete().

GET
client.pages.get # => Lists all the pages in the account.
client.pages('kjh324jh').get # => Returns a single page with the given ID.
client.pages('kjh324jh').brand.get # => Returns the pages brand settings.
POST/PUT
client.pages.post(:name => 'My New Status Page') # => Creates a new page.
client.pages('kjh324jh').put(:name => 'My Pages New Name') # => Updates the name of the page.

##### DELETE

client.pages('kjh324jh').delete # => Deletes the page with the given ID.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

Once you are happy that your contribution is ready for production please send us a pull request, at which point we'll review the code and merge it in.

Versioning

For transparency and insight into our release cycle, and for striving to maintain backward compatibility, This project will be maintained under the Semantic Versioning guidelines as much as possible.

Releases will be numbered with the following format:

<major>.<minor>.<patch>

And constructed with the following guidelines:

  • Breaking backward compatibility bumps the major (and resets the minor and patch)
  • New additions without breaking backward compatibility bumps the minor (and resets the patch)
  • Bug fixes and misc changes bumps the patch

For more information on SemVer, please visit http://semver.org/.

Authors & Contributors

Robert Rawlins

Robin Geall

Copyright

© Copyright 2016 - See LICENSE for details.