RiotKit
Ruby toolkit for the Riot Games API: regional routing and platform hosts, League match/player helpers, Result-based services, fluent facades, and bundled Data Dragon static data. Works in any Ruby app — Rails is optional.
Languages: English · Português (BR)
Installation
Add to your Gemfile and run bundle install:
gem "riot_kit", "~> 1.0"
From GitHub (specific branch or fork):
gem "riot_kit", github: "VictorCostaOliveira/riot-kit", branch: "main"
Ruby ≥ 3.2 — see riot_kit.gemspec.
Configuration
You need a Riot developer API key. Expose it as RIOT_API_KEY (or assign config.api_key yourself).
Rails
bin/rails generate riot_kit:install
This adds config/initializers/riot_kit.rb. Edit region (routing cluster) and platform (shard: br1, na1, euw1, …) for your defaults.
Any Ruby project
require "riot_kit"
RiotKit.configure do |config|
config.api_key = ENV.fetch("RIOT_API_KEY")
config.region = :americas # :americas | :europe | :asia | :sea
config.platform = :br1 # br1, na1, euw1, ...
end
Optional settings (timeouts, retries, logger) are commented in the generated initializer.
Usage
Facades
player = RiotKit::Player.find("GameName#TAG")
player.matches(:ranked).first # lazy: loads match details as you iterate
player.match("BR1_1234567890")
player.ranked
player.avg_matches_per_week
RiotKit::Items.find(3078)
RiotKit::Champions.find("Aatrox")
Services (Result)
RiotKit::Services::Riot::MatchHistory.call(nickname: "GameName#TAG", filter: :ranked)
.on_success { |entries| p entries }
.on_failure { |error| warn error. }
Data Dragon
Static champion, item, rune, and spell data is included in the gem — no separate download for normal use.
For per-request platform / region, lazy matches behavior, queues, limits, and lower-level APIs, see Documentation below.
Documentation
| Doc | Contents |
|---|---|
| INTEGRATION.md | Rails generator, RiotKit.configure patterns, Docker / path: gems, overriding platform or region per request, controllers and tests |
| INTEGRATION.pt-br.md | Same guide in Portuguese (Brazil) |
| CHANGELOG.md | Release notes |
Support
- Bug reports & feature requests: open an issue on GitHub (search existing issues first).
- Questions: GitHub Issues are appropriate if something is unclear after reading INTEGRATION.md — include Ruby / gem version and a minimal repro when reporting bugs.
Security-sensitive reports: prefer a private channel if your fork uses Security disclosures; otherwise contact the maintainer via the repo.
Contributing
- Fork the repo and create a branch.
bundle installbundle exec rspecandbundle exec rubocop- Open a pull request with a clear description.
Releases: bump lib/riot_kit/version.rb, then push to main. The Release RubyGem workflow (.github/workflows/release.yml) runs RuboCop, RSpec, then creates the vX.Y.Z tag if it is still missing and publishes to RubyGems in the same run (required because tag pushes made with the default Actions token do not trigger follow-up workflows). If the tag already exists, the gem step is skipped. Manual run: Actions → Release RubyGem (workflow_dispatch). PRs and non-main branches use CI only (.github/workflows/ci.yml).
License
MIT — see LICENSE.txt.