gamertag 1.1.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +11 -1
  3. data/LICENSE.md +11 -0
  4. data/README.md +84 -0
  5. data/gamertag.gemspec +25 -25
  6. data/lib/faraday/response/cleanup_xbox_leaders_naming.rb +30 -0
  7. data/lib/faraday/response/raise_xbox_leaders_error.rb +22 -0
  8. data/lib/gamertag.rb +21 -10
  9. data/lib/gamertag/client.rb +25 -0
  10. data/lib/gamertag/client/achievements.rb +15 -0
  11. data/lib/gamertag/client/friends.rb +14 -0
  12. data/lib/gamertag/client/games.rb +41 -0
  13. data/lib/gamertag/client/profile.rb +14 -0
  14. data/lib/gamertag/configuration.rb +48 -0
  15. data/lib/gamertag/connection.rb +22 -0
  16. data/lib/gamertag/error.rb +22 -0
  17. data/lib/gamertag/version.rb +2 -2
  18. data/spec/client/achievements_spec.rb +21 -0
  19. data/spec/client/friends_spec.rb +23 -0
  20. data/spec/client/games_spec.rb +49 -0
  21. data/spec/client/profile_spec.rb +22 -0
  22. data/spec/client_spec.rb +7 -0
  23. data/spec/faraday/xboxleader_cleanup_spec.rb +59 -0
  24. data/spec/faraday/xboxleader_error_spec.rb +63 -0
  25. data/spec/fixtures/achievements.json +654 -0
  26. data/spec/fixtures/errors/friends_not_found.json +9 -0
  27. data/spec/fixtures/errors/game_not_found.json +9 -0
  28. data/spec/fixtures/errors/gamertag_not_found.json +9 -0
  29. data/spec/fixtures/errors/invalid_game_id.json +9 -0
  30. data/spec/fixtures/errors/invalid_gamertag.json +9 -0
  31. data/spec/fixtures/friends.json +772 -0
  32. data/spec/fixtures/gamertag_not_found.json +9 -0
  33. data/spec/fixtures/games.json +2244 -0
  34. data/spec/fixtures/profile.json +125 -0
  35. data/spec/gamertag_spec.rb +13 -0
  36. data/spec/helper.rb +38 -0
  37. metadata +92 -124
  38. data/.gitignore +0 -9
  39. data/.rspec +0 -3
  40. data/.rvmrc +0 -1
  41. data/Gemfile +0 -4
  42. data/LICENSE +0 -20
  43. data/README.mdown +0 -106
  44. data/Rakefile +0 -12
  45. data/lib/gamertag/friends.rb +0 -25
  46. data/lib/gamertag/played_games.rb +0 -73
  47. data/lib/gamertag/profile.rb +0 -13
  48. data/lib/gamertag/simple_profile.rb +0 -68
  49. data/spec/fixtures/vcr_cassettes/Friends_Belial1984.yml +0 -520
  50. data/spec/fixtures/vcr_cassettes/PlayedGames_Belial1984.yml +0 -1309
  51. data/spec/fixtures/vcr_cassettes/PlayedGames_some_user.yml +0 -100
  52. data/spec/fixtures/vcr_cassettes/SimpleProfile_Belial1984.yml +0 -45
  53. data/spec/friends_spec.rb +0 -19
  54. data/spec/played_games_spec.rb +0 -25
  55. data/spec/profile_spec.rb +0 -15
  56. data/spec/simple_profile_spec.rb +0 -69
  57. data/spec/spec_helper.rb +0 -15
  58. data/spec/version_spec.rb +0 -7
