ugcleague 1.0.0 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2186fb5e3d34ef40101b0855c86da380c7ee4ce
4
- data.tar.gz: 6e831cf17c5e237b88bdd133028a7cd3f7ccb29d
3
+ metadata.gz: ffdabc668463f92fd55f1f5cf0a177020b77a5db
4
+ data.tar.gz: c92a396ac0fec625ea27af23d7bba59d2e76d567
5
5
  SHA512:
6
- metadata.gz: e2e6407178c24277aae13d11f9b2f6bb0b9098e80a8a8138d594a62c91aa3e0f91545defa771266a1519099a7365e01b4adc12864b64ee5e51788ff3b1779bf7
7
- data.tar.gz: e11d3a0db720174c2cd65b921ffdae69561c239fe2c511571801179c6dadb1aaf74dc03478968047765da8df746b390c3a76d440ce26fe8e9129e40e22472cfd
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
- UGC.configure do |config|
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
- UGC.api_key = "API Key"
36
+ UGCLeague.api_key = "API Key"
37
37
 
38
38
  # Set the user agent.
39
- UGC.user_agent = "User agent"
39
+ UGCLeague.user_agent = "User agent"
40
40
 
41
41
  # Get a player's team history.
42
- UGC.player_history(76561198063808035)
42
+ UGCLeague.player_history(76561198063808035)
43
43
 
44
44
  # Get a player's current team.
45
- UGC.player_current(76561198063808035)
45
+ UGCLeague.player_current(76561198063808035)
46
46
  ```
47
47
 
data/lib/ugcleague/api.rb CHANGED
@@ -1,10 +1,10 @@
1
- module UGC
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 = UGC.options.merge(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
@@ -1,4 +1,4 @@
1
- module UGC
1
+ module UGCLeague
2
2
  class Client < API
3
3
 
4
4
  Dir[File.expand_path('../client/*.rb', __FILE__)].each {|f| require f}
@@ -1,9 +1,9 @@
1
- module UGC
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 #{UGC::VERSION}".freeze
6
+ DEFAULT_USER_AGENT = "UGC League Ruby Gem #{UGCLeague::VERSION}".freeze
7
7
 
8
8
  attr_accessor(*VALID_OPTIONS_KEYS)
9
9
 
@@ -1,4 +1,4 @@
1
- module UGC
1
+ module UGCLeague
2
2
  module Error
3
3
 
4
4
  class Error < StandardError; end
@@ -2,7 +2,7 @@ require 'httparty'
2
2
  require 'json'
3
3
  require 'rack'
4
4
 
5
- module UGC
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
 
@@ -1,3 +1,3 @@
1
- module UGC
2
- VERSION = "1.0.0"
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 UGC
8
+ module UGCLeague
9
9
  extend Configuration
10
10
 
11
11
  def self.client(options={})
12
- UGC::Client.new(options)
12
+ UGCLeague::Client.new(options)
13
13
  end
14
14
 
15
15
  def self.method_missing(method, *args, &block)
@@ -4,7 +4,7 @@ require 'ugcleague/version'
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "ugcleague"
7
- gem.version = UGC::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}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ugcleague
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ranndom