Repository URL to install this package:
|
Version:
2.2.0 ▾
|
| lib |
| Gemfile |
| Gemfile.lock |
| NAMARA_RUBY_VERSION |
| README.md |
| namara.gemspec |
The Namara Ruby Client provides easy access to the Namara EE rpc services is written in ruby language.
Add the namara gem to a Gemfile. The ref: should be pointing to the latest commit
gem 'namara', git: 'https://github.com/thinkdata-works/namara-ruby.git', branch: 'develop'
Note If you are running Ruby >= 2.6 please ensure that you are using namara-ruby >= 2.1 due to a critical change in the google-protobuf gem that was introduced around 3.7 that changed the way that the necessary files were included. If you are running Ruby < 2.6 you should be able to use namara-ruby >= 2.1 without issue.
To start using namara ruby client, add this line to your code.
require "namara"
Get access to response objects by initializing a Namara client. It takes the domain of the namara api (e.g. ee-dev.namara.io) and the protocol (defaults to https)
namara = Namara.new(domain: "ee-dev.namara.io")
Then, choose an auth strategy. Token auth:
namara.with_token_auth!(token)
Cookie auth (provide the entire cookies array to forward)
namara.with_cookie_auth!(cookies)
APIKey auth :
namara.with_api_key!(api_key)
Ensure that you have namara-go checked out, and have run the command to generate the new client code. Once the ruby code is updated, run
$ dc run namara-ruby ./scripts/copy-rpc.sh <repos/namara-go/clients/ruby>
Which will take all generated ruby code from the path provided, copy it into the project, and fix any cross-proto imports needed.
Which should copy over all; code
See the Namara Ruby Client docs for method calls
The file NAMARA_RUBY_VERSION is used to set the version, this is then used in th gemspec file to set the version and other places in the code base.
So when creating a new release set the version in this file only.