Hubble Observatory is a Ruby library to interact with the Hubble API.
The source code is available on GitHub and the documentation on RubyDoc.
After registering your app, you can run commands like:
HubbleObservatory::TalentAccount.create email: 'user@example.com'
# => '123456'
The full documentation is available at rubydoc.info.
Add this line to your application’s Gemfile:
gem 'hubble_observatory'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hubble_observatory
Set the following ENV variables in your Ruby/Rails application
ENV['HUBBLE_APP_TOKEN'] = "<app token to access Hubble API>"
ENV['HUBBLE_ENV'] = "production"
If you don’t set ENV['HUBBLE_ENV']
to "production", the staging Hubble API will be targeted.
Hubble Observatory provide only two methods to create and update talent accounts.
Obtain the ID of Talent Account given the corresponding email:
talent_account = HubbleObservatory::TalentAccount.create email: 'user@example.com'
# => '123456'
Update the email of a Talent Account give the corresponding ID:
talent_account = HubbleObservatory::TalentAccount.new id: '123456'
talent_account.update email: 'newuser@example.com'
# => '123456'
Obtain the token of a employee given the appropriate access token:
HubbleObservatory::FsEmployee.create access_token: 'ya.29defg'
# => 'hb.484562'
To install the app and its dependencies, run bin/setup
.
To execute the test suite, run:
HUBBLE_APP_TOKEN=<token> bundle exec rake
To release a new version, run: bundle exec rake release
.