Socket
Book a DemoInstallSign in
Socket

forecasting

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forecasting

0.3.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Forecasting

Gem Version Tests

A Ruby gem to interact with the Harvest Forecast API. Please note that there is currently no official public API. This API client has been made by inspecting network requests using the Forecast website. This library is based on the excellent Harvesting gem.

Installation

Add this line to your application's Gemfile:

gem 'forecasting'

And then execute:

$ bundle

Or install it yourself as:

$ gem install forecasting

Usage

In order to start using this gem you will need your personal token and an account id:

You can find these details over here: https://id.getharvest.com/developers

If you don't specify values for access_token or account_id, it will default to these environment variables:

  • ENV['FORECAST_ACCESS_TOKEN']
  • ENV['FORECAST_ACCOUNT_ID']
# $ export FORECST_ACCESS_TOKEN=xxx
# $ export FORECAST_ACCOUNT_ID=12345678
client = Forecasting::Client.new
client.whoami
=> #<Forecasting::Models::User:0x000000010488e370 @attributes={"id"=>212737, ... }>

If the access token or account id is invalid a Forecasting::AuthenticationError will be raised:

client = Forcasting::Client.new(access_token: "foo", account_id: "bar")
client.whoami
=> #<Forecasting::AuthenticationError: {"reason":"non-existent-token","account_id":"bar"}>

With a valid access token and account id:

client = Forecasting::Client.new(access_token: "<your token here>", account_id: "<your account id here>")
user = client.whoami
#<Forecasting::Models::User:0x000000010e238ac0 @attributes={"id"=>212737, ... }>

user.id
# => 212737

Releases

To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

License

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

FAQs

Package last updated on 30 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.