thegamesdb 0.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d98f6062fe9aeb46eaa145ae984dddde93598e658527ca7fb97cc407fed5c5f5
4
- data.tar.gz: ea3afe6ed630d5cdda83f8d5e62eafe08ef0c4bf08cd2f74f2f3c9ea1a599963
3
+ metadata.gz: f764717699d2e66db9ff42a82e6077ca5499fb2e2e27215276492c135bad22ad
4
+ data.tar.gz: ef3c70003d768e26fcb5f6f21a1ca42279a8671b83c12072624a2881da026207
5
5
  SHA512:
6
- metadata.gz: e6b20ed995691fe0ef6f4b50994a2b78c521400d8ba04366a03e7675adda0bebc290aa12f7d8f9ae68ec6c38f29ed7465fdc45b2341cb5c082c96bae620b98dd
7
- data.tar.gz: f7d4a9a807f20549656f6546289892721418d4142709eec2adb67ce8edf7e8a59cdf395da13d8d82def77d2a7c06f393d8d008671f74e0ec75437571f7b026f1
6
+ metadata.gz: 0467cf3be3a2e1838f04c50536a985776ff96cb4e13616ac9560cacb02f298cc952972ea59322563d3ade61dc6847e4fb7facf2b8fc57f87aaa60fa6a3c1f15d
7
+ data.tar.gz: 8d6d965a417ca7a64b85a8c41932ea683ce879acb01eb515c91c5e52d28454c265fa2d179fdb6e74bb3aeafb3dbf4f5c553c5fceaf93fc8285081158ad57590a
@@ -0,0 +1,26 @@
1
+ name: Tests
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+ branches:
8
+ - master
9
+ jobs:
10
+ build:
11
+ env:
12
+ GAMESDB_API_KEY: ${{ secrets.GAMESDB_API_KEY }}
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ ruby: [ '2.5', '2.6', '2.7', 'jruby', 'truffleruby' ]
18
+ name: Ruby ${{ matrix.ruby }}
19
+ steps:
20
+ - uses: actions/checkout@v2
21
+ - uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+ - run: |
25
+ bundle install
26
+ bundle exec rake test
@@ -0,0 +1,20 @@
1
+ name: Rubocop
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+ branches:
8
+ - master
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: 2.7
18
+ - run: |
19
+ bundle install
20
+ bundle exec rubocop
data/.gitignore CHANGED
@@ -17,4 +17,5 @@ test/version_tmp
17
17
  tmp