@@ -0,0 +1,125 @@
1
+ {
2
+ "status": "success",
3
+ "version": "2.0",
4
+ "data": {
5
+ "gamertag": "belial1984",
6
+ "tier": "gold",
7
+ "badges": {
8
+ "xboxlaunchteam": false,
9
+ "nxelaunchteam": false,
10
+ "kinectlaunchteam": false
11
+ },
12
+ "avatar": {
13
+ "full": "http://avatar.xboxlive.com/avatar/Belial1984/avatar-body.png",
14
+ "small": "http://avatar.xboxlive.com/avatar/Belial1984/avatarpic-s.png",
15
+ "large": "http://avatar.xboxlive.com/avatar/Belial1984/avatarpic-l.png"
16
+ },
17
+ "gamerscore": 17475,
18
+ "reputation": 20,
19
+ "presence": "Offline",
20
+ "online": false,
21
+ "motto": "",
22
+ "name": "baris balic",
23
+ "location": "london",
24
+ "biography": "",
25
+ "recentactivity": [
26
+ {
27
+ "id": 1414793309,
28
+ "isapp": false,
29
+ "title": "BioShock Infinite",
30
+ "artwork": {
31
+ "small": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025454085d/1033/boxartsm.jpg",
32
+ "large": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025454085d/1033/boxartlg.jpg"
33
+ },
34
+ "gamerscore": {
35
+ "current": 470,
36
+ "total": 1000
37
+ },
38
+ "achievements": {
39
+ "current": 32,
40
+ "total": 50
41
+ },
42
+ "progress": 64,
43
+ "lastplayed": "1370905190"
44
+ },
45
+ {
46
+ "id": 1128466428,
47
+ "isapp": false,
48
+ "title": "SUPER STREETFIGHTER IV",
49
+ "artwork": {
50
+ "small": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802434307fc/1033/boxartsm.jpg",
51
+ "large": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802434307fc/1033/boxartlg.jpg"
52
+ },
53
+ "gamerscore": {
54
+ "current": 490,
55
+ "total": 1160
56
+ },
57
+ "achievements": {
58
+ "current": 30,
59
+ "total": 58
60
+ },
61
+ "progress": 51.7,
62
+ "lastplayed": "1370107224"
63
+ },
64
+ {
65
+ "id": 1110837201,
66
+ "isapp": true,
67
+ "title": "YouTube",
68
+ "artwork": {
69
+ "small": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802423607d1/1033/boxartsm.jpg",
70
+ "large": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802423607d1/1033/boxartlg.jpg"
71
+ },
72
+ "gamerscore": {
73
+ "current": 0,
74
+ "total": 0
75
+ },
76
+ "achievements": {
77
+ "current": 0,
78
+ "total": 0
79
+ },
80
+ "progress": 0,
81
+ "lastplayed": "1369950987"
82
+ },
83
+ {
84
+ "id": 1480657060,
85
+ "isapp": false,
86
+ "title": "SuperStreetFighter2THD",
87
+ "artwork": {
88
+ "small": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802584108a4/1033/boxartsm.jpg",
89
+ "large": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802584108a4/1033/boxartlg.jpg"
90
+ },
91
+ "gamerscore": {
92
+ "current": 30,
93
+ "total": 200
94
+ },
95
+ "achievements": {
96
+ "current": 2,
97
+ "total": 12
98
+ },
99
+ "progress": 16.7,
100
+ "lastplayed": "1369930499"
101
+ },
102
+ {
103
+ "id": 1431505036,
104
+ "isapp": false,
105
+ "title": "Far Cry® 3",
106
+ "artwork": {
107
+ "small": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025553088c/1033/boxartsm.jpg",
108
+ "large": "http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025553088c/1033/boxartlg.jpg"
109
+ },
110
+ "gamerscore": {
111
+ "current": 20,
112
+ "total": 1000
113
+ },
114
+ "achievements": {
115
+ "current": 1,
116
+ "total": 50
117
+ },
118
+ "progress": 2,
119
+ "lastplayed": "1369921517"
120
+ }
121
+ ],
122
+ "freshness": "new"
123
+ },
124
+ "runtime": 3.681
125
+ }
@@ -0,0 +1,13 @@
1
+ require 'helper'
2
+
3
+ describe Gamertag do
4
+ after do
5
+ Gamertag.defaults
6
+ end
7
+
8
+ describe '.new' do
9
+ it 'is a Gamertag::Client' do
10
+ expect(Gamertag.new).to be_a Gamertag::Client
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,38 @@
1
+ require 'rspec'
2
+
3
+ require 'gamertag'
4
+
5
+
6
+ require 'webmock/rspec'
7
+ WebMock.disable_net_connect!
8
+
9
+ RSpec.configure do |config|
10
+ config.expect_with :rspec do |c|
11
+ c.syntax = :expect
12
+ end
13
+ end
14
+
15
+ def stub_get(url)
16
+ stub_request(:get, xboxleaders_url(url))
17
+ end
18
+
19
+ def fixture_path
20
+ File.expand_path("../fixtures", __FILE__)
21
+ end
22
+
23
+ def fixture(file)
24
+ File.read(fixture_path + '/' + file)
25
+ end
26
+
27
+ def json_response(file)
28
+ {
29
+ :body => fixture(file),
30
+ :headers => {
31
+ :content_type => 'application/json; charset=utf-8'
32
+ }
33
+ }
34
+ end
35
+
36
+ def xboxleaders_url(url)
37
+ "https://www.xboxleaders.com/api/2.0#{url}"
38
+ end
metadata CHANGED
@@ -1,200 +1,168 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamertag
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
5
- prerelease:
4
+ version: 2.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Baris Balic
9
- - David Czarnecki
10
8
  autorequire:
11
9
  bindir: bin
12
10
  cert_chain: []
