ugcleague 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/ugcleague/api.rb +2 -2
- data/lib/ugcleague/client.rb +1 -1
- data/lib/ugcleague/configuration.rb +2 -2
- data/lib/ugcleague/error.rb +1 -1
- data/lib/ugcleague/request.rb +1 -9
- data/lib/ugcleague/version.rb +2 -2
- data/lib/ugcleague.rb +2 -2
- data/ugcleague_api.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffdabc668463f92fd55f1f5cf0a177020b77a5db
|
4
|
+
data.tar.gz: c92a396ac0fec625ea27af23d7bba59d2e76d567
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7006d86e679780c061128e1e162c44be573d34094a1c1c0cf8a3000c4cb6c51b0f44c7dfa90111d498e30b2100f7ab5a55096232172238ba4f755e5047f64e29
|
7
|
+
data.tar.gz: c54bd3acbc1f810400acd1079fe4aebc1e8366e0d3e5e7a6176044c0c2061837d004a864fa81a48cff83bce4aec9931161f0e40c022f8c9d1fede139eb10f8fd
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ Configuration:
|
|
23
23
|
```
|
24
24
|
require 'ugcleague'
|
25
25
|
|
26
|
-
|
26
|
+
UGCLeague.configure do |config|
|
27
27
|
config.api_key = "API Key" # Obtain from a UGC admin.
|
28
28
|
config.user_agent = "User agent" # User agent to be sent with the request.
|
29
29
|
end
|
@@ -33,15 +33,15 @@ Examples:
|
|
33
33
|
|
34
34
|
```
|
35
35
|
# Set the API key.
|
36
|
-
|
36
|
+
UGCLeague.api_key = "API Key"
|
37
37
|
|
38
38
|
# Set the user agent.
|
39
|
-
|
39
|
+
UGCLeague.user_agent = "User agent"
|
40
40
|
|
41
41
|
# Get a player's team history.
|
42
|
-
|
42
|
+
UGCLeague.player_history(76561198063808035)
|
43
43
|
|
44
44
|
# Get a player's current team.
|
45
|
-
|
45
|
+
UGCLeague.player_current(76561198063808035)
|
46
46
|
```
|
47
47
|
|
data/lib/ugcleague/api.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
module
|
1
|
+
module UGCLeague
|
2
2
|
class API < Request
|
3
3
|
|
4
4
|
attr_accessor(*Configuration::VALID_OPTIONS_KEYS)
|
5
5
|
|
6
6
|
def initialize(options={})
|
7
|
-
options =
|
7
|
+
options = UGCLeague.options.merge(options)
|
8
8
|
(Configuration::VALID_OPTIONS_KEYS).each do |key|
|
9
9
|
send("#{key}=", options[key]) if options[key]
|
10
10
|
end
|
data/lib/ugcleague/client.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
module
|
1
|
+
module UGCLeague
|
2
2
|
module Configuration
|
3
3
|
|
4
4
|
VALID_OPTIONS_KEYS = [:api_key, :user_agent].freeze
|
5
5
|
|
6
|
-
DEFAULT_USER_AGENT = "UGC League Ruby Gem #{
|
6
|
+
DEFAULT_USER_AGENT = "UGC League Ruby Gem #{UGCLeague::VERSION}".freeze
|
7
7
|
|
8
8
|
attr_accessor(*VALID_OPTIONS_KEYS)
|
9
9
|
|
data/lib/ugcleague/error.rb
CHANGED
data/lib/ugcleague/request.rb
CHANGED
@@ -2,7 +2,7 @@ require 'httparty'
|
|
2
2
|
require 'json'
|
3
3
|
require 'rack'
|
4
4
|
|
5
|
-
module
|
5
|
+
module UGCLeague
|
6
6
|
class Request
|
7
7
|
|
8
8
|
include HTTParty
|
@@ -32,14 +32,6 @@ module UGC
|
|
32
32
|
|
33
33
|
private
|
34
34
|
|
35
|
-
def validate(response)
|
36
|
-
case response.body
|
37
|
-
when "Access denied."; raise Error::Unauthorized.new error_message(response)
|
38
|
-
end
|
39
|
-
|
40
|
-
response.parsed_response
|
41
|
-
end
|
42
|
-
|
43
35
|
def error_message(response)
|
44
36
|
parsed_response = response.parsed_response
|
45
37
|
|
data/lib/ugcleague/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "1.
|
1
|
+
module UGCLeague
|
2
|
+
VERSION = "1.1.0"
|
3
3
|
end
|
data/lib/ugcleague.rb
CHANGED
@@ -5,11 +5,11 @@ require 'ugcleague/request'
|
|
5
5
|
require 'ugcleague/api'
|
6
6
|
require 'ugcleague/client'
|
7
7
|
|
8
|
-
module
|
8
|
+
module UGCLeague
|
9
9
|
extend Configuration
|
10
10
|
|
11
11
|
def self.client(options={})
|
12
|
-
|
12
|
+
UGCLeague::Client.new(options)
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.method_missing(method, *args, &block)
|
data/ugcleague_api.gemspec
CHANGED
@@ -4,7 +4,7 @@ require 'ugcleague/version'
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "ugcleague"
|
7
|
-
gem.version =
|
7
|
+
gem.version = UGCLeague::VERSION
|
8
8
|
gem.authors = ["Ranndom"]
|
9
9
|
gem.email = ["Ranndom@rnndm.xyz"]
|
10
10
|
gem.description = %q{Ruby client for UGC League API}
|