steam-client 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module SteamClient
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
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.7
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: 2903207765894671952
89
+ hash: 1440330125261866805
90
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  none: false
92
92
  requirements: