Project

esi

0.01
No commit activity in last 3 years
No release in over 3 years
EVE ESI API wrapper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 5.0
~> 10.0
~> 0.52
~> 3.5
~> 0.16
~> 0.9

Runtime

 Project Readme

Esi

Gem Version TravisCI build status Maintainability Test Coverage

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file lib/esi. To experiment with that code, run bin/console for an interactive prompt.

TODO: Delete this and the text above, and describe your gem

Installation

Add this line to your application's Gemfile:

gem 'esi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install esi

Usage

esi = Esi::Client.new(token: 'YOUR_TOKEN', refresh_token: 'REFRESH_TOKEN', expires_at: EXPIRE_TIMESTAMP)
esi.character()

You can optionally specify a callback that will be executed after a new token has been received using the refresh token

esi.refresh_callback = -> (token, expires_at) {
  # save new token & expires at
}

Authentication

Register your application on [https://developers.eveonline.com/applications]. Add your client id and secret in an initializer or so.

Esi.config.client_id = 'APP_CLIENT_ID'
Esi.config.client_secret = 'APP_CLIENT_SECRET'

Configuration in Rails

Install the initializer with rails generator esi:install and modify config/initializers/esi.rb.

Caching

ESI will cache API requests that auto expire based on the Expires-At header returned by ESI. By default ActiveSupport::Cache::MemoryStore is used. When using Rails you can configure ESI to use the cache configured in your app by setting the cache config variable.

Esi.config.cache = Rails.cache

To disable caching you can set this value to nil.