18
18
  test/fixtures/vcr_cassettes/*
19
19
  .byebug_history
20
- test/reports
20
+ test/reports
21
+ .env
@@ -0,0 +1,39 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.5
3
+ Lint/DuplicateBranch: # (new in 1.3)
4
+ Enabled: true
5
+ Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
6
+ Enabled: true
7
+ Lint/EmptyBlock: # (new in 1.1)
8
+ Enabled: true
9
+ Lint/EmptyClass: # (new in 1.3)
10
+ Enabled: true
11
+ Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
12
+ Enabled: true
13
+ Lint/ToEnumArguments: # (new in 1.1)
14
+ Enabled: true
15
+ Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
16
+ Enabled: true
17
+ Style/ArgumentsForwarding: # (new in 1.1)
18
+ Enabled: true
19
+ Style/CollectionCompact: # (new in 1.2)
20
+ Enabled: true
21
+ Style/DocumentDynamicEvalDefinition: # (new in 1.1)
22
+ Enabled: true
23
+ Style/NegatedIfElseCondition: # (new in 1.2)
24
+ Enabled: true
25
+ Style/NilLambda: # (new in 1.3)
26
+ Enabled: true
27
+ Style/RedundantArgument: # (new in 1.4)
28
+ Enabled: true
29
+ Style/SwapValues: # (new in 1.1)
30
+ Enabled: true
31
+ Style/WordArray:
32
+ EnforcedStyle: brackets
33
+ Layout/EndAlignment:
34
+ AutoCorrect: true
35
+ Style/StringLiterals:
36
+ EnforcedStyle: single_quotes
37
+ Metrics/BlockLength:
38
+ Exclude:
39
+ - 'test/**/*'
@@ -0,0 +1,74 @@
1
+ # Changelog
2
+
3
+ ## 2.0.0
4
+
5
+ Refactored code and functionality. The library was refactored in a way you need to instantiate a client with the API key to use it (more info in "Breaking changes"). 100% of the documented API is now supported and implemented.
6
+
7
+ The base API Response includes the `remaining_monthly_allowance` for your API key, `extra_allowance` and `allowance_refresh_timer`. These values are updated on the client instance on every request so you can use `client.remaining_monthly_client` to check how many requests the API key has left.
8
+
9
+ ### New APIs
10
+
11
+ - `developers`
12
+ - `games_update`
13
+ - `genres`
14
+ - `platforms_by_name`
15
+ - `platforms_images`
16
+ - `publishers`
17
+
18
+
19
+ ### Breaking changes:
20
+
21
+ - Dropped support for Ruby 2.4. The gem might still work on Ruby 2.4, but it's not being regularly tested for any version lower than 2.5.
22
+
23
+ - You now need to instantiate the Gamesdb::Client class passing in the api_key. E.g:
24
+
25
+ ```ruby
26
+ > client = Gamesdb::Client.new(ENV['GAMESDB_API_KEY'])
27
+
28
+
29
+ > client = Gamesdb::Client.new('my_api_key')
30
+ > client.platforms
31
+ ...
32
+ ```
33
+
34
+ - Changes in methods:
35
+
36
+ - `platform_by_id` changes to `platforms_by_id`.
37
+ - `game_by_id` changes to `games_by_id`.
38
+ - `game_images` changes to `games_images`.
39
+ These APIs now support a string of comma delimited ids as parameters as well as the id Integer.
40
+
41
+
42
+ ## 1.2.0
43
+ - Raise ArgumentError if api key isn't present
44
+
45
+ ## 1.1.2
46
+ * Internal changes: update API endpoint url (adds `v1`), update tests
47
+
48
+ ## 1.1.1
49
+ * Adds `platform_id` parameter to `games_by_name`
50
+ * Adds `page` parameter to `games_by_name`
51
+ * Adds extra fields and boxart to `games_by_name` response
52
+ * Refactors `process_platform_games`
53
+
54
+ ## 1.1.0
55
+ * Adds `page` parameter to `games_by_platform_id` and includes `boxart`.
56
+ * Adds all available fields from Platforms in `platforms`, updates tests. Changes `:slug` to `:alias` in platforms response, to map to same response from API.
57
+ * Refactored `json_response` to use `includes` and extra data from the API response.
58
+
59
+ ## 1.0.0
60
+
61
+ * Updated to new API endpoint, API key is now required to use the gem. Request an API Key here: https://forums.thegamesdb.net/viewforum.php?f=10
62
+ * Legacy API no longer supported since it's been shutdown.
63
+ * Since the API has changed, some endpoints are no longer supported and some new ones are supported.
64
+ * Removed ox dependency, the new returns JSON instead of XML.
65
+
66
+ ## 0.2.0
67
+
68
+ * The API endpoint has been updated, so this release updates the API endpoint to the legacy.
69
+ * Updates the way the incoming XML is parsed, so more fields are available from the raw API response. It's also easier to parse using a different method from `ox` than before.
70
+ * No longer supports Ruby 2.2, it's out of support life.
71
+
72
+ ## Previous versions
73
+
74
+ Implements GetGamesList, GetGame, GetArt, GetPlatformsList, GetPlatform, GetPlatformGames, PlatformGames from the original API.
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in gamesdb.gemspec
data/README.md CHANGED
@@ -1,19 +1,40 @@
1
- # Gamesdb
1
+ # Gamesdb 🎮 🕹
2
2
  A Ruby gem to interact with [TheGamesDB](http://thegamesdb.net) API.
3
3
 
4
- It's currently using [the legacy API](http://wiki.thegamesdb.net/index.php/API_Introduction) which is available in read only mode [More info](https://forums.thegamesdb.net/viewtopic.php?f=11&t=86). But it'll be updated to use [the new API endpoints](https://api.thegamesdb.net/), for which you'll need to request an API key. I'll keep a way to use the legacy API with a Legacy module anyways.
5
-
6
- [![Build Status](https://api.travis-ci.com/picandocodigo/gamesdb.svg?branch=master)](https://travis-ci.com/picandocodigo/gamesdb)
7
-
8
- ## Installation
9
-
10
- This gem requires Ruby version 2.3 or more.
11
-
12
- Add this line to your application's Gemfile:
4
+ The Legacy API has been shutdown. The gem is now using the new API and you need to [request an API key](https://forums.thegamesdb.net/viewforum.php?f=10) to use it.
5
+
6
+ ![Build Status](https://github.com/picandocodigo/gamesdb/workflows/Tests/badge.svg?branch=master)
7
+ [![Gem Version](https://badge.fury.io/rb/thegamesdb.svg)](https://badge.fury.io/rb/thegamesdb)
8
+ [![Maintainability](https://api.codeclimate.com/v1/badges/2dcf3cdcbe37adcea569/maintainability)](https://codeclimate.com/github/picandocodigo/gamesdb/maintainability)
9
+
10
+ * [Installation and Quick Start](#installation-and-quick-start)
11
+ * [General Usage](#usage)
12
+ * [Games](#games)
13
+ * [Games/ByGameID](#gamesbygameid)
14
+ * [Games/ByGameName](#gamesbygamename)
15
+ * [Games/ByGamePlaformID](#gamesbyplatformid)
16
+ * [Games/Images](#gamesimages)
17
+ * [Games/Updates](#gamesupdates)
18
+ * [Platforms](#platforms)
19
+ * [Platforms](#platforms-1)
20
+ * [Platforms/ByPlatformID](#platformsbyplatformid)
21
+ * [Platforms/ByPlatformName](#platformsbyplatformname)
22
+ * [Platforms/Images](#platformsimages)
23
+ * [Genres](#genres)
24
+ * [Developers](#developers)
25
+ * [Publishers](#publishers)
26
+ * [RubyDoc](https://www.rubydoc.info/gems/thegamesdb)
27
+ * [Development](#development)
28
+ * [Contributing](#contributing)
29
+
30
+
31
+ ## Installation and Quick Start
32
+
33
+ This gem requires Ruby version 2.5 or more. Add this line to your application's Gemfile:
13
34
 
14
35
  gem 'thegamesdb'
15
36
 
16
- And then run:
37
+ And run:
17
38
 
18
39
  $ bundle install
19
40
 
@@ -21,239 +42,366 @@ Or install it in your system with:
21
42
 
22
43
  $ gem install thegamesdb
23
44
 
45
+ To use this library, you'll need to request an API Key [here](https://forums.thegamesdb.net/viewforum.php?f=10). Once you have an API key, you can instantiate a Client:
46
+
47
+ ```ruby
48
+ > client = Gamesdb::Client.new('<API_KEY>')
49
+ > response = client.platforms
50
+ ```
51
+
52
+ **API Key allowances**
53
+
54
+ The base API Response includes the `remaining_monthly_allowance` for your API key, `extra_allowance` and `allowance_refresh_timer`. These values are updated on the client instance on every request so you can use `client.remaining_monthly_client` to check how many requests the API key has left.
55
+
24
56
  ## Usage
25
57
 
26
- For now you can use most of the API:
58
+ The full documentation for the API is available [here](API Documentation: https://api.thegamesdb.net/). Here are the endpoints available on the gem:
59
+
60
+ ### Games
61
+
27
62
 
28
- | API call | gem call |
29
- |------------------| ----|
30
- | [GetGamesList](http://wiki.thegamesdb.net/index.php/GetGamesList) | [Get Games List](#get-games-list) |
31
- | [GetGame](http://wiki.thegamesdb.net/index.php/GetGame) | [Get Game](#get-game) |
32
- | [GetArt](http://wiki.thegamesdb.net/index.php/GetArt) | [Get Art](#get-art) |
33
- | [GetPlatformsList](http://wiki.thegamesdb.net/index.php/GetPlatformsList) | [Get Platforms](#get-platforms) |
34
- | [GetPlatform](http://wiki.thegamesdb.net/index.php/GetPlatform) | [Get Platform](#get-platform) |
35
- | [GetPlatformGames](http://wiki.thegamesdb.net/index.php/GetPlatformGames) | [Get Platform Games](#get-platform-games-or-platform-games) |
36
- | [PlatformGames](http://wiki.thegamesdb.net/index.php/PlatformGames) | [Platform Games](#get-platform-games-or-platform-games) |
37
- | [Updates](http://wiki.thegamesdb.net/index.php/Updates) | _Not implemented yet_ |
38
- | [UserRating](http://wiki.thegamesdb.net/index.php/UserRating) | _Not implemented yet_ |
39
- | [UserFavorites](http://wiki.thegamesdb.net/index.php/UserFavorites) | _Not implemented yet_ |
63
+ #### Games/ByGameID
64
+ - **[RubyDoc](https://www.rubydoc.info/github/picandocodigo/gamesdb/master/Gamesdb/Games#games_by_id-instance_method)**
65
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Games/GamesByGameID)**
40
66
 
41
- ### Get Platforms
42
- http://wiki.thegamesdb.net/index.php?title=GetPlatformsList
43
- >The GetGamesList API search returns a listing of a listing of all platforms available on the site, sorted by alphabetical order of name.
67
+ Usage:
44
68
 
45
- **Usage**
69
+ ```ruby
70
+ > client.games_by_id(6177)
71
+ => {
72
+ :id=>6177,
73
+ :game_title=>"Super Turrican",
74
+ :release_date=>"1993-05-01",
75
+ :platform=>6,
76
+ :players=>1,
77
+ :overview=>"Super Turrican is the next generation installment of the famous Turrican Series. Once again it is up to the U.S.S. Freedom Forces to get into their Turrican Assault Suits and drive back the forces of \"The Machine\".\r\n\r\nSimilar to it's predecessors, Super Turican features large levels that are crammed with secrets and can be explored freely and in any direction. To get rid of the numerous enemies, Turrican can use three upgradeable shots: A spreadshot, a powerful laser and a rebound that bounces off of walls. Additionally, there is a Freeze-Beam that can be used to temporarily freeze enemies. It is fully rotatable, and therefor also a great help in discovering secret capsules. These capsules contain powerups and can often be used to reach secret areas. Last but not least, Turrican has the ability to transform into an energy wheel (as long as he has enough special energy), which enables him to lay mines and even makes him invincible.",
78
+ :last_updated=>"2018-07-11 21:05:25",
79
+ :rating=>"T - Teen",
80
+ :coop=>"No",
81
+ :youtube=>nil,
82
+ :os=>nil,
83
+ :processor=>nil,
84
+ :ram=>nil,
85
+ :hdd=>nil,
86
+ :video=>nil,
87
+ :sound=>nil,
88
+ :developers=>[2976],
89
+ :genres=>[8],
90
+ :publishers=>[454],
91
+ :alternates=>nil
92
+ }
93
+ ```
46
94
 
47
- * Parameters: none
48
- * Returns: Array with platforms info in Hashes with `:id`, `:name` and `:slug`.
95
+ Supports both an Array of ids or comma delimited list:
49
96
 
50
97
  ```ruby
51
- $ rake console
52
- irb(main):001:0> Gamesdb.platforms
53
- => [{:name=>"3DO", :id=>25, :slug=>"3do"},
54
- {:name=>"Acorn Archimedes", :id=>4944, :slug=>"acorn-archimedes"},
55
- {:name=>"Acorn Electron", :id=>4954, :slug=>"acorn-electron"},
56
- {:name=>"Action Max", :id=>4976, :slug=>"action-max"},
57
- {:name=>"Amiga", :id=>4911, :slug=>"amiga"},
58
- {:name=>"Amiga CD32", :id=>4947, :slug=>"amiga-cd32"},
59
- {:name=>"Amstrad CPC", :id=>4914, :slug=>"amstrad-cpc"},
60
- {:name=>"Android", :id=>4916, :slug=>"android"},
61
- {:name=>"APF MP-1000", :id=>4969, :slug=>"apf-mp-1000"},
62
- {:name=>"Apple II", :id=>4942, :slug=>"apple2"},
63
- {:name=>"Arcade", :id=>23, :slug=>"arcade"},
64
- {:name=>"Atari 2600", :id=>22, :slug=>"atari-2600"},
65
- {:name=>"Atari 5200", :id=>26, :slug=>"atari-5200"},
66
- {:name=>"Atari 7800", :id=>27, :slug=>"atari-7800"},
67
- {:name=>"Atari 800", :id=>4943, :slug=>"atari800"},
68
- {:name=>"Atari Jaguar", :id=>28, :slug=>"atari-jaguar"},
98
+ > client.games_by_id("6177, 6178")
99
+ => [
100
+ {:id=>6177, :game_title=>"Super Turrican", :release_date=>"1993-05-01", :platform=>6, :players=>1, :overview=>"Super Turrican is the next generation installment of the famous Turrican Series. Once again it is up to the U.S.S. Freedom Forces to get into their Turrican Assault Suits and drive back the forces of \"The Machine\".\r\n\r\nSimilar to it's predecessors, Super Turican features large levels that are crammed with secrets and can be explored freely and in any direction. To get rid of the numerous enemies, Turrican can use three upgradeable shots: A spreadshot, a powerful laser and a rebound that bounces off of walls. Additionally, there is a Freeze-Beam that can be used to temporarily freeze enemies. It is fully rotatable, and therefor also a great help in discovering secret capsules. These capsules contain powerups and can often be used to reach secret areas. Last but not least, Turrican has the ability to transform into an energy wheel (as long as he has enough special energy), which enables him to lay mines and even makes him invincible.", :last_updated=>"2018-07-11 21:05:25", :rating=>"T - Teen", :coop=>"No", :youtube=>nil, :os=>nil, :processor=>nil, :ram=>nil, :hdd=>nil, :video=>nil, :sound=>nil, :developers=>[2976], :genres=>[8], :publishers=>[454], :alternates=>nil},
101
+ {:id=>6178, :game_title=>"Super Turrican 2", :release_date=>"1995-11-01", :platform=>6, :players=>1, :overview=>"Twice the Firepower, Twice the burn.\r\n\r\nIf you haven’t played Super Turrican, chances are you won’t last past the intro sequence here... As an intergalactic hero-wannabe commissioned to crush a venomous mutant armada, you are thrust into a chaotic world even more violent than the original. This time there are more enemies to torch (and be torched by)-including the most heinous level bosses on 16-bit-and enough Mode7 graphic levels to make you wish mommy were there to hold your hand. But she’ll be busy cleaning up your charred carcass.\r\n\r\nSuper Turrican 2. Feel the burn.", :last_updated=>"2019-01-24 13:38:26", :rating=>"T - Teen", :coop=>"No", :youtube=>"", :os=>nil, :processor=>nil, :ram=>nil, :hdd=>nil, :video=>nil, :sound=>nil, :developers=>[2976], :genres=>[8], :publishers=>[43], :alternates=>nil}
102
+ ]
69
103
  ```
70
104
 
71
- ### Get Platform Games OR Platform Games
72
- The same method implements `GetPlatformGames` and `PlatformGames`. The first receives the platform id as a parameter, the second one receives the slug. You can find the slug with the GetPlatform method. The return is the same for both methods.
105
+ #### Games/ByGameName
73
106
 
74
- http://wiki.thegamesdb.net/index.php?title=GetPlatformGames
75
- >The GetPlatformGames API method returns a listing of all games available on the site for the given platform.
107
+ - **[RubyDoc](https://www.rubydoc.info/github/picandocodigo/gamesdb/master/Gamesdb/Games#games_by_name-instance_method)**
108
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Games/GamesByGameName)**
76
109
 
77
- http://wiki.thegamesdb.net/index.php/PlatformGames
78
- >The PlatformGames API call lists all games under a certain platform.
110
+ Usage:
79
111
 
80
- * Parameters:
81
- * id - the integer id of the required platform, as retrived from GetPlatformsList
82
- * platform (string) : the platform slug to list games for (for more information on how to attain a valid platform slug see GetPlatformsList)
112
+ ```ruby
113
+ > client.games_by_name("Mario Kart")
114
+ => [
115
+ {:id=>266, :game_title=>"Mario Kart 64", :release_date=>"1997-02-10", :platform=>3, :developers=>[6037]},
116
+ {:id=>47050, :game_title=>"Mario Kart 64", :release_date=>"2016-12-29", :platform=>38, :developers=>[6037]},
117
+ {:id=>55187, :game_title=>"Mario Kart 64 (VC)", :release_date=>"2007-01-29", :platform=>9, :developers=>[6041]},
118
+ {:id=>64547, :game_title=>"Mario Kart 64 [Not for Resale]", :release_date=>"1997-02-10", :platform=>3, :developers=>nil},
119
+ {:id=>12733, :game_title=>"Mario Kart 7", :release_date=>"2011-12-04", :platform=>4912, :developers=>[7160]},
120
+ {:id=>17444, :game_title=>"Mario Kart 8", :release_date=>"2014-05-30", :platform=>38, :developers=>[6037]},
121
+ {:id=>42294, :game_title=>"Mario Kart 8 Deluxe", :release_date=>"2017-04-28", :platform=>4971, :developers=>[6037]},
122
+ {:id=>10750, :game_title=>"Mario Kart Arcade GP", :release_date=>"2005-10-12", :platform=>23, :developers=>[5804]}, ...
123
+ ]
124
+ ```
125
+ #### Games/ByPlatformID
83
126
 
84
- * Returns: Array with games info in Hashes with `:id`, `:name` and `:release_date`.
127
+ - **[RubyDoc](https://www.rubydoc.info/github/picandocodigo/gamesdb/master/Gamesdb/Games#games_by_platform_id-instance_method)**
128
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Games/GamesByPlatformID)**
85
129
 
86
- With id:
130
+ Usage:
87
131
 
88
132
  ```ruby
89
- irb(main):002:0> Gamesdb.platform_games(6)
90
- => [{:name=>"Super Mario Kart", :id=>41, :release_date=>"09/01/1992"},
91
- {:name=>"Final Fantasy III", :id=>83, :release_date=>"04/02/1994"},
92
- {:name=>"Contra III: The Alien Wars", :id=>122, :release_date=>"04/06/1992"},
93
- {:name=>"Donkey Kong Country", :id=>131, :release_date=>"11/21/1994"},
94
- {:name=>"Super Mario World", :id=>136, :release_date=>"08/13/1991"},
95
- {:name=>"Super Mario World 2: Yoshi's Island", :id=>137, :release_date=>"10/04/1995"},
96
- {:name=>"Mega Man X", :id=>143, :release_date=>"01/21/1994"},
97
- {:name=>"Teenage Mutant Ninja Turtles IV: Turtles In Time", :id=>188, :release_date=>"08/01/1992"},
98
- ...
133
+ > client.games_by_platform_id(7)
134
+ => [
135
+ {:name=>"Donkey Kong", :id=>5, :release_date=>"1982-01-01", :developers=>[6037]},
136
+ {:name=>"Bionic Commando", :id=>76, :release_date=>"1988-12-06", :developers=>[1436]},
137
+ {:name=>"Super Mario Bros. 3", :id=>112, :release_date=>"1990-02-12", :developers=>[6055]},
138
+ {:name=>"The Legend of Zelda", :id=>113, :release_date=>"1987-07-01", :developers=>[6055]},
139
+ {:name=>"Kirby's Adventure", :id=>121, :release_date=>"1993-03-26", :developers=>[3694]},
140
+ {:name=>"Metroid", :id=>123, :release_date=>"1987-08-15", :developers=>[6051]},
141
+ {:name=>"Mega Man 5", :id=>125, :release_date=>"1992-12-04", :developers=>[1436]},
142
+ {:name=>"Kid Icarus", :id=>130, :release_date=>"1986-12-18", :developers=>[6037]},
143
+ {:name=>"Lemmings", :id=>133, :release_date=>"1991-02-14", :developers=>[2404]},
144
+ {:name=>"Castlevania", :id=>135, :release_date=>"1987-05-01", :developers=>[4765]},
145
+ {:name=>"Super Mario Bros.", :id=>140, :release_date=>"1985-09-13", :developers=>[6042]}, ...
146
+ ]
99
147
  ```
100
148
 
101
- With slug:
149
+ Supports comma delimited list:
102
150
 
103
151
  ```ruby
104
- irb(main):003:0> Gamesdb.platform_games("3do")
105
- => [
106
- {:name=>"Mad Dog McCree", :id=>6429, :release_date=>"01/01/1994"},
107
- {:name=>"AD&D: Slayer", :id=>3143, :release_date=>"01/01/1994"},
108
- {:name=>"Blade Force", :id=>4826, :release_date=>"04/05/1995"},
109
- {:name=>"Battle Chess", :id=>4829, :release_date=>"01/01/1993"},
110
- {:name=>"Brain Dead 13", :id=>4830, :release_date=>"01/01/1996"},
111
- {:name=>"Burning Soldier", :id=>4831, :release_date=>"11/01/1994"},
112
- {:name=>"Corpse Killer", :id=>4833, :release_date=>"01/01/1994"},
152
+ > client.games_by_platform_id("4950,4948")
113
153
  ```
114
154
 
115
- ### Get Platform
116
- http://wiki.thegamesdb.net/index.php/GetPlatform
117
- >This API feature returns a set of metadata and artwork data for a specified Platform ID.
155
+ #### Games/Images
118
156
 
119
- **Usage**
157
+ - **[RubyDoc](https://www.rubydoc.info/github/picandocodigo/gamesdb/master/Gamesdb/Games#games_images-instance_method)**
158
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Games/GamesImages)**
120
159
 
121
- * Parameters: id - The numeric ID of the platform in the GamesDB database
122
- * Returns: Hash with platform info
160
+ Usage:
123
161
 
124
162
  ```ruby
125
- irb(main):004:0> Gamesdb.platform(6)
126
- => {
127
- :id=>"6",
128
- :console=>"http://www.youtube.com/watch?v=6.png",
129
- :controller=>"http://www.youtube.com/watch?v=6.png",
130
- :overview=>"The Super Nintendo Entertainment System (also known as the Super NES, SNES or Super Nintendo) is a 16-bit video game console that was released by Nintendo in North America, Europe, Australasia (Oceania), and South America between 1990 and 1993. In Japan and Southeast Asia, the system is called the Super Famicom (officially adopting the abbreviated name of its predecessor, the Family Computer), or SFC for short. In South Korea, it is known as the Super Comboy and was distributed by Hyundai Electronics. Although each version is essentially the same, several forms of regional lockout prevent the different versions from being compatible with one another. The Super Nintendo Entertainment System was Nintendo&#039;s second home console, following the Nintendo Entertainment System (NES). The console introduced advanced graphics and sound capabilities compared with other consoles at the time. Additionally, development of a variety of enhancement chips (which were integrated on game circuit boards) helped to keep it competitive in the marketplace. The SNES was a global success, becoming the best-selling console of the 16-bit era despite its relatively late start and the fierce competition it faced in North America and Europe from Sega&#039;s Genesis console. The SNES remained popular well into the 32-bit era, and although Nintendo no longer offers factory repairs/replacement or accessories for the console, it continues to be popular among fans, collectors, retro gamers, and emulation enthusiasts, some of whom are still making homebrew ROM images.",
131
- :developer=>"Nintendo",
132
- :manufacturer=>"Nintendo",
133
- :cpu=>"16-bit 65c816 Ricoh 5A22 3.58 MHz",
134
- :memory=>"128kb",
135
- :sound=>"8-bit Sony SPC700",
136
- :display=>"512 \xC3\x97 239",
137
- :media=>"Cartridge",
138
- :maxcontrollers=>"2",
139
- :Youtube=>"http://www.youtube.com/watch?v=9fSAnVpJ42w",
140
- :Rating=>"7.8",
141
- :Images=>{
142
- :fanart=>[
143
- {:original=>[{:width=>"1920", :height=>"1080"}, "platform/fanart/6-1.jpg"], :thumb=>"platform/fanart/thumb/6-1.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "platform/fanart/6-2.jpg"], :thumb=>"platform/fanart/thumb/6-2.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "platform/fanart/6-3.jpg"], :thumb=>"platform/fanart/thumb/6-3.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "platform/fanart/6-4.jpg"], :thumb=>"platform/fanart/thumb/6-4.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "platform/fanart/6-5.jpg"], :thumb=>"platform/fanart/thumb/6-5.jpg"}
144
- ],
145
- :boxart=>[
146
- {:side=>"back", :width=>"500", :height=>"750"}, "platform/boxart/6-2.jpg"
147
- ],
148
- :banner=>[
149
- [{:width=>"760", :height=>"140"}, "platform/banners/6-1.png"],
150
- [{:width=>"760", :height=>"140"}, "platform/banners/6-2.jpg"]
151
- ],
152
- :consoleart=>"platform/consoleart/6.png",
153
- :controllerart=>"platform/controllerart/6.png"},
154
- :name=>"Super Nintendo (SNES)"
163
+ > client.games_images(121)
164
+ => {
165
+ :base_url=>"https://cdn.thegamesdb.net/images/original/",
166
+ :logo=>"clearlogo/121.png",
167
+ :boxart=>{
168
+ :front=>{:url=>"boxart/front/121-1.jpg", :resolution=>"1536x2100", :width=>"1536", :height=>"2100"},
169
+ :back=>{:url=>"boxart/back/121-1.jpg", :resolution=>"1539x2100", :width=>"1539", :height=>"2100"}
170
+ },
171
+ :screenshot=>[
172
+ {:id=>104578, :type=>"screenshot", :side=>nil, :filename=>"screenshots/121-1.jpg", :resolution=>nil},
173
+ {:id=>104580, :type=>"screenshot", :side=>nil, :filename=>"screenshots/121-2.jpg", :resolution=>nil}
174
+ ],
175
+ :fanart=>[
176
+ {:url=>"fanart/121-1.jpg", :resolution=>"1920x1080", :width=>"1920", :height=>"1080"},
177
+ {:url=>"fanart/121-2.jpg", :resolution=>"1920x1080", :width=>"1920", :height=>"1080"}
178
+ ]
155
179
  }
156
180
  ```
157
181
 
158
- ### Get Game
159
- http://wiki.thegamesdb.net/index.php?title=GetGame
160
- >The GetGameApi title search returns game data in an XML document or if an id is given it just returns the data for that specific game.
182
+ #### Games/Updates
161
183
 
162
- **Usage**
184
+ - **[RubyDoc](https://www.rubydoc.info/github/picandocodigo/gamesdb/master/Gamesdb/Games#games_update-instance_method)**
185
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Games/GamesUpdates)**
163
186
 
164
- * Parameters: id (int): ID representing a specific game
165
- * Returns: Array with games info in Hashes `:id`, `:title`, `:release_date`, `:platform`, `:overview`, `:publisher`, `:developer`, `:genres` (comma separated string), `:images {:front, :back}`
187
+ Usage:
166
188
 
167
189
  ```ruby
168
- irb(main):005:0> Gamesdb.game(109)
169
- => {
170
- :id=>109,
171
- :PlatformId=>"9",
172
- :ReleaseDate=>"11/19/2006",
173
- :Overview=>"Join Link for an legendary adventure on the Wii console. When an evil darkness enshrouds the land of Hyrule, a young farm boy named Link must awaken the hero \xE2\x80\x93 and the animal \xE2\x80\x93 within. When Link travels to the Twilight Realm, he transforms into a wolf and must scour the land with the help of a mysterious girl named Midna. Besides his trusty sword and shield, Link will use his bow and arrows by aiming with the Wii Remote controller, fight while on horseback and use a wealth of other items, both new and old. Features * Arm Link: The Wii Remote and Nunchuk controllers are used for a variety of game activities from fishing to projectile-weapon aiming. The game features incredibly precise aiming control using the Wii Remote controller. Use the controllers for sword swings, spin attacks and shield shoves. * Thrilling Adventure: Players ride into battle against troops of foul creatures and wield a sword and shield with the Wii Remote and Nunchuk controllers, then take on massive bosses that must be seen to be believed. * Mind & Muscle: Many puzzles stand between Link and the fulfillment of his quest, so players must sharpen their wits as they hunt for weapons and items.",
174
- :ESRB=>"T - Teen",
175
- :Genres=>{
176
- :genre=>["Action", "Adventure", "Platform", "Puzzle", "Role-Playing"]
177
- },
178
- :Players=>"1",
179
- :"Co-op"=>"No",
180
- :Youtube=>"http://www.youtube.com/watch?v=ceCktUEG4jA",
181
- :Publisher=>"Nintendo",
182
- :Developer=>"Nintendo",
183
- :Rating=>"6.85",
184
- :Similar=>{
185
- :SimilarCount=>"1",
186
- :Game=>{:id=>"5434", :PlatformId=>"2"}
187
- },
188
- :Images=>{
189
- :fanart=>[{:original=>[{:width=>"1920", :height=>"1080"}, "fanart/original/109-1.jpg"], :thumb=>"fanart/thumb/109-1.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "fanart/original/109-2.jpg"], :thumb=>"fanart/thumb/109-2.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "fanart/original/109-3.jpg"], :thumb=>"fanart/thumb/109-3.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "fanart/original/109-4.jpg"], :thumb=>"fanart/thumb/109-4.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "fanart/original/109-5.jpg"], :thumb=>"fanart/thumb/109-5.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "fanart/original/109-6.jpg"], :thumb=>"fanart/thumb/109-6.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "fanart/original/109-7.jpg"], :thumb=>"fanart/thumb/109-7.jpg"}, {:original=>[{:width=>"1920", :height=>"1080"}, "fanart/original/109-8.jpg"], :thumb=>"fanart/thumb/109-8.jpg"}],
190
- :boxart=>[
191
- [{:side=>"back", :width=>"1528", :height=>"2156", :thumb=>"boxart/thumb/original/back/109-1.jpg"},"boxart/original/back/109-1.jpg"],
192
- [{:side=>"front", :width=>"1529", :height=>"2156", :thumb=>"boxart/thumb/original/front/109-1.jpg"}, "boxart/original/front/109-1.jpg"]],
193
- :banner=>[[{:width=>"760", :height=>"140"}, "graphical/109-g.jpg"], [{:width=>"760", :height=>"140"}, "graphical/109-g2.png"]],
194
- :screenshot=>{:original=>[{:width=>"603", :height=>"310"}, "screenshots/109-1.jpg"], :thumb=>"screenshots/thumb/109-1.jpg"},
195
- :clearlogo=>[{:width=>"400", :height=>"277"}, "clearlogo/109.png"]
196
- },
197
- :name=>"The Legend of Zelda: Twilight Princess",
198
- :title=>"The Legend of Zelda: Twilight Princess",
199
- :platform=>"Nintendo Wii"}
190
+ > client.games_update(1000)
191
+ => {:updates=> [
192
+ {"edit_id"=>1001, "game_id"=>60054, "timestamp"=>"2018-07-02 05:54:36", "type"=>"publisher", "value"=>"Semi Secret Software"},
193
+ {"edit_id"=>1002, "game_id"=>60054, "timestamp"=>"2018-07-02 05:54:36", "type"=>"youtube", "value"=>""},
194
+ {"edit_id"=>1003, "game_id"=>60054, "timestamp"=>"2018-07-02 05:54:36", "type"=>"platform", "value"=>"4916"},
195
+ {"edit_id"=>1004, "game_id"=>60054, "timestamp"=>"2018-07-02 05:54:36", "type"=>"genre", "value"=>"|Action|"},
196
+ {"edit_id"=>1005, "game_id"=>60054, "timestamp"=>"2018-07-02 05:54:36", "type"=>"rating", "value"=>"E10+ - Everyone 10+"},
197
+ {"edit_id"=>1006, "game_id"=>60054, "timestamp"=>"2018-07-02 05:57:09", "type"=>"series", "value"=>"series/60054-1.jpg"},
198
+ {"edit_id"=>1007, "game_id"=>55249, "timestamp"=>"2018-07-02 05:57:17", "type"=>"boxart", "value"=>"boxart/front/55249-1.jpg"},
199
+ {"edit_id"=>1008, "game_id"=>60054, "timestamp"=>"2018-07-02 05:57:26", "type"=>"boxart", "value"=>"boxart/front/60054-1.jpg"},
200
+ {"edit_id"=>1009, "game_id"=>60055, "timestamp"=>"2018-07-02 05:57:37", "type"=>"game", "value"=>"[NEW]"},
201
+ {"edit_id"=>1010, "game_id"=>60055, "timestamp"=>"2018-07-02 05:57:37", "type"=>"game_title", "value"=>"Star Breaker"},
202
+ ...
203
+ ],
204
+ :previous_page=>nil,
205
+ :next_page=>2
206
+ }
207
+ ```
200
208
 
209
+ Pages:
210
+
211
+ ```ruby
212
+ >response = client.games_update(1000, page: 100)
213
+ => {:updates=> [
214
+ {"edit_id"=>11073, "game_id"=>36224, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[1044]},
215
+ {"edit_id"=>11074, "game_id"=>36229, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[1044]},
216
+ {"edit_id"=>11075, "game_id"=>36230, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[1044]},
217
+ {"edit_id"=>11076, "game_id"=>36252, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[47]},
218
+ {"edit_id"=>11077, "game_id"=>36284, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[1044]},
219
+ {"edit_id"=>11078, "game_id"=>36379, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[1044]},
220
+ {"edit_id"=>11079, "game_id"=>36740, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[171]},
221
+ {"edit_id"=>11080, "game_id"=>36757, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[731]},
222
+ {"edit_id"=>11081, "game_id"=>36777, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[309]},
223
+ {"edit_id"=>11082, "game_id"=>36785, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[731]},
224
+ ...
225
+ ],
226
+ :previous_page=>99,
227
+ :next_page=>101
228
+ }
229
+ >next_page = client.games_update(1000, page: response[:next_page])
230
+ => {:updates=> [
231
+ {"edit_id"=>11173, "game_id"=>48037, "timestamp"=>"2018-07-27 23:10:44", "type"=>"publishers", "value"=>[1044]},
232
+ ],
233
+ :previous_page=>100,
234
+ :next_page=>102
235
+ }
201
236
  ```
202
237
 
203
- ### Get Games List
204
- http://wiki.thegamesdb.net/index.php/GetGamesList
205
- >The GetGamesList API search returns a listing of games matched up with loose search terms. *Note: We have implemented special character stripping and loose word order searching in an attempt to provide better matching and a return a greater number of relevant hits.*
206
238
 
207
- **Usage**
239
+ ### Platforms
208
240
 
209
- * Parameters: name (String): search string.
210
- * Returns: Hash with game info: `:id`, `:name` (not-unique), `:release_date`, `platform`
241
+ #### Platforms
211
242
 
243
+ - **[RubyDoc](https://www.rubydoc.info/github/picandocodigo/gamesdb/master/Gamesdb/Platforms#platforms-instance_method)**
244
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Platforms/Platforms)**
245
+
246
+ Usage:
212
247
  ```ruby
213
- irb(main):006:0> Gamesdb.games_list "Asterix"
248
+ > client.platforms
214
249
  => [
215
- {:id=>330,:ReleaseDate=>"01/01/1993", :name=>"Asterix", :title=>"Asterix", :platform=>"Nintendo Entertainment System (NES)"},
216
- {:id=>2981, :ReleaseDate=>"01/01/1991", :name=>"Asterix", :title=>"Asterix", :platform=>"Sega Master System"},
217
- {:id=>3160, :ReleaseDate=>"01/01/1993", :name=>"Asterix", :title=>"Asterix", :platform=>"Super Nintendo (SNES)"},
218
- {:id=>9243, :ReleaseDate=>"01/01/1983", :name=>"Asterix", :title=>"Asterix", :platform=>"Atari 2600"},
219
- {:id=>21170, :ReleaseDate=>"06/11/1993", :name=>"Asterix", :title=>"Asterix", :platform=>"Nintendo Game Boy"},
220
- {:id=>21565, :ReleaseDate=>"07/01/1992", :name=>"Asterix", :title=>"Asterix", :platform=>"Arcade"},
221
- {:id=>498, :ReleaseDate=>"09/01/2000", :name=>"Asterix: The Gallic War", :title=>"Asterix: The Gallic War", :platform=>"Sony Playstation"},
222
- {:id=>1572, :ReleaseDate=>"09/28/1995", :name=>"Asterix & Obelix", :title=>"Asterix & Obelix", :platform=>"Super Nintendo (SNES)"},
223
- {:id=>18225, :ReleaseDate=>"07/15/1999", :name=>"Asterix & Obelix", :title=>"Asterix & Obelix", :platform=>"Nintendo Game Boy Color"},
250
+ {:name=>"3DO", :id=>25, :slug=>"3do"},
251
+ {:name=>"Acorn Archimedes", :id=>4944, :slug=>"acorn-archimedes"},
252
+ {:name=>"Acorn Electron", :id=>4954, :slug=>"acorn-electron"},
253
+ {:name=>"Action Max", :id=>4976, :slug=>"action-max"},
254
+ {:name=>"Amiga", :id=>4911, :slug=>"amiga"},
255
+ {:name=>"Amiga CD32", :id=>4947, :slug=>"amiga-cd32"},
256
+ {:name=>"Amstrad CPC", :id=>4914, :slug=>"amstrad-cpc"},
257
+ {:name=>"Android", :id=>4916, :slug=>"android"},
258
+ ...
224
259
  ```
225
260
 
226
- ### Get Art
227
- http://wiki.thegamesdb.net/index.php/GetArt
228
- >This API feature returns a list of available artwork types and locations specific to the requested game id in the database. It also lists the resolution of any images available.
229
-
230
- **Usage**
261
+ #### Platforms/ByPlatformID
231
262
 
232
- * Parameters: id (integer): The numeric ID of the game in Gamesdb
233
- * Returns: Hash with images: `logo`, `boxart` (Hash - front, back), `screenshots`, `fanart`
263
+ - **[RubyDoc](https://www.rubydoc.info/github/picandocodigo/gamesdb/master/Gamesdb/Platforms#platforms_by_id-instance_method)**
264
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Platforms/PlatformsByPlatformID)**
234
265
 
266
+ Usage:
235
267
  ```ruby
236
- irb(main):007:0> Gamesdb.art(2208)
237
- => {
238
- :boxart=>{
239
- :back=>{:url=>"boxart/original/back/2208-1.jpg", :width=>"800", :height=>"569", :thumb=>"boxart/thumb/original/back/2208-1.jpg"},
240
- :front=>{:url=>"boxart/original/front/2208-1.jpg", :width=>"2099", :height=>"1513", :thumb=>"boxart/thumb/original/front/2208-1.jpg"}
241
- },
242
- :screenshot=>[
243
- {:original=>[{:width=>"768", :height=>"672"}, "screenshots/2208-1.jpg"], :thumb=>"screenshots/thumb/2208-1.jpg"},
244
- {:original=>[{:width=>"768", :height=>"672"}, "screenshots/2208-2.jpg"], :thumb=>"screenshots/thumb/2208-2.jpg"},
245
- {:original=>[{:width=>"768", :height=>"672"}, "screenshots/2208-3.jpg"], :thumb=>"screenshots/thumb/2208-3.jpg"}
246
- ],
247
- :clearlogo=>[{:width=>"400", :height=>"44"}, "clearlogo/2208.png"],
248
- :logo=>"clearlogo/2208.png"
268
+ > client.platform_by_id(7)
269
+ => {
270
+ :id=>7,
271
+ :name=>"Nintendo Entertainment System (NES)",
272
+ :alias=>"nintendo-entertainment-system-nes",
273
+ :icon=>"nintendo-entertainment-system-nes-1336524652.png",
274
+ :console=>"7.png",
275
+ :controller=>"7.png",
276
+ :developer=>"Nintendo",
277
+ :manufacturer=>"Nintendo",
278
+ :media=>"Cartridge",
279
+ :cpu=>"Ricoh 2A03",
280
+ :memory=>"2KB RAM",
281
+ :graphics=>"RP2C02",
282
+ :sound=>"Pulse Code Modulation",
283
+ :maxcontrollers=>"2",
284
+ :display=>"RGB",
285
+ :overview=>"The Nintendo Entertainment System (also abbreviated as NES or simply called Nintendo) is an 8-bit video game console that was released by Nintendo in North America during 1985, in Europe during 1986 and Australia in 1987. In most of Asia, including Japan (where it was first launched in 1983), China, Vietnam, Singapore, the Middle East and Hong Kong, it was released as the Family Computer, commonly shortened as either the romanized contraction Famicom, or abbreviated to FC. In South Korea, it was known as the Hyundai Comboy, and was distributed by Hynix which then was known as Hyundai Electronics.\r\n\r\nAs the best-selling gaming console of its time, the NES helped revitalize the US video game industry following the video game crash of 1983, and set the standard for subsequent consoles of its generation. With the NES, Nintendo introduced a now-standard business model of licensing third-party developers, authorizing them to produce and distribute software for Nintendo&#039;s platform.",
286
+ :youtube=>nil
249
287
  }
250
- ```
288
+ ```
289
+
290
+ #### Platforms/ByPlatformName
291
+
292
+ - **[RubyDoc](https://www.rubydoc.info/github/picandocodigo/gamesdb/master/Gamesdb/Platforms#platforms_by_name-instance_method)**
293
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Platforms/PlatformsByPlatformName)**
294
+
295
+ Usage:
296
+ ```ruby
297
+ > client.platforms_by_name("Nintendo")
298
+ => [
299
+ {:id=>4912, :name=>"Nintendo 3DS", :alias=>"nintendo-3ds", :icon=>"nintendo-3ds-1344286647.png", :console=>"4912.png", :controller=>nil, :developer=>"Nintendo", :manufacturer=>"Nintendo", :media=>"Cartridge", :cpu=>"Nintendo ARM", :memory=>"128 MB FCRAM", :graphics=>"PICA200 by Digital Media Professionals", :sound=>nil, :maxcontrollers=>"1", :display=>"800 × 240 px (effectively 400 × 240 WQVGA per eye)", :overview=>"...", :youtube=>nil},
300
+ {:id=>3, :name=>"Nintendo 64", :alias=>"nintendo-64", :icon=>"nintendo-64-1336524631.png", :console=>"3.png", :controller=>"3.png", :developer=>"Nintendo", :manufacturer=>"Nintendo", :media=>"Cartridge", :cpu=>"93.75 MHz NEC VR4300", :memory=>"4 MB RDRAM (8 MB with Expansion Pack)", :graphics=>"62.5 MHz SGI RCP", :sound=>"48 kHz with 16-bit audio", :maxcontrollers=>"4", :display=>"320 x 240 or 640 x 480 (supported by Expansion Pack)", :overview=>"...", :youtube=>"Up9jO2l2wqo"},
301
+ {:id=>8, :name=>"Nintendo DS", :alias=>"nintendo-ds", :icon=>"nintendo-ds-1336524642.png", :console=>"8.png", :controller=>nil, :developer=>"Nintendo", :manufacturer=>"Foxconn", :media=>"Cartridge", :cpu=>"ARM9", :memory=>"4 MB RAM", :graphics=>"ARM946E-S", :sound=>"ARM7TDMI", :maxcontrollers=>"1", :display=>"256 × 192", :overview=>"...", :youtube=>nil},
302
+ {:id=>7, :name=>"Nintendo Entertainment System (NES)", :alias=>"nintendo-entertainment-system-nes", :icon=>"nintendo-entertainment-system-nes-1336524652.png", :console=>"7.png", :controller=>"7.png", :developer=>"Nintendo", :manufacturer=>"Nintendo", :media=>"Cartridge", :cpu=>"Ricoh 2A03", :memory=>"2KB RAM", :graphics=>"RP2C02", :sound=>"Pulse Code Modulation", :maxcontrollers=>"2", :display=>"RGB", :overview=>"..."}, (...)
303
+ ]
304
+ ```
305
+
306
+ #### Platforms/Images
307
+
308
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Platforms/PlatformsImages)**
309
+
310
+ Usage:
311
+ ```ruby
312
+ > client.platform_images(7)
313
+ => [
314
+ {"id"=>22, "type"=>"banner", "filename"=>"platform/banners/7-1.png"},
315
+ {"id"=>38, "type"=>"fanart", "filename"=>"platform/fanart/7-1.jpg"},
316
+ {"id"=>39, "type"=>"fanart", "filename"=>"platform/fanart/7-2.jpg"},
317
+ {"id"=>60, "type"...
318
+ ```
319
+
320
+ Using a filter for type:
321
+ ```ruby
322
+ > client.platform_images(7, filter: 'boxart')
323
+ => [{"id"=>222, "type"=>"boxart", "filename"=>"platform/boxart/7-2.jpg"}]
324
+ ```
325
+
326
+ ### Genres
327
+
328
+ - **[RubyDoc](https://www.rubydoc.info/github/picandocodigo/gamesdb/master/Gamesdb/Genres#genres-instance_method)**
329
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Genres/Genres)**
330
+
331
+ Usage:
332
+
333
+ ```ruby
334
+ > client.genres
335
+ => [
336
+ {"id"=>1, "name"=>"Action"},
337
+ {"id"=>2, "name"=>"Adventure"},
338
+ {"id"=>20, "name"=>"Board"},
339
+ {"id"=>3, "name"=>"Construction and Management Simulation"},
340
+ {"id"=>21, "name"=>"Education"},
341
+ ...
342
+ ]
343
+
344
+ ```
345
+
346
+ ### Developers
347
+
348
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Developers/Developers)**
349
+
350
+ Usage:
351
+
352
+ ```ruby
353
+ > client.developers
354
+ => [
355
+ {"id"=>142, "name"=>"?"},
356
+ {"id"=>9916, "name"=>".dat"},
357
+ {"id"=>2, "name"=>".theprodukkt"},
358
+ {"id"=>9898, "name"=>"[adult swim] games"},
359
+ {"id"=>9899, "name"=>"[bracket]games"},
360
+ {"id"=>9900, "name"=>"[erka:es]"},
361
+ {"id"=>10472, "name"=>"[RON]"},
362
+ {"id"=>9901, "name"=>"][ Games Inc"},
363
+ {"id"=>145, "name"=>"@nifty"},
364
+ ...
365
+ ]
366
+ ```
367
+
368
+ ### Publishers
369
+
370
+ - **[Swagger API Documentation](https://api.thegamesdb.net/#/Publishers/Publishers)**
371
+
372
+ Usage:
373
+
374
+ ```ruby
375
+ > client.publishers
376
+ => [
377
+ {"id"=>2374, "name"=>".GEARS Studios"},
378
+ {"id"=>2090, "name"=>"1-Pup Games"},
379
+ {"id"=>4045, "name"=>"10 out of 10"},
380
+ {"id"=>5898, "name"=>"10Ants Hill"},
381
+ {"id"=>3542, "name"=>"10tons Ltd."},
382
+ {"id"=>1188, "name"=>"11 bit studios"},
383
+ ...
384
+ ]
385
+ ```
386
+
387
+ ## Development
388
+
389
+ Run all tests:
390
+
391
+ ```
392
+ GAMESDB_API_KEY='your_api_key' rake test
393
+ ```
394
+
395
+ Run a single test:
396
+ ```
397
+ GAMESDB_API_KEY='your_api_key' rake test TEST=test/platform_test.rb
398
+ ```
251
399
 
252
400
  ## Contributing
253
401
 
254
402
  1. Fork it ( http://github.com/picandocodogio/gamesdb/fork )
255
403
  2. Create your feature branch (`git checkout -b my-new-feature`)
256
- 3. Write your tests and run `rake test` (make sure they pass)
404
+ 3. Write your tests and run `GAMESDB_API_KEY='your_api_key' rake test` (make sure they pass)
257
405
  4. Commit your changes (`git commit -am 'Add some feature'`)
258
406
  5. Push to the branch (`git push origin my-new-feature`)
259
407
  6. Create new Pull Request