rr_games_radar 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
data/games_radar_api.gemspec
CHANGED
@@ -15,50 +15,74 @@ module GamesRadarApi
|
|
15
15
|
def game(id)
|
16
16
|
response = get("/game/#{id}")
|
17
17
|
self.total_rows = response.total_rows.to_i
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
game = if response.game.nil? or response.game.id.nil?
|
19
|
+
nil
|
20
|
+
else
|
21
|
+
response.game
|
22
|
+
end
|
23
|
+
|
24
|
+
if !game.nil?
|
25
|
+
if game.name.nil?
|
26
|
+
game.name = nil
|
27
|
+
elsif game.name.include?("us")
|
28
|
+
game.name = game.name.us
|
23
29
|
end
|
24
30
|
|
25
|
-
if
|
26
|
-
|
31
|
+
if game.release_date.nil?
|
32
|
+
game[:release_date] = nil
|
27
33
|
end
|
28
34
|
|
29
|
-
if
|
30
|
-
|
31
|
-
elsif
|
32
|
-
|
35
|
+
if game.platform.nil?
|
36
|
+
game[:platform] = nil
|
37
|
+
elsif game.platform.include?("name")
|
38
|
+
game[:platform] = game.platform.name
|
33
39
|
end
|
34
40
|
|
35
|
-
if
|
36
|
-
|
37
|
-
elsif
|
38
|
-
|
41
|
+
if game.genre.nil?
|
42
|
+
game[:genre] = nil
|
43
|
+
elsif game.genre.include?("name")
|
44
|
+
game[:genre] = game.genre.name
|
39
45
|
end
|
40
46
|
|
41
|
-
if
|
42
|
-
|
43
|
-
elsif
|
44
|
-
|
47
|
+
if game.publishers.nil?
|
48
|
+
game[:publishers] = nil
|
49
|
+
elsif game.publishers.include?("us")
|
50
|
+
game[:publishers] = game.publishers.us
|
45
51
|
end
|
46
52
|
|
47
|
-
if
|
48
|
-
|
53
|
+
if game.description.nil? or game.description.empty?
|
54
|
+
game[:description] = nil
|
49
55
|
else
|
50
|
-
|
56
|
+
game[:description] = game.description
|
51
57
|
end
|
52
58
|
|
53
|
-
if
|
54
|
-
|
59
|
+
if game.censorship.nil?
|
60
|
+
game[:esrb] = nil
|
55
61
|
else
|
56
|
-
|
62
|
+
game[:esrb] = game.censorship.esrb.rating
|
63
|
+
end
|
64
|
+
|
65
|
+
if game.expected_release_date.nil?
|
66
|
+
game.expected_release_date = nil
|
67
|
+
elsif game.expected_release_date.include?("us")
|
68
|
+
game.expected_release_date = game.expected_release_date.us
|
57
69
|
end
|
70
|
+
|
71
|
+
if game.developers.nil?
|
72
|
+
game.developers = nil
|
73
|
+
elsif game.developers.include?("company")
|
74
|
+
game.developers = game.developers.company.name
|
75
|
+
end
|
76
|
+
|
77
|
+
if game.publishers.nil?
|
78
|
+
game.publishers = nil
|
79
|
+
elsif game.publishers.include?("company")
|
80
|
+
game.publishers = game.publishers.company.name
|
81
|
+
end
|
82
|
+
|
58
83
|
end
|
59
84
|
|
60
|
-
return
|
61
|
-
return nil
|
85
|
+
return game
|
62
86
|
end
|
63
87
|
|
64
88
|
def game_search(query,platform,options={:region=>'us'})
|
@@ -52,6 +52,16 @@ describe GamesRadarApi::Client::Games do
|
|
52
52
|
response = @client.game('16725')
|
53
53
|
response.esrb.must_equal("Mature")
|
54
54
|
end
|
55
|
+
|
56
|
+
it "should return name of developers" do
|
57
|
+
response = @client.game('16725')
|
58
|
+
response.developers.must_equal("SCE Santa Monica")
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should return name of publishers" do
|
62
|
+
response = @client.game('16725')
|
63
|
+
response.publishers.must_equal("SCEA")
|
64
|
+
end
|
55
65
|
end
|
56
66
|
|
57
67
|
describe 'Game Search' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rr_games_radar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday_middleware
|