igdb_api 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +73 -0
  3. data/lib/igdb/configuration/api.rb +36 -0
  4. data/lib/igdb/exceptions.rb +11 -0
  5. data/lib/igdb/models/api_resource.rb +50 -0
  6. data/lib/igdb/models/character.rb +4 -0
  7. data/lib/igdb/models/collection.rb +4 -0
  8. data/lib/igdb/models/company.rb +4 -0
  9. data/lib/igdb/models/franchise.rb +4 -0
  10. data/lib/igdb/models/game.rb +4 -0
  11. data/lib/igdb/models/game_engine.rb +4 -0
  12. data/lib/igdb/models/game_mode.rb +4 -0
  13. data/lib/igdb/models/genre.rb +4 -0
  14. data/lib/igdb/models/keyword.rb +4 -0
  15. data/lib/igdb/models/person.rb +4 -0
  16. data/lib/igdb/models/platform.rb +4 -0
  17. data/lib/igdb/models/player_perspective.rb +4 -0
  18. data/lib/igdb/models/pulse.rb +4 -0
  19. data/lib/igdb/models/release_date.rb +4 -0
  20. data/lib/igdb/models/review.rb +4 -0
  21. data/lib/igdb/models/theme.rb +4 -0
  22. data/lib/igdb/representers/alternative_name_representer.rb +6 -0
  23. data/lib/igdb/representers/base_representer.rb +14 -0
  24. data/lib/igdb/representers/character_representer.rb +11 -0
  25. data/lib/igdb/representers/collection_representer.rb +5 -0
  26. data/lib/igdb/representers/company_representer.rb +16 -0
  27. data/lib/igdb/representers/franchise_representer.rb +5 -0
  28. data/lib/igdb/representers/game_engine_representer.rb +9 -0
  29. data/lib/igdb/representers/game_mode_representer.rb +5 -0
  30. data/lib/igdb/representers/game_representer.rb +33 -0
  31. data/lib/igdb/representers/genre_representer.rb +5 -0
  32. data/lib/igdb/representers/image_representer.rb +8 -0
  33. data/lib/igdb/representers/keyword_representer.rb +5 -0
  34. data/lib/igdb/representers/person_representer.rb +12 -0
  35. data/lib/igdb/representers/platform_representer.rb +12 -0
  36. data/lib/igdb/representers/player_perspective_representer.rb +5 -0
  37. data/lib/igdb/representers/pulse_representer.rb +11 -0
  38. data/lib/igdb/representers/release_date_representer.rb +11 -0
  39. data/lib/igdb/representers/review_representer.rb +18 -0
  40. data/lib/igdb/representers/theme_representer.rb +5 -0
  41. data/lib/igdb/representers/video_representer.rb +6 -0
  42. data/lib/igdb/requester.rb +56 -0
  43. data/lib/igdb/version.rb +3 -0
  44. data/lib/igdb_api.rb +59 -0
  45. metadata +241 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8d2ec429620b0cd9f462a8a03a572659c1ef9067
