taric 0.1.1 → 0.1.2
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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +2 -0
- data/README.md +9 -5
- data/Rakefile +4 -0
- data/lib/taric/operation/champion.rb +10 -0
- data/lib/taric/operation/current_game.rb +8 -0
- data/lib/taric/operation/featured_games.rb +7 -0
- data/lib/taric/operation/game.rb +8 -0
- data/lib/taric/operation/summoner.rb +30 -12
- data/lib/taric/version.rb +1 -1
- data/taric.gemspec +4 -3
- metadata +29 -17
- data/.idea/.name +0 -1
- data/.idea/.rakeTasks +0 -7
- data/.idea/encodings.xml +0 -4
- data/.idea/misc.xml +0 -4
- data/.idea/modules.xml +0 -8
- data/.idea/scopes/scope_settings.xml +0 -5
- data/.idea/taric.iml +0 -40
- data/.idea/vcs.xml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2256ea4d83d6f1dda589d852530b416ca8ef9f76
|
4
|
+
data.tar.gz: e31ea5232da64b236e460d7dd1f5fcee9cf3ec69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee2de0222a67b484325cd4e41ac6e5caf734a851dbf9ed68056973a2970b7e7713581c8e928a1ec4f6a5f2bad345fce3e816c144ee011c02ecc525908fa424e8
|
7
|
+
data.tar.gz: 1f82644f6372b738ac39b44d0b81c724bbfa5fa73e957de46ec411dd098361953f853b550bbc44dfaafa3dd2eb3112c25fe6f06faeab4feb594a4a85546e6897
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
-
[](https://codeclimate.com/github/josephyi/taric)
|
2
|
-
|
3
1
|
# Taric
|
4
2
|
|
3
|
+
[](http://badge.fury.io/rb/taric)
|
4
|
+
[](https://codeclimate.com/github/josephyi/taric)
|
5
|
+
[](https://travis-ci.org/josephyi/taric)
|
6
|
+
[](https://coveralls.io/r/josephyi/taric?branch=master)
|
7
|
+
[](http://inch-ci.org/github/josephyi/taric)
|
8
|
+
|
5
9
|
> "Ruby for vigor."
|
6
10
|
|
7
|
-
Taric is
|
11
|
+
Taric is Ruby interface to Riot Games' League of Legends API.
|
8
12
|
|
9
13
|
## Prerequisite
|
10
14
|
|
@@ -104,9 +108,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
104
108
|
|
105
109
|
## Contributing
|
106
110
|
|
107
|
-
> "
|
111
|
+
> "Brilliantly."
|
108
112
|
|
109
|
-
1. Fork it ( https://github.com/
|
113
|
+
1. Fork it ( https://github.com/josephyi/taric/fork )
|
110
114
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
111
115
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
112
116
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
@@ -11,6 +11,16 @@ module Taric
|
|
11
11
|
CHAMPIONS = Addressable::Template.new("#{CHAMPION_BASE_URL}{?api_key,freeToPlay}")
|
12
12
|
CHAMPION_BY_ID = Addressable::Template.new("#{CHAMPION_BASE_URL}/{id}{?api_key}")
|
13
13
|
|
14
|
+
# Returns [Hash] embedding an [Array] of champion data.
|
15
|
+
#
|
16
|
+
# @see {https://developer.riotgames.com/api/methods#!/958/3290}
|
17
|
+
# @param free_to_play [Boolean] optional, nil returns all, true or false to filter if they're free to play or not
|
18
|
+
# @return [Hash] embedding [Array] of champions keyed off of "champions"
|
19
|
+
#
|
20
|
+
# @example
|
21
|
+
# all_champions = client.champions["champions"]
|
22
|
+
# free_champions = client.champions(free_to_play: true)["champions"]
|
23
|
+
# nonfree_champions = client.champions(free_to_play: false)["champions"]
|
14
24
|
def champions(free_to_play: nil)
|
15
25
|
response_for CHAMPIONS, freeToPlay: free_to_play
|
16
26
|
end
|
@@ -3,6 +3,14 @@ module Taric
|
|
3
3
|
module CurrentGame
|
4
4
|
GAME_INFO = Addressable::Template.new 'https://{host}/observer-mode/rest/consumer/getSpectatorGameInfo/{platform_id}/{summonerId}{?api_key}'
|
5
5
|
|
6
|
+
# Returns [Hash] of game data for summoner id
|
7
|
+
#
|
8
|
+
# @see {https://developer.riotgames.com/api/methods#!/956/3287}
|
9
|
+
# @param summoner_id [Fixnum] required, id of summoner
|
10
|
+
# @return [Hash] of game data for summoner id
|
11
|
+
#
|
12
|
+
# @example
|
13
|
+
# current_game = client.current_game(summoner_id: 21066)
|
6
14
|
def current_game(summoner_id:)
|
7
15
|
response_for GAME_INFO, summonerId: summoner_id
|
8
16
|
end
|
@@ -3,6 +3,13 @@ module Taric
|
|
3
3
|
module FeaturedGames
|
4
4
|
FEATURED_GAMES = Addressable::Template.new 'https://{host}/observer-mode/rest/featured{?api_key}'
|
5
5
|
|
6
|
+
# Returns [Hash] of featured games in [Array] keyed by 'gameList'
|
7
|
+
#
|
8
|
+
# @see {https://developer.riotgames.com/api/methods#!/957/3288}
|
9
|
+
# @return [Hash] of featured games in [Array] keyed by 'gameList'
|
10
|
+
#
|
11
|
+
# @example
|
12
|
+
# featured_games = client.featured_games['gameList']
|
6
13
|
def featured_games
|
7
14
|
response_for FEATURED_GAMES
|
8
15
|
end
|
data/lib/taric/operation/game.rb
CHANGED
@@ -7,6 +7,14 @@ module Taric
|
|
7
7
|
GAME_VERSION = 'v1.3'.freeze
|
8
8
|
RECENT = Addressable::Template.new "#{BASE_URL_FN.(GAME_VERSION)}/game/by-summoner/{summonerId}/recent{?api_key}"
|
9
9
|
|
10
|
+
# Returns [Hash] of recent game data for summoner id in an [Array] keyed by 'games'
|
11
|
+
#
|
12
|
+
# @see {https://developer.riotgames.com/api/methods#!/959/3291}
|
13
|
+
# @param summoner_id [Fixnum] required, id of summoner
|
14
|
+
# @return [Hash] of recent game data for summoner id
|
15
|
+
#
|
16
|
+
# @example
|
17
|
+
# recent_games = client.recent_game(summoner_id: 21066)['games']
|
10
18
|
def recent_games(summoner_id:)
|
11
19
|
response_for RECENT, {summonerId: summoner_id}
|
12
20
|
end
|
@@ -6,30 +6,48 @@ module Taric
|
|
6
6
|
|
7
7
|
VERSION = 'v1.4'
|
8
8
|
BASE_SUMMONER_URL = "#{BASE_URL_FN.(VERSION)}/summoner"
|
9
|
-
|
10
9
|
BY_NAMES = Addressable::Template.new "#{BASE_SUMMONER_URL}/by-name/{summonerNames}{?api_key}"
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
BASE_SUMMONERS_BY_IDS = "#{BASE_SUMMONER_URL}/{summonerIds}"
|
11
|
+
SUMMONERS_BY_IDS = Addressable::Template.new "#{BASE_SUMMONERS_BY_IDS}{?api_key}"
|
12
|
+
MASTERIES = Addressable::Template.new "#{BASE_SUMMONERS_BY_IDS}/masteries{?api_key}"
|
13
|
+
NAMES = Addressable::Template.new "#{BASE_SUMMONERS_BY_IDS}/name{?api_key}"
|
14
|
+
RUNES = Addressable::Template.new "#{BASE_SUMMONERS_BY_IDS}/runes{?api_key}"
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
# Returns [Hash] of summoner data hashes keyed by summoner name
|
17
|
+
#
|
18
|
+
# @see {https://developer.riotgames.com/api/methods#!/960/3292}
|
19
|
+
# @param summoner_names [String] required, summoner names separated by commas
|
20
|
+
# @return [Hash] of summoner data hashes keyed by summoner name
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# summoners = client.summoners_by_name(summoner_names: 'orlyzomg,ipa,dbanksdesign,lzrface,doodiediddle')
|
24
|
+
# summoner = summoners['orlyzomg']
|
25
|
+
def summoners_by_names(summoner_names:)
|
26
|
+
response_for BY_NAMES, {summonerNames: summoner_names}
|
18
27
|
end
|
19
28
|
|
29
|
+
# Returns [Hash] of summoner data hashes keyed by summoner ID
|
30
|
+
#
|
31
|
+
# @see {https://developer.riotgames.com/api/methods#!/960/3293}
|
32
|
+
# @param summoner_ids [String] required, summoner IDs separated by commas
|
33
|
+
# @return [Hash] of summoner data hashes keyed by summoner ID
|
34
|
+
#
|
35
|
+
# @example
|
36
|
+
# summoners = client.summoners_by_id(summoner_ids: '39497114,35035046,38332778,21066,38877656')
|
37
|
+
# summoner = summoners['21066']
|
20
38
|
def summoners_by_ids(summoner_ids:)
|
21
|
-
response_for
|
39
|
+
response_for SUMMONERS_BY_IDS, {summonerIds: summoner_ids}
|
22
40
|
end
|
23
41
|
|
24
|
-
def
|
42
|
+
def summoner_masteries(summoner_ids:)
|
25
43
|
response_for MASTERIES, {summonerIds: summoner_ids}
|
26
44
|
end
|
27
45
|
|
28
|
-
def
|
29
|
-
response_for
|
46
|
+
def summoner_ids_to_names(summoner_ids:)
|
47
|
+
response_for NAMES, {summonerIds: summoner_ids}
|
30
48
|
end
|
31
49
|
|
32
|
-
def
|
50
|
+
def summoner_runes(summoner_ids:)
|
33
51
|
response_for RUNES, {summonerIds: summoner_ids}
|
34
52
|
end
|
35
53
|
|
data/lib/taric/version.rb
CHANGED
data/taric.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Joseph Yi"]
|
10
10
|
spec.email = ["dissonance@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{Riot Games LoL
|
13
|
-
spec.description = %q{Riot Games LoL
|
12
|
+
spec.summary = %q{An outrageous Riot Games LoL API Client}
|
13
|
+
spec.description = %q{An outrageous Riot Games LoL API Client}
|
14
14
|
spec.homepage = "http://github.com/josephyi/taric"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
@@ -20,10 +20,11 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler", "
|
23
|
+
spec.add_development_dependency "bundler", ">= 1.7", '< 2.0'
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
25
|
spec.add_development_dependency 'webmock', '~> 1.20'
|
26
26
|
spec.add_development_dependency 'rspec', '~> 3.2'
|
27
|
+
spec.add_development_dependency 'coveralls', '~> 0.7'
|
27
28
|
|
28
29
|
spec.add_dependency 'faraday', "~> 0.9"
|
29
30
|
spec.add_dependency 'typhoeus', "~> 0.3"
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taric
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Yi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
22
|
+
version: '2.0'
|
20
23
|
type: :development
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.7'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '2.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rake
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +72,20 @@ dependencies:
|
|
66
72
|
- - "~>"
|
67
73
|
- !ruby/object:Gem::Version
|
68
74
|
version: '3.2'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: coveralls
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0.7'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0.7'
|
69
89
|
- !ruby/object:Gem::Dependency
|
70
90
|
name: faraday
|
71
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,7 +184,7 @@ dependencies:
|
|
164
184
|
- - "~>"
|
165
185
|
- !ruby/object:Gem::Version
|
166
186
|
version: '1.1'
|
167
|
-
description: Riot Games LoL
|
187
|
+
description: An outrageous Riot Games LoL API Client
|
168
188
|
email:
|
169
189
|
- dissonance@gmail.com
|
170
190
|
executables: []
|
@@ -172,14 +192,6 @@ extensions: []
|
|
172
192
|
extra_rdoc_files: []
|
173
193
|
files:
|
174
194
|
- ".gitignore"
|
175
|
-
- ".idea/.name"
|
176
|
-
- ".idea/.rakeTasks"
|
177
|
-
- ".idea/encodings.xml"
|
178
|
-
- ".idea/misc.xml"
|
179
|
-
- ".idea/modules.xml"
|
180
|
-
- ".idea/scopes/scope_settings.xml"
|
181
|
-
- ".idea/taric.iml"
|
182
|
-
- ".idea/vcs.xml"
|
183
195
|
- ".rspec"
|
184
196
|
- ".travis.yml"
|
185
197
|
- CODE_OF_CONDUCT.md
|
@@ -228,8 +240,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
240
|
version: '0'
|
229
241
|
requirements: []
|
230
242
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.4.
|
243
|
+
rubygems_version: 2.4.6
|
232
244
|
signing_key:
|
233
245
|
specification_version: 4
|
234
|
-
summary: Riot Games LoL
|
246
|
+
summary: An outrageous Riot Games LoL API Client
|
235
247
|
test_files: []
|
data/.idea/.name
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
taric
|
data/.idea/.rakeTasks
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
-
You are allowed to:
|
4
|
-
1. Remove rake task
|
5
|
-
2. Add existing rake tasks
|
6
|
-
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
-
--><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
|
data/.idea/encodings.xml
DELETED
data/.idea/misc.xml
DELETED
data/.idea/modules.xml
DELETED
data/.idea/taric.iml
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<module type="RUBY_MODULE" version="4">
|
3
|
-
<component name="FacetManager">
|
4
|
-
<facet type="gem" name="Ruby Gem">
|
5
|
-
<configuration>
|
6
|
-
<option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
|
7
|
-
<option name="GEM_APP_TEST_PATH" value="$MODULE_DIR$/test" />
|
8
|
-
<option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
|
9
|
-
</configuration>
|
10
|
-
</facet>
|
11
|
-
</component>
|
12
|
-
<component name="NewModuleRootManager">
|
13
|
-
<content url="file://$MODULE_DIR$">
|
14
|
-
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
15
|
-
</content>
|
16
|
-
<orderEntry type="jdk" jdkName="RVM: ruby-2.1.5 [taric]" jdkType="RUBY_SDK" />
|
17
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
18
|
-
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.7, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
19
|
-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.8.5, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
20
|
-
<orderEntry type="library" scope="PROVIDED" name="crack (v0.4.2, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
21
|
-
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
22
|
-
<orderEntry type="library" scope="PROVIDED" name="ethon (v0.7.3, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
23
|
-
<orderEntry type="library" scope="PROVIDED" name="faraday (v0.9.1, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
24
|
-
<orderEntry type="library" scope="PROVIDED" name="faraday_middleware (v0.9.1, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
25
|
-
<orderEntry type="library" scope="PROVIDED" name="ffi (v1.9.8, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
26
|
-
<orderEntry type="library" scope="PROVIDED" name="hashie (v3.4.0, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
27
|
-
<orderEntry type="library" scope="PROVIDED" name="memoist (v0.11.0, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
28
|
-
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.11.0, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
29
|
-
<orderEntry type="library" scope="PROVIDED" name="multipart-post (v2.0.0, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
30
|
-
<orderEntry type="library" scope="PROVIDED" name="rake (v10.4.2, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
31
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.2.0, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
32
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.2.2, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
33
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.2.0, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
34
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.2.1, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
35
|
-
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.2.2, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
36
|
-
<orderEntry type="library" scope="PROVIDED" name="safe_yaml (v1.0.4, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
37
|
-
<orderEntry type="library" scope="PROVIDED" name="typhoeus (v0.7.1, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
38
|
-
<orderEntry type="library" scope="PROVIDED" name="webmock (v1.20.4, RVM: ruby-2.1.5 [taric]) [gem]" level="application" />
|
39
|
-
</component>
|
40
|
-
</module>
|