steam-client 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/steam-client/client.rb +14 -0
- data/lib/steam-client/version.rb +1 -1
- metadata +2 -2
data/lib/steam-client/client.rb
CHANGED
@@ -3,6 +3,15 @@ require 'crack'
|
|
3
3
|
require 'json'
|
4
4
|
|
5
5
|
module SteamClient
|
6
|
+
|
7
|
+
module Error
|
8
|
+
class PrivateProfileError < StandardError
|
9
|
+
def message
|
10
|
+
"This profile is private"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
6
15
|
class Client
|
7
16
|
|
8
17
|
attr_reader :api_key
|
@@ -77,6 +86,11 @@ module SteamClient
|
|
77
86
|
url = "http://steamcommunity.com/profiles/#{id}/games\?tab=all&xml\=1"
|
78
87
|
xml = get_with_retries url
|
79
88
|
hGames = Crack::XML.parse xml
|
89
|
+
|
90
|
+
if hGames['gamesList'].has_key?("error") and hGames['gamesList']['error'] =~ /This profile is private/
|
91
|
+
raise SteamClient::Error::PrivateProfileError
|
92
|
+
end
|
93
|
+
|
80
94
|
games = []
|
81
95
|
hGames['gamesList']['games']['game'].each do |game|
|
82
96
|
games << Game.new(game)
|
data/lib/steam-client/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steam-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -86,7 +86,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: '0'
|
87
87
|
segments:
|
88
88
|
- 0
|
89
|
-
hash:
|
89
|
+
hash: 1440330125261866805
|
90
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
91
|
none: false
|
92
92
|
requirements:
|