Project

codelocks

0.0
No commit activity in last 3 years
No release in over 3 years
A wrapper for the CodeLocks NetCode API used to generate lock codes.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 2.0
>= 0
~> 10.0
~> 3.3
~> 2.9

Runtime

~> 0.9
 Project Readme

Codelocks

Gem Version

A simple gem to wrap the Codelocks NetCode API, for generating key codes to operate their physical locks.

API Versions

If you are using an API version prior to v4.1, you need to use the latest v1 release of this gem. v2 is a large rewrite in order to support the new API.

Installation

Add this line to your application's Gemfile:

gem 'codelocks'

And then execute:

$ bundle

Or install it yourself as:

$ gem install codelocks

Usage

Configure your API credentials, either by setting the following two environment variables:

CODELOCKS_BASE_URI
CODELOCKS_API_KEY
CODELOCKS_ACCESS_KEY

Or by setting them directly in Ruby:

Codelocks.base_uri = "http://something.com"
Codelocks.api_key = "blargh"
Codelocks.access_key = "argh"

API documentation with information on methods is available on RubyDoc.info.

Tests

The test suite can be run locally using the following commands:

$ cp .env.test .env
$ dotenv
$ bundle exec rspec

Contributing

  1. Fork it ( https://github.com/[my-github-username]/codelocks/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request