steam-api 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +21 -1
- data/Gemfile +0 -1
- data/lib/steam-api.rb +0 -1
- data/lib/steam-api/version.rb +1 -1
- data/spec/steam/player_spec.rb +19 -20
- data/spec/steam/users_spec.rb +18 -14
- data/spec/steam_spec.rb +0 -5
- data/steam-api.gemspec +3 -6
- metadata +19 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: 126cf4dc03315490747599e176d6f314b72237e4
|
4
|
+
data.tar.gz: 712bca6def072b84cba7c953678e5b5f695ee225
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48b6e6aa5c27fa05dd9ecb1e824a9781176beb99eb0f02b7d3256a9a02c6d185666f6d479f726e75225f0a082ece6981e280f75f3e48fcb518d3c20637061bb9
|
7
|
+
data.tar.gz: 0248892823f35756eb80cef56d129f4f9ec8d6a48941725c2c5a301e52565928bb0ff88c60967ff86af331f1331997cdc83b0760cdd1dcde6e278565e4d051c5
|
data/.travis.yml
CHANGED
@@ -1,6 +1,26 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
3
|
+
- 2.1.1
|
4
|
+
- 2.1.0
|
5
|
+
- 2.0.0
|
6
|
+
- 1.9.3
|
7
|
+
- 1.9.2
|
8
|
+
- 1.8.7
|
9
|
+
- jruby-18mode
|
10
|
+
- jruby-19mode
|
11
|
+
- ruby-head
|
12
|
+
- jruby-head
|
13
|
+
- ree
|
14
|
+
matrix:
|
15
|
+
allow_failures:
|
16
|
+
- rvm: 1.9.3
|
17
|
+
- rvm: 1.9.2
|
18
|
+
- rvm: 1.8.7
|
19
|
+
- rvm: ree
|
20
|
+
- rvm: jruby-18mode
|
21
|
+
- rvm: jruby-19mode
|
22
|
+
- rvm: jruby-head
|
23
|
+
fast_finish: true
|
4
24
|
env:
|
5
25
|
global:
|
6
26
|
secure: P5IpEGYYbF0HcP9Mj9/zZAUXpUjkA2YkGLClvbVGsOD5zI9Jj1RZAlCC/fBKtfPUlfjlADp1hIN++n7qnqqmXPw4X/BC2V8Ios91NoFQeKfjQENSmjYykFTCp1CkBmCjq+lb/yE/JPQnVOoI/eEm5uaNSRc/XLjHwuSdKEFPv8M=
|
data/Gemfile
CHANGED
data/lib/steam-api.rb
CHANGED
data/lib/steam-api/version.rb
CHANGED
data/spec/steam/player_spec.rb
CHANGED
@@ -1,92 +1,91 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Steam::Player do
|
4
|
+
before(:each) do
|
5
|
+
@playerid = 76561197993276293
|
6
|
+
end
|
7
|
+
|
4
8
|
describe '.owned_games' do
|
5
9
|
it 'should allow users to retrieve a list of games' do
|
6
|
-
Steam::Player.owned_games(
|
10
|
+
Steam::Player.owned_games(@playerid)
|
7
11
|
.should_not be_nil
|
8
12
|
end
|
9
13
|
|
10
14
|
it 'should allow users to retrieve a list of games' do
|
11
|
-
Steam::Player.owned_games(
|
15
|
+
Steam::Player.owned_games(@playerid)
|
12
16
|
.should have_key('game_count')
|
13
17
|
end
|
14
18
|
|
15
19
|
it 'should allow users to retrieve a list of games' do
|
16
|
-
Steam::Player.owned_games(
|
20
|
+
Steam::Player.owned_games(@playerid)
|
17
21
|
.should have_key('games')
|
18
22
|
end
|
19
23
|
end
|
20
24
|
|
21
25
|
describe '.recently_played_games' do
|
22
26
|
it 'should allow users to list a players recent games' do
|
23
|
-
Steam::Player.recently_played_games(
|
27
|
+
Steam::Player.recently_played_games(@playerid)
|
24
28
|
.should_not be_nil
|
25
29
|
end
|
26
30
|
|
27
31
|
it 'should allow users to list a players recent games' do
|
28
|
-
Steam::Player.recently_played_games(
|
32
|
+
Steam::Player.recently_played_games(@playerid)
|
29
33
|
.should have_key 'total_count'
|
30
34
|
end
|
31
|
-
|
32
|
-
it 'should allow users to list a players recent games' do
|
33
|
-
Steam::Player.recently_played_games(76561197993276293)
|
34
|
-
.should have_key 'games'
|
35
|
-
end
|
36
35
|
end
|
37
36
|
|
38
37
|
describe '.steam_level' do
|
39
38
|
it 'should allow users to retrieve a users steam level' do
|
40
|
-
Steam::Player.steam_level(
|
39
|
+
Steam::Player.steam_level(@playerid)
|
41
40
|
.should_not be_nil
|
42
41
|
end
|
43
42
|
|
44
43
|
it 'should allow users to retrieve a users steam level' do
|
45
|
-
Steam::Player.steam_level(
|
44
|
+
Steam::Player.steam_level(@playerid)
|
46
45
|
.should be_a(Fixnum)
|
47
46
|
end
|
48
47
|
end
|
49
48
|
|
50
49
|
describe '.badges' do
|
51
50
|
it 'should allow a user to retrieve badges for a player' do
|
52
|
-
Steam::Player.badges(
|
51
|
+
Steam::Player.badges(@playerid)
|
53
52
|
.should_not be_nil
|
54
53
|
end
|
55
54
|
|
56
55
|
it 'should allow a user to retrieve badges for a player' do
|
57
|
-
Steam::Player.badges(
|
56
|
+
Steam::Player.badges(@playerid)
|
58
57
|
.should have_key 'badges'
|
59
58
|
end
|
60
59
|
|
61
60
|
it 'should allow a user to retrieve badges for a player' do
|
62
|
-
Steam::Player.badges(
|
61
|
+
Steam::Player.badges(@playerid)
|
63
62
|
.should have_key 'player_level'
|
64
63
|
end
|
65
64
|
|
66
65
|
it 'should allow a user to retrieve badges for a player' do
|
67
|
-
Steam::Player.badges(
|
66
|
+
Steam::Player.badges(@playerid)
|
68
67
|
.should have_key 'player_xp'
|
69
68
|
end
|
70
69
|
|
71
70
|
it 'should allow a user to retrieve badges for a player' do
|
72
|
-
Steam::Player.badges(
|
71
|
+
Steam::Player.badges(@playerid)
|
73
72
|
.should have_key 'player_xp_needed_current_level'
|
74
73
|
end
|
75
74
|
|
76
75
|
it 'should allow a user to retrieve badges for a player' do
|
77
|
-
Steam::Player.badges(
|
76
|
+
Steam::Player.badges(@playerid)
|
78
77
|
.should have_key 'player_xp_needed_to_level_up'
|
79
78
|
end
|
80
79
|
end
|
81
80
|
|
82
81
|
describe '.community_badge_progress' do
|
83
82
|
it 'should allow a user to retrieve community badge info for a player' do
|
84
|
-
Steam::Player.community_badge_progress(
|
83
|
+
Steam::Player.community_badge_progress(@playerid)
|
85
84
|
.should_not be_nil
|
86
85
|
end
|
87
86
|
|
88
87
|
it 'should allow a user to retrieve community badge info for a player' do
|
89
|
-
quest = Steam::Player.community_badge_progress(
|
88
|
+
quest = Steam::Player.community_badge_progress(@playerid).first
|
90
89
|
quest.should have_key 'questid'
|
91
90
|
quest.should have_key 'completed'
|
92
91
|
end
|
data/spec/steam/users_spec.rb
CHANGED
@@ -1,17 +1,21 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Steam::User do
|
4
|
+
before(:each) do
|
5
|
+
@playerid = 76561197993276293
|
6
|
+
@playerid2 = 76561197969622382
|
7
|
+
end
|
4
8
|
|
5
9
|
describe '.friends' do
|
6
10
|
it 'should allow users to check a friends for a user' do
|
7
|
-
response = Steam::User.friends(
|
11
|
+
response = Steam::User.friends(@playerid)
|
8
12
|
response.should_not be_nil
|
9
13
|
end
|
10
14
|
|
11
15
|
it 'should allow users to check a friends for a user' do
|
12
|
-
Steam::User.friends(
|
13
|
-
.map {|
|
14
|
-
.should include(
|
16
|
+
Steam::User.friends(@playerid)
|
17
|
+
.map { |friend| friend.first.last }
|
18
|
+
.should include(@playerid2.to_s)
|
15
19
|
end
|
16
20
|
|
17
21
|
it 'should return an error on a bad friend id' do
|
@@ -20,19 +24,19 @@ describe Steam::User do
|
|
20
24
|
end
|
21
25
|
|
22
26
|
it 'should return the same content for :friends and :all' do
|
23
|
-
Steam::User.friends(
|
24
|
-
.should == Steam::User.friends(
|
27
|
+
Steam::User.friends(@playerid2, relationship: :friend)
|
28
|
+
.should == Steam::User.friends(@playerid2, relationship: :all)
|
25
29
|
end
|
26
30
|
|
27
31
|
it 'should return an error on a bad friend id' do
|
28
|
-
lambda { Steam::User.friends(
|
32
|
+
lambda { Steam::User.friends(@playerid2, relationship: :sadsad) }
|
29
33
|
.should raise_error(Steam::JSONError)
|
30
34
|
end
|
31
35
|
end
|
32
36
|
|
33
37
|
describe '.bans' do
|
34
38
|
it 'should allow users to check bans for a user' do
|
35
|
-
Steam::User.bans(
|
39
|
+
Steam::User.bans(@playerid)
|
36
40
|
.should_not be_nil
|
37
41
|
end
|
38
42
|
|
@@ -42,19 +46,19 @@ describe Steam::User do
|
|
42
46
|
end
|
43
47
|
|
44
48
|
it 'should allow users to check a bans for multiple steamids' do
|
45
|
-
Steam::User.bans([
|
49
|
+
Steam::User.bans([@player, @player2])
|
46
50
|
.should_not be_nil
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
50
54
|
describe '.summary' do
|
51
55
|
it 'should allow users to get a summary for a user' do
|
52
|
-
Steam::User.summary(
|
56
|
+
Steam::User.summary(@playerid)
|
53
57
|
.should_not be_nil
|
54
58
|
end
|
55
59
|
|
56
60
|
it 'should allow users to check summaries for multiple accounts' do
|
57
|
-
Steam::User.summaries([
|
61
|
+
Steam::User.summaries([@player, @player2])
|
58
62
|
.should_not be_nil
|
59
63
|
end
|
60
64
|
end
|
@@ -67,18 +71,18 @@ describe Steam::User do
|
|
67
71
|
|
68
72
|
it 'should return the correct id when users look up vanity urls' do
|
69
73
|
Steam::User.vanity_to_steamid('asmeroth')
|
70
|
-
.should ==
|
74
|
+
.should == @playerid.to_s
|
71
75
|
end
|
72
76
|
end
|
73
77
|
|
74
78
|
describe '.groups' do
|
75
79
|
it 'should allow users to look groups a player is a member of' do
|
76
|
-
Steam::User.groups(
|
80
|
+
Steam::User.groups(@playerid)
|
77
81
|
.should_not be_nil
|
78
82
|
end
|
79
83
|
|
80
84
|
it 'should return an accurate list of groups a player is a member of' do
|
81
|
-
response = Steam::User.groups(
|
85
|
+
response = Steam::User.groups(@playerid)
|
82
86
|
response.map { |g| g.values.first }
|
83
87
|
.should include '3640974'
|
84
88
|
end
|
data/spec/steam_spec.rb
CHANGED
data/steam-api.gemspec
CHANGED
@@ -17,14 +17,11 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ['lib']
|
19
19
|
|
20
|
-
gem.required_ruby_version = '>= 2.0.0'
|
21
|
-
|
22
20
|
gem.add_development_dependency 'rake'
|
23
21
|
gem.add_development_dependency 'rspec'
|
24
22
|
gem.add_development_dependency 'coveralls'
|
25
23
|
|
26
|
-
gem.add_dependency '
|
27
|
-
gem.add_dependency '
|
28
|
-
gem.add_dependency '
|
29
|
-
gem.add_dependency 'json', '~> 1.7.7'
|
24
|
+
gem.add_dependency 'faraday', '0.9.0'
|
25
|
+
gem.add_dependency 'multi_json', '>= 1.7.7'
|
26
|
+
gem.add_dependency 'json', '>= 1.7.7'
|
30
27
|
end
|
metadata
CHANGED
@@ -1,111 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steam-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Haberer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '>='
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - '>='
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '>='
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: coveralls
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - '>='
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - '>='
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: faraday
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.9.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: faraday
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - '>='
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - '>='
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
68
|
+
version: 0.9.0
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: multi_json
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- - '
|
73
|
+
- - ! '>='
|
88
74
|
- !ruby/object:Gem::Version
|
89
75
|
version: 1.7.7
|
90
76
|
type: :runtime
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- - '
|
80
|
+
- - ! '>='
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: 1.7.7
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: json
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
|
-
- -
|
87
|
+
- - ! '>='
|
102
88
|
- !ruby/object:Gem::Version
|
103
89
|
version: 1.7.7
|
104
90
|
type: :runtime
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
|
-
- -
|
94
|
+
- - ! '>='
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: 1.7.7
|
111
97
|
description: Simple Steam Gem
|
@@ -155,17 +141,17 @@ require_paths:
|
|
155
141
|
- lib
|
156
142
|
required_ruby_version: !ruby/object:Gem::Requirement
|
157
143
|
requirements:
|
158
|
-
- - '>='
|
144
|
+
- - ! '>='
|
159
145
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
146
|
+
version: '0'
|
161
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
148
|
requirements:
|
163
|
-
- - '>='
|
149
|
+
- - ! '>='
|
164
150
|
- !ruby/object:Gem::Version
|
165
151
|
version: '0'
|
166
152
|
requirements: []
|
167
153
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.2.2
|
169
155
|
signing_key:
|
170
156
|
specification_version: 4
|
171
157
|
summary: Simple Gem to interact witht the Steam Web API
|
@@ -179,4 +165,3 @@ test_files:
|
|
179
165
|
- spec/steam/users-stats_spec.rb
|
180
166
|
- spec/steam/users_spec.rb
|
181
167
|
- spec/steam_spec.rb
|
182
|
-
has_rdoc:
|