Project

SWGOH-API

0.0
There's a lot of open issues
A ruby gem client for api.swgoh.help
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
 Project Readme

SWGOH::API Gem Version

Ruby client wrapper for the API at https://api.swgoh.help .

Installation

Add this line to your application's Gemfile:

gem 'SWGOH-API'

And then rake:

$ bundle exec rake

Usage

# Require the gem
require 'SWGOH/API/CLIENT/client'

# Create a new client
client = CLIENT.new

# Generate a new access_token
access_token = client.authorize("username", "password")

# Or authenticate with a saved access_token
client.access_token = access_token

# Then start making requests
json = client.get_players([123456789])

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests.

To install this gem onto your local machine, run gem install 'SWGOH-API'.

irb

$ irb -rubygems               
irb(main):001:0> require 'SWGOH/API/CLIENT/client'
=> true
irb(main):002:0> client = CLIENT.new
=> #<CLIENT:0x00007fdf90087b28 @language="ENG_US", @enums=false, @structure=false, @access_token=nil>
irb(main):003:0> client.authorized?
=> false
irb(main):004:0> client.access_token = 'myexistingtoken'
=> "myexistingtoken"
irb(main):005:0> client.authorized?
=> true

Release

These are the steps to create and tag a new version, push git commits and tags, and push the new gem version to rubygems.org.

  • Update the version number in version.rb
  • Run gem build SWGOH-API.gemspec
  • Create a new version commit
  • Rollup the last N commits since a release git rebase -i HEAD~N
  • Release the new version bundle exec rake release

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jquass/SWGOH-API. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

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

Code of Conductir

Everyone interacting in the SWGOH::API project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.