13
- date: 2013-01-12 00:00:00.000000000 Z
11
+ date: 2013-07-05 00:00:00.000000000 Z
14
12
  dependencies:
15
13
  - !ruby/object:Gem::Dependency
16
- name: json
14
+ name: bundler
17
15
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
16
  requirements:
20
- - - ! '>='
17
+ - - ~>
21
18
  - !ruby/object:Gem::Version
22
- version: '0'
23
- type: :runtime
19
+ version: '1.3'
20
+ type: :development
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
23
  requirements:
28
- - - ! '>='
24
+ - - ~>
29
25
  - !ruby/object:Gem::Version
30
- version: '0'
26
+ version: '1.3'
31
27
  - !ruby/object:Gem::Dependency
32
- name: hashie
28
+ name: faraday
33
29
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
30
  requirements:
36
- - - ! '>='
31
+ - - ~>
37
32
  - !ruby/object:Gem::Version
38
- version: '0'
33
+ version: '0.8'
39
34
  type: :runtime
40
35
  prerelease: false
41
36
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
37
  requirements:
44
- - - ! '>='
38
+ - - ~>
45
39
  - !ruby/object:Gem::Version
46
- version: '0'
40
+ version: '0.8'
47
41
  - !ruby/object:Gem::Dependency
48
- name: nokogiri
42
+ name: faraday_middleware
49
43
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
44
  requirements:
52
- - - ! '>='
45
+ - - ~>
53
46
  - !ruby/object:Gem::Version
54
- version: '0'
47
+ version: '0.9'
55
48
  type: :runtime
56
49
  prerelease: false
57
50
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ! '>='
61
- - !ruby/object:Gem::Version
62
- version: '0'
63
- - !ruby/object:Gem::Dependency
64
- name: rake
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
- version: '0'
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
79
- - !ruby/object:Gem::Dependency
80
- name: rspec
81
- requirement: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ! '>='
85
- - !ruby/object:Gem::Version
86
- version: '0'
87
- type: :development
88
- prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
51
  requirements:
92
- - - ! '>='
52
+ - - ~>
93
53
  - !ruby/object:Gem::Version
94
- version: '0'
54
+ version: '0.9'
95
55
  - !ruby/object:Gem::Dependency
96
- name: vcr
56
+ name: hashie
97
57
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
58
  requirements:
100
- - - ! '>='
59
+ - - ~>
101
60
  - !ruby/object:Gem::Version
102
- version: '0'
103
- type: :development
61
+ version: '2.0'
62
+ type: :runtime
104
63
  prerelease: false
105
64
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
65
  requirements:
108
- - - ! '>='
66
+ - - ~>
109
67
  - !ruby/object:Gem::Version
110
- version: '0'
68
+ version: '2.0'
111
69
  - !ruby/object:Gem::Dependency
112
- name: fakeweb
70
+ name: multi_json
113
71
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
72
  requirements:
116
- - - ! '>='
73
+ - - ~>
117
74
  - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :development
75
+ version: '1.3'
76
+ type: :runtime
120
77
  prerelease: false
121
78
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
79
  requirements:
124
- - - ! '>='
80
+ - - ~>
125
81
  - !ruby/object:Gem::Version
126
- version: '0'
127
- description: A gem for retrieving your XBOX Live gamertag information
82
+ version: '1.3'
83
+ description: A wrapper for the XboxLeaders API
128
84
  email:
129
- - baris@webloch.co.uk
130
- - dczarnecki@agoragames.com
85
+ - leafybasil@gmail.com
131
86
  executables: []
132
87
  extensions: []
133
88
  extra_rdoc_files: []
134
89
  files:
135
- - .gitignore
136
- - .rspec
137
- - .rvmrc
138
90
  - CHANGELOG.md
139
- - Gemfile
140
- - LICENSE
141
- - README.mdown
142
- - Rakefile
91
+ - LICENSE.md
92
+ - README.md
143
93
  - gamertag.gemspec
144
- - lib/gamertag.rb
145
- - lib/gamertag/friends.rb
146
- - lib/gamertag/played_games.rb
147
- - lib/gamertag/profile.rb
148
- - lib/gamertag/simple_profile.rb
94
+ - lib/faraday/response/cleanup_xbox_leaders_naming.rb
95
+ - lib/faraday/response/raise_xbox_leaders_error.rb
96
+ - lib/gamertag/client/achievements.rb
97
+ - lib/gamertag/client/friends.rb
98
+ - lib/gamertag/client/games.rb
99
+ - lib/gamertag/client/profile.rb
100
+ - lib/gamertag/client.rb
101
+ - lib/gamertag/configuration.rb
102
+ - lib/gamertag/connection.rb
103
+ - lib/gamertag/error.rb
149
104
  - lib/gamertag/version.rb
