Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

truework-archive/truework-sdk-ruby

Repository files navigation

⚠️ This SDK version is deprecated. The SDK does work, but is not maintained and new features may not be supported. For now, we encourage our customers to integrate directly against the API using https://truework.com/docs. ⚠️

Truework Ruby SDK

A first party software development kit (SDK) for the Truework API.

Installation

Add this line to your application's Gemfile:

gem 'truework'

And then execute:

$ bundle

Or install it yourself as:

$ gem install truework

Requirements

  • Ruby 2.4+

Usage

The library needs to be configured with your verifier account's api key. Call Truework.configure with its value:

require 'truework'

Truework.configure('myTrueworkToken')

# get the first 10 companies that match the query "International"

Truework::Company.list(q: 'International', limit: 10, offset: 0)

Versioning

Pinning the client to a specific version of the Truework API is heavily recommended. If not set, the latest version of the API will be used.

Truework.configure('myTrueworkToken', api_version: '2019-10-15')

Sandbox

The SDK can be configured to interact with the Truework Sandbox instead of the production environment for testing purposes.

Truework.configure('myTrueworkSandboxToken', environment: Truework::Environment::SANDBOX)

Development

After checking out the repo and running bin/setup, tests can be run using the following command:

$ bundle exec rake spec

Contributing

Issues

If you run into problems, or simply have a question, feel free to open an issue!

Commiting

This repo uses commitizen to nicely format commit messages. Upon making edits, stage your changes and simply run git commit to enter the commitizen UI in your terminal.

Note: if you are not prompted with the commitizen UI, run npm run prepare to install the git hook.

Releases

This project is versioned and published automatically using semantic-release and semantic-release-rubygem. Via a GitHub Action, semantic-release will use the commit message pattern provided by commitizen to automatically version the package. It will then publish to RubyGems, as well as create a new release here in the main repo.

License

The gem is available as open source under the terms of the MIT License.