4
+ data.tar.gz: cc3ac4783995ff688ad77570cf18c364c5961e12
5
+ SHA512:
6
+ metadata.gz: f32c2a63a4b27d9531f34585707de77ceccde234fc0527822272d0f7119e54b61cd3169fd3138dfe974c256dae514094473b4f60c31ed70bf2af4dfb3f7b125c
7
+ data.tar.gz: a3bd7776f1b7002bad59b151e59aa1d8ed905a8ad9ac2adec79be695a34cde70766599bfe699242c4372ce070559c334b22a0f9af4f3ae1dd0072a9a2b7141cd
@@ -0,0 +1,73 @@
1
+ # IGDB: Internet Game Database
2
+ [![Build Status](https://travis-ci.org/tastycake/igdb_api.svg?branch=master)](https://travis-ci.org/tastycake/igdb_api)
3
+ [![Code Climate](https://codeclimate.com/github/tastycake/igdb_api/badges/gpa.svg)](https://codeclimate.com/github/tastycake/igdb_api)
4
+ [![Test Coverage](https://codeclimate.com/github/tastycake/igdb_api/badges/coverage.svg)](https://codeclimate.com/github/tastycake/igdb_api/coverage)
5
+
6
+ ![Banner](http://orig08.deviantart.net/b5c1/f/2011/204/b/9/umvc3_roster_by_kiradaidohji-d41fyaq.png)
7
+
8
+ ## Installation
9
+ ```ruby
10
+ $ gem install igdb_api
11
+ ```
12
+ ## Usage
13
+
14
+ ##### Connect
15
+ ```ruby
16
+ $ Igdb.connect('api_key')
17
+ ```
18
+ ##### Game
19
+ Find game by ID
20
+ ```ruby
21
+ $ Igdb::Game.find(1971)
22
+ ```
23
+ Search for a game
24
+ ```ruby
25
+ $ Igdb::Game.search(query: 'batman')
26
+ ```
27
+ Return the number of games in the database
28
+ ```ruby
29
+ $ Igdb::Game.count
30
+ ```
31
+ Return a list of all games with an offset and/or limit
32
+ ```ruby
33
+ $ Igdb::Game.all
34
+ $ Igdb::Game.all(limit: 10) # Limit to 10 results - Default 100
35
+ $ Igdb::Game.all(offset: 5) # Offset result starting at 5th - Default 0
36
+ ```
37
+ ##### Person
38
+ Find person by ID or name
39
+ ```ruby
40
+ $ Igdb::Person.find(4)
41
+ $ Igdb::Person.find('derek-watts')
42
+ ```
43
+ Return the number of people in the database
44
+ ```ruby
45
+ $ Igdb::Person.count
46
+ ```
47
+ Return a list of all games with an offset and/or limit
48
+ ```ruby
49
+ $ Igdb::Person.all
50
+ $ Igdb::Person.all(limit: 10) # Limit to 10 results - Default 100
51
+ $ Igdb::Person.all(offset: 5) # Offset result starting at 5th - Default 0
52
+ ```
53
+ ##### Company
54
+ Find company by ID or name
55
+ ```ruby
56
+ $ Igdb::Company.find(70)
57
+ $ Igdb::Company.find('nintendo')
58
+ ```
59
+ Return the number of companies in the database.
60
+ ```ruby
61
+ $ Igdb::Company.count
62
+ ```
63
+ Return the games for a company
64
+ ```ruby
65
+ $ Igdb::Company.find('2000').games
66
+ ```
67
+ ## Contributing
68
+
69
+ 1. Fork it ( https://github.com/tastycake/igdb_api/fork )
70
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
71
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
72
+ 4. Push to the branch (`git push origin my-new-feature`)
73
+ 5. Create a new Pull Request
@@ -0,0 +1,36 @@
1
+ require 'singleton'
2
+
3
+ module Igdb::Configuration
4
+ class Api
5
+ include Singleton
6
+
7
+ DEFAULT_API_URL = 'https://igdbcom-internet-game-database-v1.p.mashape.com'
8
+
9
+ attr_reader :base_url, :api_key, :version
10
+
11
+ def initialize
12
+ self.version = 1.freeze
13
+ end
14
+
15
+ def connect(api_key)
16
+ @api_key = api_key
17
+ end
18
+
19
+ def api_url
20
+ @base_url || DEFAULT_API_URL
21
+ end
22
+
23
+ def set_api_url(url)
24
+ @base_url = url
25
+ end
26
+
27
+ def url_for(action, params={})
28
+ url = URI.parse "#{File.join(api_url, action)}/"
29
+ url.query = URI.encode_www_form(params) unless params.empty?
30
+ url.to_s
31
+ end
32
+
33
+ private
34
+ attr_writer :base_url, :api_key, :version
35
+ end
36
+ end
@@ -0,0 +1,11 @@
1
+ module Igdb::Exception
2
+ class Base < ::Exception
3
+ def initialize(message)
4
+ super(message)
5
+ end
6
+ end
7
+
8
+ class Api < Base; end
9
+ class ArgumentError < Base; end
10
+ class JsonParseError < Base; end
11
+ end
@@ -0,0 +1,50 @@
1
+ require 'representable/json'
2
+
3
+ class Igdb::ApiResource < OpenStruct
4
+ class << self
5
+ attr_accessor :path
6
+ attr_accessor :representer
7
+ end
8
+
9
+ def self.count
10
+ Igdb::Requester.get("#{self.path}/count")['count']
11
+ end
12
+
13
+ def self.find(id)
14
+ params = { fields: '*' }
15
+ build_single_resource(Igdb::Requester.get("#{self.path}/#{id}", params)[0], self.representer)
16
+ end
17
+
18
+ def self.search(opts={})
19
+ params = Hash.new.tap do |hash|
20
+ hash['search'] = opts[:query] if opts[:query]
21
+ hash['filters'] = opts[:filters] if opts[:filters]
22
+ hash['fields'] = '*'
23
+ end
24
+ build_collection(Igdb::Requester.get("#{self.path}", params), self.representer)
25
+ end
26
+
27
+ def self.all(opts={})
28
+ params = Hash.new.tap do |hash|
29
+ hash['offset'] = opts[:offset] || 0
30
+ hash['limit'] = opts[:limit] || 50
31
+ hash['fields'] = '*'
32
+ end
33
+ build_collection(Igdb::Requester.get("#{self.path}", params), self.representer)
34
+ end
35
+
36
+ private
37
+ def self.build_single_resource(response, representer)
38
+ self.new.extend(representer).from_hash(response)
39
+ end
40
+
41
+ def self.build_collection(response, representer)
42
+ response.reduce([]) do |resources, response|
43
+ resources << self.new.extend(representer).from_hash(response)
44
+ end
45
+ end
46
+
47
+ def build_for_collection(response, representer)
48
+ [].extend(representer.for_collection).from_hash(response)
49
+ end
50
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Character < Igdb::ApiResource
2
+ @path = 'characters'
3
+ @representer = Igdb::CharacterRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Collection < Igdb::ApiResource
2
+ @path = 'collections'
3
+ @representer = Igdb::CollectionRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Company < Igdb::ApiResource
2
+ @path = 'companies'
3
+ @representer = Igdb::CompanyRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Franchise < Igdb::ApiResource
2
+ @path = 'franchises'
3
+ @representer = Igdb::FranchiseRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Game < Igdb::ApiResource
2
+ @path = 'games'
3
+ @representer = Igdb::GameRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::GameEngine < Igdb::ApiResource
2
+ @path = 'game_engines'
3
+ @representer = Igdb::GameEngineRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::GameMode < Igdb::ApiResource
2
+ @path = 'game_modes'
3
+ @representer = Igdb::GameModeRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Genre < Igdb::ApiResource
2
+ @path = 'genres'
3
+ @representer = Igdb::GenreRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Keyword < Igdb::ApiResource
2
+ @path = 'keywords'
3
+ @representer = Igdb::KeywordRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Person < Igdb::ApiResource
2
+ @path = 'people'
3
+ @representer = Igdb::PersonRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Platform < Igdb::ApiResource
2
+ @path = 'platforms'
3
+ @representer = Igdb::PlatformRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::PlayerPerspective < Igdb::ApiResource
2
+ @path = 'player_perspectives'
3
+ @representer = Igdb::PlayerPerspectiveRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Pulse < Igdb::ApiResource
2
+ @path = 'pulses'
3
+ @representer = Igdb::PulseRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::ReleaseDate < Igdb::ApiResource
2
+ @path = 'release_dates'
3
+ @representer = Igdb::ReleaseDateRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Review < Igdb::ApiResource
2
+ @path = 'reviews'
3
+ @representer = Igdb::ReviewRepresenter
4
+ end
@@ -0,0 +1,4 @@
1
+ class Igdb::Theme < Igdb::ApiResource
2
+ @path = 'themes'
3
+ @representer = Igdb::ThemeRepresenter
4
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb::AlternativeNameRepresenter
2
+ include Representable::JSON
3
+
4
+ property :name
5
+ property :comment
6
+ end
@@ -0,0 +1,14 @@
1
+ module Igdb::BaseRepresenter
2
+ include Representable::JSON
3
+
4
+ def self.included(base)
5
+ base.include Representable::JSON
6
+ end
7
+
8
+ property :id
9
+ property :name
10
+ property :slug
11
+ property :url
12
+ property :created_at
13
+ property :updated_at
14
+ end
@@ -0,0 +1,11 @@
1
+ module Igdb::CharacterRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ property :mug_shot, extend: Igdb::ImageRepresenter, class: OpenStruct
5
+ property :gender
6
+ property :species
7
+
8
+ collection :akas
9
+ collection :games
10
+ collection :people
11
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb::CollectionRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ collection :games
5
+ end
@@ -0,0 +1,16 @@
1
+ module Igdb::CompanyRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ property :logo, extend: Igdb::ImageRepresenter, class: OpenStruct
5
+ property :description
6
+ property :country
7
+ property :website
8
+ property :start_date
9
+ property :start_date_category
10
+ property :changed_company_id
11
+ property :change_date_category
12
+ property :twitter
13
+
14
+ collection :published
15
+ collection :developed
16
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb::FranchiseRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ collection :games
5
+ end
@@ -0,0 +1,9 @@
1
+ module Igdb::GameEngineRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ property :logo, extend: Igdb::ImageRepresenter, class: OpenStruct
5
+
6
+ collection :games
7
+ collection :companies
8
+ collection :platforms
9
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb::GameModeRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ collection :games
5
+ end
@@ -0,0 +1,33 @@
1
+ module Igdb::GameRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ property :summary # Not documented in V1 API
5
+ property :storyline
6
+ property :collection
7
+ property :franchise
8
+ property :hypes
9
+ property :rating # The rating of the game.
10
+ property :rating_count
11
+ property :popularity
12
+ property :first_release_date # First release date of the game.
13
+ property :status
14
+ property :esrb
15
+ property :pegi
16
+ property :category
17
+ property :time_to_beat
18
+ property :game
19
+ property :cover, extend: Igdb::ImageRepresenter, class: OpenStruct # The cover image of the game.
20
+
21
+ collection :developers
22
+ collection :publishers
23
+ collection :genres
24
+ collection :game_engines
25
+ collection :player_perspectives
26
+ collection :game_modes
27
+ collection :keywords
28
+ collection :themes
29
+ collection :release_dates, extend: Igdb::ReleaseDateRepresenter, class: Igdb::ReleaseDate # The release dates of the game.
30
+ collection :videos, extend: Igdb::VideoRepresenter, class: OpenStruct # Not documented in v1 API
31
+ collection :screenshots, extend: Igdb::ImageRepresenter, class: OpenStruct # The list of screenshots of the game.
32
+ collection :alternative_names, extend: Igdb::AlternativeNameRepresenter, class: OpenStruct
33
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb::GenreRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ collection :games
5
+ end
@@ -0,0 +1,8 @@
1
+ module Igdb::ImageRepresenter
2
+ include Representable::JSON
3
+
4
+ property :url
5
+ property :cloudinary_id
6
+ property :width
7
+ property :height
8
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb::KeywordRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ collection :games
5
+ end
@@ -0,0 +1,12 @@
1
+ module Igdb::PersonRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ property :mug_shot, extend: Igdb::ImageRepresenter, class: OpenStruct
5
+ property :dob # The day of birth of the person ISO standard is followed.
6
+ property :country # The country of the person in http://en.wikipedia.org/wiki/ISO_3166-1_numeric .
7
+ property :bio # The bio of the person.
8
+
9
+ collection :games
10
+ collection :characters
11
+ collection :voice_acted
12
+ end
@@ -0,0 +1,12 @@
1
+ module Igdb::PlatformPresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ property :logo, extend: Igdb::ImageRepresenter, class: OpenStruct
5
+ property :website
6
+ property :summary
7
+ property :alternative_name
8
+ property :generation
9
+
10
+ collection :games
11
+ collection :versions
12
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb::PlayerPerspectiveRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ collection :games
5
+ end
@@ -0,0 +1,11 @@
1
+ module Igdb::PulseRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ property :category
5
+ property :title
6
+ property :summary
7
+ property :uid
8
+ property :published_at
9
+ property :image
10
+ property :author
11
+ end
@@ -0,0 +1,11 @@
1
+ module Igdb::ReleaseDateRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ property :category
5
+ property :platform
6
+ property :human
7
+ property :date
8
+ property :region
9
+ property :year, as: :y
10
+ property :month, as: :m
11
+ end
@@ -0,0 +1,18 @@
1
+ module Igdb::ReviewRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ property :username
5
+ property :title
6
+ property :game
7
+ property :category
8
+ property :likes
9
+ property :views
10
+ property :rating_category
11
+ property :platform
12
+ property :video
13
+ property :introduction
14
+ property :content
15
+ property :conclusion
16
+ property :positive_points
17
+ property :negative_points
18
+ end
@@ -0,0 +1,5 @@
1
+ module Igdb::ThemeRepresenter
2
+ include Igdb::BaseRepresenter
3
+
4
+ collection :games
5
+ end
@@ -0,0 +1,6 @@
1
+ module Igdb::VideoRepresenter
2
+ include Representable::JSON
3
+
4
+ property :name
5
+ property :video_id
6
+ end
@@ -0,0 +1,56 @@
1
+ require 'rest_client'
2
+
3
+ class Igdb::Requester
4
+ class << self
5
+
6
+ def get(action, params={})
7
+ url = api.url_for(action, params)
8
+ perform_request do
9
+ parse_response(RestClient.get(url, request_headers))
10
+ end
11
+ end
12
+
13
+ def post(action, params={}, form_data={})
14
+ url = api.url_for(action, params)
15
+ perform_request do
16
+ parse_response(RestClient.post(url, form_data.to_json, request_headers))
17
+ end
18
+ end
19
+
20
+ def delete(action)
21
+ url = api.url_for(action)
22
+ perform_request do
23
+ parse_response(RestClient.post(url, {}, request_headers))
24
+ end
25
+ end
26
+
27
+ private
28
+ def api
29
+ Igdb::Configuration::Api.instance
30
+ end
31
+
32
+ def perform_request(&block)
33
+ begin
34
+ block.call
35
+ rescue RestClient::Exception => e
36
+ raise Igdb::Exception::Api.new(e.message)
37
+ end
38
+ end
39
+
40
+ def request_headers
41
+ Hash.new.tap do |headers|
42
+ headers['Accept'] = 'text/json'
43
+ headers['Content-Type'] = 'text/json'
44
+ headers['X-Mashape-Key'] = api.api_key
45
+ end
46
+ end
47
+
48
+ def parse_response(response_body)
49
+ begin
50
+ JSON.parse(response_body)
51
+ rescue JSON::ParserError => e
52
+ raise Igdb::Exception::JsonParseError.new("Response body could not be parsed: #{e.message}")
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,3 @@
1
+ module Igdb
2
+ VERSION = "0.8.0"
3
+ end
@@ -0,0 +1,59 @@
1
+ module Igdb
2
+ #Utilities
3
+ autoload :Configuration, 'igdb/configuration/api'
4
+ autoload :Requester, 'igdb/requester'
5
+ autoload :Exception, 'igdb/exceptions'
6
+
7
+ #Models
8
+ autoload :ApiResource, 'igdb/models/api_resource'
9
+ autoload :Character, 'igdb/models/character'
10
+ autoload :Collection, 'igdb/models/collection'
11
+ autoload :Company, 'igdb/models/company'
12
+ autoload :Franchise, 'igdb/models/franchise'
13
+ autoload :Game, 'igdb/models/game'
14
+ autoload :GameEngine, 'igdb/models/game_engine'
15
+ autoload :GameMode, 'igdb/models/game_mode'
16
+ autoload :Genre, 'igdb/models/genre'
17
+ autoload :Keyword, 'igdb/models/keyword'
18
+ autoload :Person, 'igdb/models/person'
19
+ autoload :Platform, 'igdb/models/platform'
20
+ autoload :PlayerPerspective, 'igdb/models/player_perspective'
21
+ autoload :Pulse, 'igdb/models/pulse'
22
+ autoload :ReleaseDate, 'igdb/models/release_date'
23
+ autoload :Review, 'igdb/models/review'
24
+ autoload :Theme, 'igdb/models/theme'
25
+
26
+ #Presenters
27
+ autoload :BaseRepresenter, 'igdb/representers/base_representer'
28
+ autoload :AlternativeNameRepresenter, 'igdb/representers/alternative_name_representer'
29
+ autoload :CharacterRepresenter, 'igdb/representers/character_representer'
30
+ autoload :CollectionRepresenter, 'igdb/representers/collection_representer'
31
+ autoload :CompanyRepresenter, 'igdb/representers/company_representer'
32
+ autoload :FranchiseRepresenter, 'igdb/representers/franchise_representer'
33
+ autoload :GameEngineRepresenter, 'igdb/representers/game_engine_representer'
34
+ autoload :GameModeRepresenter, 'igdb/representers/game_mode_representer'
35
+ autoload :GameRepresenter, 'igdb/representers/game_representer'
36
+ autoload :GenreRepresenter, 'igdb/representers/genre_representer'
37
+ autoload :ImageRepresenter, 'igdb/representers/image_representer'
38
+ autoload :KeywordRepresenter, 'igdb/representers/keyword_representer'
39
+ autoload :PersonRepresenter, 'igdb/representers/person_representer'
40
+ autoload :PlatformRepresenter, 'igdb/representers/platform_representer'
41
+ autoload :PlayerPerspectiveRepresenter, 'igdb/representers/player_perspective_representer'
42
+ autoload :PulseRepresenter, 'igdb/representers/pulse_representer'
43
+ autoload :ReleaseDateRepresenter, 'igdb/representers/release_date_representer'
44
+ autoload :ReviewRepresenter, 'igdb/representers/review_representer'
45
+ autoload :ThemeRepresenter, 'igdb/representers/theme_representer'
46
+ autoload :VideoRepresenter, 'igdb/representers/video_representer'
47
+
48
+ def self.set_api_url(api_url)
49
+ Igdb::Configuration::Api.instance.tap do |api|
50
+ api.set_api_url(api_url)
51
+ end
52
+ end
53
+
54
+ def self.connect(api_key)
55
+ Igdb::Configuration::Api.instance.tap do |api|
56
+ api.connect(api_key)
57
+ end
58
+ end
59
+ end
metadata ADDED
@@ -0,0 +1,241 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: igdb_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.0
5
+ platform: ruby
6
+ authors:
7
+ - Leigh West
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-04-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.3.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.3.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: vcr
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.9.3
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.9.3
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.21.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.21.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: codeclimate-test-reporter
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 1.0.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.0.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: representable
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: multi_json
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rest-client
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: ''
168
+ email:
169
+ - iamtastycake@gmail.com
170
+ executables: []
171
+ extensions: []
172
+ extra_rdoc_files: []
173
+ files:
174
+ - README.md
175
+ - lib/igdb/configuration/api.rb
176
+ - lib/igdb/exceptions.rb
177
+ - lib/igdb/models/api_resource.rb
178
+ - lib/igdb/models/character.rb
179
+ - lib/igdb/models/collection.rb
180
+ - lib/igdb/models/company.rb
181
+ - lib/igdb/models/franchise.rb
182
+ - lib/igdb/models/game.rb
183
+ - lib/igdb/models/game_engine.rb
184
+ - lib/igdb/models/game_mode.rb
185
+ - lib/igdb/models/genre.rb
186
+ - lib/igdb/models/keyword.rb
187
+ - lib/igdb/models/person.rb
188
+ - lib/igdb/models/platform.rb
189
+ - lib/igdb/models/player_perspective.rb
190
+ - lib/igdb/models/pulse.rb
191
+ - lib/igdb/models/release_date.rb
192
+ - lib/igdb/models/review.rb
193
+ - lib/igdb/models/theme.rb
194
+ - lib/igdb/representers/alternative_name_representer.rb
195
+ - lib/igdb/representers/base_representer.rb
196
+ - lib/igdb/representers/character_representer.rb
197
+ - lib/igdb/representers/collection_representer.rb
198
+ - lib/igdb/representers/company_representer.rb
199
+ - lib/igdb/representers/franchise_representer.rb
200
+ - lib/igdb/representers/game_engine_representer.rb
201
+ - lib/igdb/representers/game_mode_representer.rb
202
+ - lib/igdb/representers/game_representer.rb
203
+ - lib/igdb/representers/genre_representer.rb
204
+ - lib/igdb/representers/image_representer.rb
205
+ - lib/igdb/representers/keyword_representer.rb
206
+ - lib/igdb/representers/person_representer.rb
207
+ - lib/igdb/representers/platform_representer.rb
208
+ - lib/igdb/representers/player_perspective_representer.rb
209
+ - lib/igdb/representers/pulse_representer.rb
210
+ - lib/igdb/representers/release_date_representer.rb
211
+ - lib/igdb/representers/review_representer.rb
212
+ - lib/igdb/representers/theme_representer.rb
213
+ - lib/igdb/representers/video_representer.rb
214
+ - lib/igdb/requester.rb
215
+ - lib/igdb/version.rb
216
+ - lib/igdb_api.rb
217
+ homepage: https://github.com/tastycake/igdb_api
218
+ licenses:
219
+ - MIT
220
+ metadata: {}
221
+ post_install_message:
222
+ rdoc_options: []
223
+ require_paths:
224
+ - lib
225
+ required_ruby_version: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ required_rubygems_version: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - ">="
233
+ - !ruby/object:Gem::Version
234
+ version: '0'
235
+ requirements: []
236
+ rubyforge_project:
237
+ rubygems_version: 2.5.1
238
+ signing_key:
239
+ specification_version: 4
240
+ summary: A Ruby wrapper for the Internet Game Database API.
241
+ test_files: []