150
- - spec/fixtures/vcr_cassettes/Friends_Belial1984.yml
151
- - spec/fixtures/vcr_cassettes/PlayedGames_Belial1984.yml
152
- - spec/fixtures/vcr_cassettes/PlayedGames_some_user.yml
153
- - spec/fixtures/vcr_cassettes/SimpleProfile_Belial1984.yml
154
- - spec/friends_spec.rb
155
- - spec/played_games_spec.rb
156
- - spec/profile_spec.rb
157
- - spec/simple_profile_spec.rb
158
- - spec/spec_helper.rb
159
- - spec/version_spec.rb
105
+ - lib/gamertag.rb
106
+ - spec/client/achievements_spec.rb
107
+ - spec/client/friends_spec.rb
108
+ - spec/client/games_spec.rb
109
+ - spec/client/profile_spec.rb
110
+ - spec/client_spec.rb
111
+ - spec/faraday/xboxleader_cleanup_spec.rb
112
+ - spec/faraday/xboxleader_error_spec.rb
113
+ - spec/fixtures/achievements.json
114
+ - spec/fixtures/errors/friends_not_found.json
115
+ - spec/fixtures/errors/game_not_found.json
116
+ - spec/fixtures/errors/gamertag_not_found.json
117
+ - spec/fixtures/errors/invalid_game_id.json
118
+ - spec/fixtures/errors/invalid_gamertag.json
119
+ - spec/fixtures/friends.json
120
+ - spec/fixtures/gamertag_not_found.json
121
+ - spec/fixtures/games.json
122
+ - spec/fixtures/profile.json
123
+ - spec/gamertag_spec.rb
124
+ - spec/helper.rb
160
125
  homepage: https://github.com/barisbalic/gamertag
161
- licenses: []
126
+ licenses:
127
+ - DWHTFYWTPL
128
+ metadata: {}
162
129
  post_install_message:
163
130
  rdoc_options: []
164
131
  require_paths:
165
132
  - lib
166
133
  required_ruby_version: !ruby/object:Gem::Requirement
167
- none: false
168
134
  requirements:
169
- - - ! '>='
135
+ - - '>='
170
136
  - !ruby/object:Gem::Version
171
137
  version: '0'
172
- segments:
173
- - 0
174
- hash: 1008090992145051836
175
138
  required_rubygems_version: !ruby/object:Gem::Requirement
176
- none: false
177
139
  requirements:
178
- - - ! '>='
140
+ - - '>='
179
141
  - !ruby/object:Gem::Version
180
142
  version: '0'
181
- segments:
182
- - 0
183
- hash: 1008090992145051836
184
143
  requirements: []
185
- rubyforge_project: gamertag
186
- rubygems_version: 1.8.24
144
+ rubyforge_project:
145
+ rubygems_version: 2.0.2
187
146
  signing_key:
188
- specification_version: 3
189
- summary: A gem for retrieving your XBOX Live gamertag information
147
+ specification_version: 4
148
+ summary: A wrapper for the XboxLeaders API
190
149
  test_files:
191
- - spec/fixtures/vcr_cassettes/Friends_Belial1984.yml
192
- - spec/fixtures/vcr_cassettes/PlayedGames_Belial1984.yml
193
- - spec/fixtures/vcr_cassettes/PlayedGames_some_user.yml
194
- - spec/fixtures/vcr_cassettes/SimpleProfile_Belial1984.yml
195
- - spec/friends_spec.rb
196
- - spec/played_games_spec.rb
197
- - spec/profile_spec.rb
198
- - spec/simple_profile_spec.rb
199
- - spec/spec_helper.rb
200
- - spec/version_spec.rb
150
+ - spec/client/achievements_spec.rb
151
+ - spec/client/friends_spec.rb
152
+ - spec/client/games_spec.rb
153
+ - spec/client/profile_spec.rb
154
+ - spec/client_spec.rb
155
+ - spec/faraday/xboxleader_cleanup_spec.rb
156
+ - spec/faraday/xboxleader_error_spec.rb
157
+ - spec/fixtures/achievements.json
158
+ - spec/fixtures/errors/friends_not_found.json
159
+ - spec/fixtures/errors/game_not_found.json
160
+ - spec/fixtures/errors/gamertag_not_found.json
161
+ - spec/fixtures/errors/invalid_game_id.json
162
+ - spec/fixtures/errors/invalid_gamertag.json
163
+ - spec/fixtures/friends.json
164
+ - spec/fixtures/gamertag_not_found.json
165
+ - spec/fixtures/games.json
166
+ - spec/fixtures/profile.json
167
+ - spec/gamertag_spec.rb
168
+ - spec/helper.rb