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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e20af3d854b8c5f7fbb56f6fbfe94e6be61e744
4
- data.tar.gz: 69061b667be3bd835082fb20077b3835ff0a006e
3
+ metadata.gz: 2256ea4d83d6f1dda589d852530b416ca8ef9f76
4
+ data.tar.gz: e31ea5232da64b236e460d7dd1f5fcee9cf3ec69
5
5
  SHA512:
6
- metadata.gz: ab811f3276d40aba25e883672ec3b82e1c2b3425961841ca656ef010c9319251d33748d4d64e99f1f4924a45f47b90ab6e3f758650d9b9f6794af8236c015e4b
7
- data.tar.gz: 2498e174d418df266c8984d9e976759afb4eb75fb98c336ddd2fc2976b05e7635033b130f401e82f595c039fd282c5e0cb117440a509eb051491bdce4c5b4178
6
+ metadata.gz: ee2de0222a67b484325cd4e41ac6e5caf734a851dbf9ed68056973a2970b7e7713581c8e928a1ec4f6a5f2bad345fce3e816c144ee011c02ecc525908fa424e8
7
+ data.tar.gz: 1f82644f6372b738ac39b44d0b81c724bbfa5fa73e957de46ec411dd098361953f853b550bbc44dfaafa3dd2eb3112c25fe6f06faeab4feb594a4a85546e6897
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  *.gem
2
+ .idea/
2
3
  /.bundle/
3
4
  /.yardoc
4
5
  /Gemfile.lock
data/.travis.yml CHANGED
@@ -1,3 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.1.5
3
4
  - 2.2.1
5
+
data/README.md CHANGED
@@ -1,10 +1,14 @@
1
- [![Code Climate](https://codeclimate.com/github/josephyi/taric/badges/gpa.svg)](https://codeclimate.com/github/josephyi/taric)
2
-
3
1
  # Taric
4
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/taric.svg)](http://badge.fury.io/rb/taric)
4
+ [![Code Climate](https://codeclimate.com/github/josephyi/taric/badges/gpa.svg)](https://codeclimate.com/github/josephyi/taric)
5
+ [![Build Status](https://travis-ci.org/josephyi/taric.svg?branch=master)](https://travis-ci.org/josephyi/taric)
6
+ [![Coverage Status](https://coveralls.io/repos/josephyi/taric/badge.svg?branch=master)](https://coveralls.io/r/josephyi/taric?branch=master)
7
+ [![Inline docs](http://inch-ci.org/github/josephyi/taric.svg?branch=master)](http://inch-ci.org/github/josephyi/taric)
8
+
5
9
  > "Ruby for vigor."
6
10
 
7
- Taric is a wrapper client to Riot Games' League of Legends API.
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
- > ""Brilliantly."
111
+ > "Brilliantly."
108
112
 
109
- 1. Fork it ( https://github.com/[my-github-username]/taric/fork )
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
@@ -1,2 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
2
3
 
4
+ RSpec::Core::RakeTask.new('spec')
5
+ task :default => :spec
6
+ task :test => :spec
@@ -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
@@ -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
- BY_IDS = Addressable::Template.new "#{BASE_SUMMONER_URL}/{summonerIds}{?api_key}"
12
- MASTERIES = Addressable::Template.new "#{BY_IDS}/masteries{?api_key}"
13
- NAMES = Addressable::Template.new "#{BY_IDS}/name{?api_key}"
14
- RUNES = Addressable::Template.new "#{BY_IDS}/rune{?api_key}"
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
- def summoners_by_names(names:)
17
- response_for BY_NAMES, {summonerNames: names}
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 BY_IDS, {summonerIds: summoner_ids}
39
+ response_for SUMMONERS_BY_IDS, {summonerIds: summoner_ids}
22
40
  end
23
41
 
24
- def masteries(summoner_ids:)
42
+ def summoner_masteries(summoner_ids:)
25
43
  response_for MASTERIES, {summonerIds: summoner_ids}
26
44
  end
27
45
 
28
- def name(summoner_ids)
29
- response_for NAME, {summonerIds: summoner_ids}
46
+ def summoner_ids_to_names(summoner_ids:)
47
+ response_for NAMES, {summonerIds: summoner_ids}
30
48
  end
31
49
 
32
- def runes(summoner_ids:)
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
@@ -1,3 +1,3 @@
1
1
  module Taric
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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 Api Client}
13
- spec.description = %q{Riot Games LoL Api Client.}
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", "~> 1.8"
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.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-16 00:00:00.000000000 Z
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: '1.8'
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: '1.8'
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 Api Client.
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.3
243
+ rubygems_version: 2.4.6
232
244
  signing_key:
233
245
  specification_version: 4
234
- summary: Riot Games LoL Api Client
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
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
4
- </project>
data/.idea/misc.xml DELETED
@@ -1,4 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.2.0 [global]" project-jdk-type="RUBY_SDK" />
4
- </project>
data/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/taric.iml" filepath="$PROJECT_DIR$/.idea/taric.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,5 +0,0 @@
1
- <component name="DependencyValidationManager">
2
- <state>
3
- <option name="SKIP_IMPORT_STATEMENTS" value="false" />
4
- </state>
5
- </component>
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>
data/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>