psn 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/psn/api.rb CHANGED
@@ -22,7 +22,7 @@ module PSN
22
22
  private
23
23
  def fetch(url, options)
24
24
  url = "#{BASE_URL}/#{url}?#{normalize_params options}"
25
- response = Retriable.retriable on: OpenURI::HTTPError, tries: RETRIES, interval: 1 do
25
+ response = Retriable.retriable on: OpenURI::HTTPError, tries: RETRIES, interval: 0.3 do
26
26
  open(url).read
27
27
  end
28
28
  parse_and_extract_response response
data/lib/psn/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PSN
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,141 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.psnapi.com.ar/ps3/api/psn.asmx/getGames?sPSNID=Kevin100Brasil
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ response:
15
+ status:
16
+ code: 500
17
+ message: Internal Server Error
18
+ headers:
19
+ Cache-Control:
20
+ - private
21
+ Content-Type:
22
+ - text/plain; charset=utf-8
23
+ Server:
24
+ - Microsoft-IIS/7.0
25
+ X-Aspnet-Version:
26
+ - 2.0.50727
27
+ X-Powered-By:
28
+ - ASP.NET
29
+ Date:
30
+ - Thu, 20 Dec 2012 18:28:57 GMT
31
+ Content-Length:
32
+ - '794'
33
+ body:
34
+ encoding: US-ASCII
35
+ string: ! "System.NullReferenceException: Object reference not set to an instance
36
+ of an object.\r\n at IndieSoftware.PS3.PS3Parser.GetGamesFromOfficialAPI(String
37
+ sPSNId, Boolean All, Int32 Max, Nullable`1 Since)\r\n at IndieSoftware.PS3.PS3Parser.GetGamesSince(String
38
+ sPSNID, Nullable`1 d, Int32 iMax)\r\n at IndieSoftware.PS3.PSNServices.GetGames(String
39
+ sId, String sIdGame, Boolean bForce, CookieContainer cookies, Nullable`1 Since,
40
+ Int32 iMax)\r\n at IndieSoftware.PS3.PSNServices.GetGames(String sId, String
41
+ sIdGame, Boolean bForce, CookieContainer cookies, Nullable`1 Since)\r\n at
42
+ IndieSoftware.PS3.PSNServices.GetGames(String sId, String sIdGame, Boolean
43
+ bForce, CookieContainer cookies)\r\n at IndieSoftware.PS3.PSNServices.GetGames(String
44
+ sId, String sIdGame)\r\n at psn.getGames(String sPSNID)\r\n"
45
+ http_version:
46
+ recorded_at: Thu, 20 Dec 2012 18:28:23 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://www.psnapi.com.ar/ps3/api/psn.asmx/getGames?sPSNID=Kevin100Brasil
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - ! '*/*'
56
+ User-Agent:
57
+ - Ruby
58
+ response:
59
+ status:
60
+ code: 403
61
+ message: Forbidden
62
+ headers:
63
+ Cache-Control:
64
+ - private, max-age=0
65
+ Content-Type:
66
+ - text/html
67
+ Server:
68
+ - Microsoft-IIS/7.0
69
+ X-Aspnet-Version:
70
+ - 2.0.50727
71
+ X-Powered-By:
72
+ - ASP.NET
73
+ Date:
74
+ - Thu, 20 Dec 2012 18:28:59 GMT
75
+ Content-Length:
76
+ - '1233'
77
+ body:
78
+ encoding: US-ASCII
79
+ string: ! "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html
80
+ xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\"
81
+ content=\"text/html; charset=iso-8859-1\"/>\r\n<title>403 - Forbidden: Access
82
+ is denied.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana,
83
+ Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px
84
+ 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;}
85
+ \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0
86
+ 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0
87
+ 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div
88
+ id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div
89
+ class=\"content-container\"><fieldset>\r\n <h2>403 - Forbidden: Access is
90
+ denied.</h2>\r\n <h3>You do not have permission to view this directory or
91
+ page using the credentials that you supplied.</h3>\r\n </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n"
92
+ http_version:
93
+ recorded_at: Thu, 20 Dec 2012 18:28:24 GMT
94
+ - request:
95
+ method: get
96
+ uri: http://www.psnapi.com.ar/ps3/api/psn.asmx/getGames?sPSNID=Kevin100Brasil
97
+ body:
98
+ encoding: US-ASCII
99
+ string: ''
100
+ headers:
101
+ Accept:
102
+ - ! '*/*'
103
+ User-Agent:
104
+ - Ruby
105
+ response:
106
+ status:
107
+ code: 403
108
+ message: Forbidden
109
+ headers:
110
+ Cache-Control:
111
+ - private, max-age=0
112
+ Content-Type:
113
+ - text/html
114
+ Server:
115
+ - Microsoft-IIS/7.0
116
+ X-Aspnet-Version:
117
+ - 2.0.50727
118
+ X-Powered-By:
119
+ - ASP.NET
120
+ Date:
121
+ - Thu, 20 Dec 2012 18:29:00 GMT
122
+ Content-Length:
123
+ - '1233'
124
+ body:
125
+ encoding: US-ASCII
126
+ string: ! "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html
127
+ xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\"
128
+ content=\"text/html; charset=iso-8859-1\"/>\r\n<title>403 - Forbidden: Access
129
+ is denied.</title>\r\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana,
130
+ Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px
131
+ 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;}
132
+ \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0
133
+ 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0
134
+ 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\r\n</head>\r\n<body>\r\n<div
135
+ id=\"header\"><h1>Server Error</h1></div>\r\n<div id=\"content\">\r\n <div
136
+ class=\"content-container\"><fieldset>\r\n <h2>403 - Forbidden: Access is
137
+ denied.</h2>\r\n <h3>You do not have permission to view this directory or
138
+ page using the credentials that you supplied.</h3>\r\n </fieldset></div>\r\n</div>\r\n</body>\r\n</html>\r\n"
139
+ http_version:
140
+ recorded_at: Thu, 20 Dec 2012 18:28:26 GMT
141
+ recorded_with: VCR 2.3.0
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: psn
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Pedro Nascimento
@@ -167,6 +167,7 @@ files:
167
167
  - psn.gemspec
