outrageous 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/outrageous.rb +1 -0
- data/lib/outrageous/base.rb +7 -8
- data/lib/outrageous/champion.rb +5 -2
- data/lib/outrageous/game.rb +2 -4
- data/lib/outrageous/league.rb +20 -19
- data/lib/outrageous/static_data/base.rb +2 -15
- data/lib/outrageous/static_data/champion.rb +0 -1
- data/lib/outrageous/static_data/item.rb +0 -1
- data/lib/outrageous/static_data/mastery.rb +0 -1
- data/lib/outrageous/static_data/realm.rb +0 -1
- data/lib/outrageous/static_data/rune.rb +0 -1
- data/lib/outrageous/static_data/summoner_spell.rb +0 -1
- data/lib/outrageous/stats.rb +4 -5
- data/lib/outrageous/summoner.rb +11 -11
- data/lib/outrageous/team.rb +9 -9
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79876b09590ca58d3dc9198a2c4628a8610b1ee6
|
4
|
+
data.tar.gz: a7a02b64858e22c1b62c94d0f6368e73c28a9b84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8ccf00bbf15d8a442ce62ce7881bd92a28add9fe5335a858804109ef4548fed5f459c718ee42920dc5abf1f8d071c2c1474d3dcfdde69aaf06f335f2da1653b
|
7
|
+
data.tar.gz: 31572dbf7397de742678501eb168bc04f238c5766f06c46976699b58733923fa320f8f4096c0a7a1dd62172385c7a042ba09b8b777ece2a44b328be6c9cf27da
|
data/README.md
CHANGED
@@ -60,7 +60,7 @@ Outrageous::League.new(api_key: 'your-truly-truly-truly-outrageously-api-key').g
|
|
60
60
|
Outrageous::League.new(api_key: 'your-truly-truly-truly-outrageously-api-key').get_leagues_entry_by_team_id(team_id)
|
61
61
|
|
62
62
|
# GET /api/lol/{region}/v2.3/league/challenger Retrieves challenger tier leagues. (REST)
|
63
|
-
Outrageous::League.new(api_key: 'your-truly-truly-truly-outrageously-api-key').get_challenger_info(type)
|
63
|
+
Outrageous::League.new(api_key: 'your-truly-truly-truly-outrageously-api-key').get_challenger_info(type: RANKED_SOLO_5_X_5')
|
64
64
|
|
65
65
|
```
|
66
66
|
|
data/lib/outrageous.rb
CHANGED
data/lib/outrageous/base.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'httparty'
|
2
2
|
require 'json'
|
3
|
-
require 'debugger'
|
4
3
|
|
5
4
|
module Outrageous
|
6
5
|
|
@@ -9,12 +8,12 @@ module Outrageous
|
|
9
8
|
|
10
9
|
base_uri 'https://prod.api.pvp.net'
|
11
10
|
|
12
|
-
CHAMPION_VERSION = 'v1.
|
11
|
+
CHAMPION_VERSION = 'v1.2'
|
13
12
|
GAME_VERSION = 'v1.3'
|
14
13
|
LEAGUE_VERSION = 'v2.3'
|
15
|
-
STATS_VERSION = 'v1.
|
14
|
+
STATS_VERSION = 'v1.3'
|
16
15
|
STATIC_DATA_VERSION = 'v1'
|
17
|
-
SUMMONER_VERSION = 'v1.
|
16
|
+
SUMMONER_VERSION = 'v1.4'
|
18
17
|
TEAM_VERSION = 'v2.2'
|
19
18
|
|
20
19
|
attr_accessor :region, :api_key, :version, :response, :status
|
@@ -26,13 +25,13 @@ module Outrageous
|
|
26
25
|
end
|
27
26
|
|
28
27
|
def region
|
29
|
-
|
28
|
+
!@region.nil? && !@region.empty? ? @region : 'euw'
|
30
29
|
end
|
31
30
|
|
32
|
-
|
33
|
-
|
31
|
+
def get(url, options = {})
|
32
|
+
response = self.class.get(url, query: { api_key: api_key }.merge(options))
|
34
33
|
self.status = response.code
|
35
|
-
self.response
|
34
|
+
self.response = response.parsed_response
|
36
35
|
end
|
37
36
|
end
|
38
37
|
end
|
data/lib/outrageous/champion.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
module Outrageous
|
2
|
-
|
3
2
|
class Champion < Base
|
4
3
|
def all(options = {})
|
5
|
-
|
4
|
+
get("/api/lol/#{region}/#{version || CHAMPION_VERSION}/champion", options)
|
5
|
+
end
|
6
|
+
|
7
|
+
def find(id, options = {})
|
8
|
+
get("/api/lol/#{region}/#{version || CHAMPION_VERSION}/champion/#{id}", options)
|
6
9
|
end
|
7
10
|
end
|
8
11
|
end
|
data/lib/outrageous/game.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
module Outrageous
|
2
|
-
|
3
2
|
class Game < Base
|
4
|
-
|
5
|
-
|
6
|
-
respond self.class.get("/api/lol/#{region}/#{version || GAME_VERSION}/game/by-summoner/#{summoner_id}/recent", query: { api_key: api_key })
|
3
|
+
def find(summoner_id, options = {})
|
4
|
+
get("/api/lol/#{region}/#{version || GAME_VERSION}/game/by-summoner/#{summoner_id}/recent", options)
|
7
5
|
end
|
8
6
|
end
|
9
7
|
end
|
data/lib/outrageous/league.rb
CHANGED
@@ -1,38 +1,39 @@
|
|
1
1
|
module Outrageous
|
2
|
-
|
3
2
|
class League < Base
|
4
3
|
|
5
|
-
def get_leagues_with_team_by_summoner_id(summoner_id)
|
6
|
-
|
4
|
+
def get_leagues_with_team_by_summoner_id(summoner_id, options = {})
|
5
|
+
get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/by-summoner/#{summoner_id}", options)
|
7
6
|
end
|
8
7
|
|
9
|
-
def get_leagues_entry_by_summoner_id(summoner_id)
|
10
|
-
|
8
|
+
def get_leagues_entry_by_summoner_id(summoner_id, options = {})
|
9
|
+
get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/by-summoner/#{summoner_id}/entry", options)
|
11
10
|
end
|
12
11
|
|
13
|
-
def get_leagues_by_team_id(team_id)
|
14
|
-
|
12
|
+
def get_leagues_by_team_id(team_id, options = {})
|
13
|
+
get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/by-team/#{team_id}", options)
|
15
14
|
end
|
16
15
|
|
17
|
-
def get_leagues_entry_by_team_id(team_id)
|
18
|
-
|
16
|
+
def get_leagues_entry_by_team_id(team_id, options = {})
|
17
|
+
get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/by-team/#{team_id}/entry", options)
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_challenger_info(options = { type: 'RANKED_SOLO_5x5' })
|
21
|
+
get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/challenger", options)
|
19
22
|
end
|
20
23
|
|
21
|
-
|
22
|
-
|
24
|
+
# Premade methods
|
25
|
+
def get_challenger_solo_q
|
26
|
+
RANKED_SOLO_5x5
|
27
|
+
get_challenger_info(type: 'RANKED_SOLO_5x5')
|
23
28
|
end
|
24
29
|
|
25
|
-
def get_challenger_team_3_vs_3
|
26
|
-
get_challenger_info('
|
30
|
+
def get_challenger_team_3_vs_3
|
31
|
+
get_challenger_info(type: 'RANKED_TEAM_3x3')
|
27
32
|
end
|
28
33
|
|
29
|
-
def get_challenger_team_5_vs_5
|
30
|
-
get_challenger_info('
|
34
|
+
def get_challenger_team_5_vs_5
|
35
|
+
get_challenger_info(type: 'RANKED_TEAM_5x5')
|
31
36
|
end
|
32
|
-
|
33
|
-
def get_challenger_info(type)
|
34
|
-
respond self.class.get("/api/lol/#{region}/#{version || LEAGUE_VERSION}/league/challenger", query: { api_key: api_key, type: type })
|
35
|
-
end
|
36
37
|
end
|
37
38
|
end
|
38
39
|
|
@@ -14,12 +14,12 @@ module Outrageous
|
|
14
14
|
|
15
15
|
# List elements
|
16
16
|
def all(options = {})
|
17
|
-
|
17
|
+
get("/api/lol/static-data/#{region}/#{version || STATIC_DATA_VERSION}/#{self.class.api_model}", options)
|
18
18
|
end
|
19
19
|
|
20
20
|
# Show a specific element
|
21
21
|
def find(id, options = {})
|
22
|
-
|
22
|
+
get("/api/lol/static-data/#{region}/#{version || STATIC_DATA_VERSION}/#{self.class.api_model}/#{id}", options)
|
23
23
|
end
|
24
24
|
|
25
25
|
protected
|
@@ -35,19 +35,6 @@ module Outrageous
|
|
35
35
|
end
|
36
36
|
END
|
37
37
|
end
|
38
|
-
|
39
|
-
def self.data_key(key)
|
40
|
-
instance_eval <<-END
|
41
|
-
def data_key
|
42
|
-
'#{key}'
|
43
|
-
end
|
44
|
-
END
|
45
|
-
class_eval <<-END
|
46
|
-
def data_key
|
47
|
-
'#{key}'
|
48
|
-
end
|
49
|
-
END
|
50
|
-
end
|
51
38
|
end
|
52
39
|
end
|
53
40
|
end
|
data/lib/outrageous/stats.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
module Outrageous
|
2
|
-
|
3
2
|
class Stats < Base
|
4
3
|
|
5
|
-
def player_ranked_by_season(summoner_id,
|
6
|
-
|
4
|
+
def player_ranked_by_season(summoner_id, options = { season: 'SEASON4'})
|
5
|
+
get("/api/lol/#{region}/#{version || STATS_VERSION}/stats/by-summoner/#{summoner_id}/ranked", options)
|
7
6
|
end
|
8
7
|
|
9
|
-
def player_summary_by_season(summoner_id,
|
10
|
-
|
8
|
+
def player_summary_by_season(summoner_id, options = { season: 'SEASON4'})
|
9
|
+
get("/api/lol/#{region}/#{version || STATS_VERSION}/stats/by-summoner/#{summoner_id}/summary", options)
|
11
10
|
end
|
12
11
|
end
|
13
12
|
end
|
data/lib/outrageous/summoner.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
module Outrageous
|
2
|
-
|
3
2
|
class Summoner < Base
|
4
3
|
|
5
|
-
def find_by_names(summoner_names = [])
|
4
|
+
def find_by_names(summoner_names = [], options = {})
|
5
|
+
summoner_names =
|
6
6
|
summoner_names = [summoner_names] if !summoner_names.is_a? Array
|
7
|
-
|
7
|
+
get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/by-name/#{summoner_names.map { |s| URI::encode(s) }.join(',')}", options)
|
8
8
|
end
|
9
9
|
|
10
|
-
def find_by_ids(summoner_ids = [])
|
10
|
+
def find_by_ids(summoner_ids = [], options = {})
|
11
11
|
summoner_ids = [summoner_ids] if !summoner_ids.is_a? Array
|
12
|
-
|
12
|
+
get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/#{summoner_ids.join(',')}", options)
|
13
13
|
end
|
14
14
|
|
15
|
-
def find_masteries(summoner_ids = [])
|
15
|
+
def find_masteries(summoner_ids = [], options = {})
|
16
16
|
summoner_ids = [summoner_ids] if !summoner_ids.is_a? Array
|
17
|
-
|
17
|
+
get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/#{summoner_ids.join(',')}/masteries", options)
|
18
18
|
end
|
19
19
|
|
20
|
-
def find_names(summoner_ids = [])
|
20
|
+
def find_names(summoner_ids = [], options = {})
|
21
21
|
summoner_ids = [summoner_ids] if !summoner_ids.is_a? Array
|
22
|
-
|
22
|
+
get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/#{summoner_ids.join(',')}/name", options)
|
23
23
|
end
|
24
24
|
|
25
|
-
def find_runes(summoner_ids = [])
|
25
|
+
def find_runes(summoner_ids = [], options = {})
|
26
26
|
summoner_ids = [summoner_ids] if !summoner_ids.is_a? Array
|
27
|
-
|
27
|
+
get("/api/lol/#{region}/#{version || SUMMONER_VERSION}/summoner/#{summoner_ids.join(',')}/runes", options)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
data/lib/outrageous/team.rb
CHANGED
@@ -2,16 +2,16 @@ module Outrageous
|
|
2
2
|
|
3
3
|
class Team < Base
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
# GET /api/lol/{region}/v2.2/team/by-summoner/{summonerId} Retrieves teams for given summoner ID. (REST)
|
6
|
+
def find_by_summoner_id(summoner_id, options = {})
|
7
|
+
get("/api/lol/#{region}/#{version || TEAM_VERSION}/team/by-summoner/#{summoner_id}", options)
|
8
|
+
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
# GET /api/lol/{region}/v2.2/team/{teamIds} Get teams mapped by team ID for a given list of team IDs. (REST)
|
11
|
+
def find_by_ids(teams_ids, options = {})
|
12
|
+
teams_ids = [teams_ids] if !teams_ids.is_a? Array
|
13
|
+
get("/api/lol/#{region}/#{version || TEAM_VERSION}/team/#{teams_ids.join(',')}", options)
|
14
|
+
end
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: outrageous
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xxswingxx
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '0.13'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '0.13'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: shoulda
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3'
|
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
|
-
version: '
|
40
|
+
version: '3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rdoc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,28 +72,28 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 2.0
|
75
|
+
version: '2.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 2.0
|
82
|
+
version: '2.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: simplecov
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '0.8'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '0.8'
|
97
97
|
description: A ruby wrapper for the official League of Legends API in an outrageous
|
98
98
|
package
|
99
99
|
email: vidadelaempresa@gmail.com
|
@@ -124,7 +124,7 @@ homepage: http://github.com/xxswingxx/outrageous
|
|
124
124
|
licenses:
|
125
125
|
- MIT
|
126
126
|
metadata: {}
|
127
|
-
post_install_message:
|
127
|
+
post_install_message: Gems are truly, truly, truly outrageous...
|
128
128
|
rdoc_options: []
|
129
129
|
require_paths:
|
130
130
|
- lib
|