168
168
  - spec/cassettes/PSN_API/fetches_games_for_an_user.yml
169
169
  - spec/cassettes/PSN_API/fetches_player_summaries_for_an_user.yml
170
+ - spec/cassettes/PSN_API/raises_PSN_API_Error_for_errors_in_API.yml
170
171
  - spec/cassettes/PSN_Game/finds_the_correct_id.yml
171
172
  - spec/cassettes/PSN_Game/finds_the_correct_name.yml
172
173
  - spec/cassettes/PSN_GamesList/creates_game_objects.yml
@@ -191,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
192
  version: '0'
192
193
  segments:
193
194
  - 0
194
- hash: 224315629052507505
195
+ hash: -3367702368405231182
195
196
  none: false
196
197
  required_rubygems_version: !ruby/object:Gem::Requirement
197
198
  requirements:
@@ -200,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
201
  version: '0'
201
202
  segments:
202
203
  - 0
203
- hash: 224315629052507505
204
+ hash: -3367702368405231182
204
205
  none: false
205
206
  requirements: []
206
207
  rubyforge_project:
@@ -211,6 +212,7 @@ summary: PSN allows you to interact with the Playstation Network.
211
212
  test_files:
212
213
  - spec/cassettes/PSN_API/fetches_games_for_an_user.yml
213
214
  - spec/cassettes/PSN_API/fetches_player_summaries_for_an_user.yml
215
+ - spec/cassettes/PSN_API/raises_PSN_API_Error_for_errors_in_API.yml
214
216
  - spec/cassettes/PSN_Game/finds_the_correct_id.yml
215
217
  - spec/cassettes/PSN_Game/finds_the_correct_name.yml
216
218
  - spec/cassettes/PSN_GamesList/creates_game_objects.yml