wargaming_api_ruby 0.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.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +24 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +30 -0
  6. data/Rakefile +2 -0
  7. data/lib/wargaming_api.rb +15 -0
  8. data/lib/wargaming_api/base.rb +21 -0
  9. data/lib/wargaming_api/concern.rb +4 -0
  10. data/lib/wargaming_api/concern/attributable.rb +23 -0
  11. data/lib/wargaming_api/config.rb +4 -0
  12. data/lib/wargaming_api/error.rb +4 -0
  13. data/lib/wargaming_api/error/response_error.rb +8 -0
  14. data/lib/wargaming_api/node.rb +69 -0
  15. data/lib/wargaming_api/util.rb +6 -0
  16. data/lib/wargaming_api/util/http.rb +11 -0
  17. data/lib/wargaming_api/util/params.rb +8 -0
  18. data/lib/wargaming_api/util/uri.rb +8 -0
  19. data/lib/wargaming_api/version.rb +3 -0
  20. data/lib/wargaming_api/wot.rb +10 -0
  21. data/lib/wargaming_api/wot/account.rb +7 -0
  22. data/lib/wargaming_api/wot/account/achievements.rb +4 -0
  23. data/lib/wargaming_api/wot/account/info.rb +4 -0
  24. data/lib/wargaming_api/wot/account/list.rb +4 -0
  25. data/lib/wargaming_api/wot/account/tanks.rb +4 -0
  26. data/lib/wargaming_api/wot/clan.rb +11 -0
  27. data/lib/wargaming_api/wot/clan/battles.rb +4 -0
  28. data/lib/wargaming_api/wot/clan/info.rb +4 -0
  29. data/lib/wargaming_api/wot/clan/list.rb +4 -0
  30. data/lib/wargaming_api/wot/clan/members_info.rb +4 -0
  31. data/lib/wargaming_api/wot/clan/provinces.rb +4 -0
  32. data/lib/wargaming_api/wot/clan/top.rb +4 -0
  33. data/lib/wargaming_api/wot/clan/victory_points.rb +4 -0
  34. data/lib/wargaming_api/wot/clan/victory_points_history.rb +4 -0
  35. data/lib/wargaming_api/wot/clan_ratings.rb +8 -0
  36. data/lib/wargaming_api/wot/clan_ratings/clans.rb +4 -0
  37. data/lib/wargaming_api/wot/clan_ratings/dates.rb +4 -0
  38. data/lib/wargaming_api/wot/clan_ratings/neighbors.rb +4 -0
  39. data/lib/wargaming_api/wot/clan_ratings/top.rb +4 -0
  40. data/lib/wargaming_api/wot/clan_ratings/types.rb +4 -0
  41. data/lib/wargaming_api/wot/encyclopedia.rb +13 -0
  42. data/lib/wargaming_api/wot/encyclopedia/achievements.rb +4 -0
  43. data/lib/wargaming_api/wot/encyclopedia/arenas.rb +4 -0
  44. data/lib/wargaming_api/wot/encyclopedia/info.rb +4 -0
  45. data/lib/wargaming_api/wot/encyclopedia/tank_chassis.rb +4 -0
  46. data/lib/wargaming_api/wot/encyclopedia/tank_engines.rb +4 -0
  47. data/lib/wargaming_api/wot/encyclopedia/tank_guns.rb +4 -0
  48. data/lib/wargaming_api/wot/encyclopedia/tank_info.rb +4 -0
  49. data/lib/wargaming_api/wot/encyclopedia/tank_radios.rb +4 -0
  50. data/lib/wargaming_api/wot/encyclopedia/tank_turrets.rb +4 -0
  51. data/lib/wargaming_api/wot/encyclopedia/tanks.rb +4 -0
  52. data/lib/wargaming_api/wot/global_war.rb +13 -0
  53. data/lib/wargaming_api/wot/global_war/alley_of_fame.rb +4 -0
  54. data/lib/wargaming_api/wot/global_war/battles.rb +4 -0
  55. data/lib/wargaming_api/wot/global_war/clans.rb +4 -0
  56. data/lib/wargaming_api/wot/global_war/fame_points.rb +4 -0
  57. data/lib/wargaming_api/wot/global_war/fame_points_history.rb +4 -0
  58. data/lib/wargaming_api/wot/global_war/maps.rb +4 -0
  59. data/lib/wargaming_api/wot/global_war/provinces.rb +4 -0
  60. data/lib/wargaming_api/wot/global_war/top.rb +4 -0
  61. data/lib/wargaming_api/wot/global_war/tournaments.rb +4 -0
  62. data/lib/wargaming_api/wot/global_war/victory_points_history.rb +4 -0
  63. data/lib/wargaming_api/wot/ratings.rb +8 -0
  64. data/lib/wargaming_api/wot/ratings/accounts.rb +4 -0
  65. data/lib/wargaming_api/wot/ratings/dates.rb +4 -0
  66. data/lib/wargaming_api/wot/ratings/neighbors.rb +4 -0
  67. data/lib/wargaming_api/wot/ratings/top.rb +4 -0
  68. data/lib/wargaming_api/wot/ratings/types.rb +4 -0
  69. data/lib/wargaming_api/wot/tanks.rb +5 -0
  70. data/lib/wargaming_api/wot/tanks/achievements.rb +4 -0
  71. data/lib/wargaming_api/wot/tanks/stats.rb +4 -0
  72. data/wargaming_api_ruby.gemspec +26 -0
  73. metadata +171 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 612384e027eaf4f9704fb62f14e806016a7eaa47
4
+ data.tar.gz: 136f2d0c3722c84c085a12856ca42b66b9a66d7c
5
+ SHA512:
6
+ metadata.gz: 807f00298eac4f233a2e9b4fe1873e832df334dcf2a5f82d25782bb81ed227a77668890314b42be03e82280698e0f4437980eead8c6ca541e9cdb91363f65d6e
7
+ data.tar.gz: 74b96b0048897103e69a4750e8a34a1e0db7643d3d215b1e3881aa938e287e41f6ea8d4e12705d5cc54ff492070c54aa4ee982dd338b03335989d1d8a79989c4
data/.gitignore ADDED
@@ -0,0 +1,24 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ .ruby-gemset
24
+ .ruby-version
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in wargaming_api_ruby.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Dmitry Drobotov
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # WargamingApiRuby
2
+
3
+ Wargaming API gem
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'wargaming_api_ruby'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install wargaming_api_ruby
18
+
19
+ ## Usage
20
+
21
+ $ info = WargamingApi::Wot::Account::Info.fetch(account_id: 123)
22
+ $ info.first.nickname # => "bla-bla-bla"
23
+
24
+ ## Contributing
25
+
26
+ 1. Fork it ( https://github.com/DmitryDrobotov/wargaming_api_ruby/fork )
27
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
28
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
29
+ 4. Push to the branch (`git push origin my-new-feature`)
30
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,15 @@
1
+ module WargamingApi
2
+ end
3
+
4
+ require 'active_support/all'
5
+ require 'uri'
6
+ require 'net/http'
7
+
8
+ require 'wargaming_api/concern'
9
+ require 'wargaming_api/config'
10
+ require 'wargaming_api/error'
11
+ require 'wargaming_api/util'
12
+ require 'wargaming_api/node'
13
+
14
+ require 'wargaming_api/base'
15
+ require 'wargaming_api/wot'
@@ -0,0 +1,21 @@
1
+ class WargamingApi::Base < WargamingApi::Node
2
+ include WargamingApi::Util::Uri
3
+ include WargamingApi::Util::Params
4
+ include WargamingApi::Util::Http
5
+
6
+ attr_reader :params
7
+ attr_reader :uri
8
+ attr_reader :json
9
+
10
+ def initialize(params = {})
11
+ @params = prepare_params(params)
12
+ @uri = api_uri(@params)
13
+ @json = fetch_data(@uri).with_indifferent_access
14
+ super(@json[:data])
15
+ end
16
+
17
+ def self.fetch(params = {})
18
+ self.new(params)
19
+ end
20
+
21
+ end
@@ -0,0 +1,4 @@
1
+ module WargamingApi::Concern
2
+ end
3
+
4
+ require 'wargaming_api/concern/attributable'
@@ -0,0 +1,23 @@
1
+ module WargamingApi::Concern::Attributable
2
+ def self.included(base)
3
+ base.extend ClassMethods
4
+ base.class_eval do
5
+ cattr_accessor :_attributes
6
+ self._attributes = {}
7
+ end
8
+ end
9
+
10
+ module ClassMethods
11
+ def attribute(name, type)
12
+ _attributes[name] = type
13
+ end
14
+ end
15
+
16
+ def apply_type(name, value)
17
+ case self._attributes[name.to_sym]
18
+ when :datetime then Time.at(value)
19
+ else
20
+ value
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Config
2
+ APPLICATION_ID = '171745d21f7f98fd8878771da1000a31'
3
+ LANGUAGE = 'ru'
4
+ end
@@ -0,0 +1,4 @@
1
+ module WargamingApi::Error
2
+ end
3
+
4
+ require 'wargaming_api/error/response_error'
@@ -0,0 +1,8 @@
1
+ class WargamingApi::Error::ResponseError < StandardError
2
+ attr_reader :response
3
+
4
+ def initialize(response)
5
+ @response = response
6
+ super(response['error']['message'])
7
+ end
8
+ end
@@ -0,0 +1,69 @@
1
+ class WargamingApi::Node
2
+ include WargamingApi::Concern::Attributable
3
+
4
+ # Shared
5
+ attribute :created_at, :datetime
6
+ attribute :updated_at, :datetime
7
+
8
+ # Accounts
9
+ attribute :last_battle_time, :datetime
10
+ attribute :logout_at, :datetime
11
+
12
+ # Clans
13
+ attribute :time, :datetime
14
+ attribute :prime_time, :datetime
15
+ attribute :since, :datetime
16
+
17
+ # Global War
18
+ attribute :start_time, :datetime
19
+ attribute :finish_time, :datetime
20
+ attribute :start_at, :datetime
21
+
22
+ attr_reader :node
23
+
24
+ def initialize(node)
25
+ case node
26
+ when Array then initialize_as_array(node)
27
+ when Hash then initialize_as_hash(node)
28
+ end
29
+ end
30
+
31
+ def initialize_as_array(array)
32
+ @node = define_array(array)
33
+ self.singleton_class.include Enumerable
34
+ self.define_singleton_method(:each) do |&blk|
35
+ @node.each(&blk)
36
+ end
37
+ self.define_singleton_method(:[]) do |value|
38
+ @node[value]
39
+ end
40
+ end
41
+
42
+ def initialize_as_hash(hash)
43
+ if hash.keys.any? { |key| key =~ /[A-Z\d]+/ && hash[key].is_a?(Hash) }
44
+ initialize_as_array(hash.values)
45
+ elsif hash.keys.any? { |key| key =~ /[A-Z\d]+/ && hash[key].is_a?(Array) }
46
+ initialize_as_array(hash.values)
47
+ else
48
+ initialize_attributes(hash)
49
+ end
50
+ end
51
+
52
+ def define_array(array)
53
+ array.map { |hash| WargamingApi::Node.new(hash) }
54
+ end
55
+
56
+ def initialize_attributes(hash)
57
+ @node = hash
58
+ @node.keys.each do |attribute|
59
+ define_singleton_method(attribute) do
60
+ case @node[attribute]
61
+ when Array then WargamingApi::Node.new(@node[attribute])
62
+ when Hash then WargamingApi::Node.new(@node[attribute])
63
+ else apply_type(attribute, @node[attribute])
64
+ end
65
+ end
66
+ end
67
+ end
68
+
69
+ end
@@ -0,0 +1,6 @@
1
+ module WargamingApi::Util
2
+ end
3
+
4
+ require 'wargaming_api/util/uri'
5
+ require 'wargaming_api/util/params'
6
+ require 'wargaming_api/util/http'
@@ -0,0 +1,11 @@
1
+ module WargamingApi::Util::Http
2
+ def fetch_data(uri)
3
+ request = Net::HTTP::Get.new(uri)
4
+ response = Net::HTTP.start(uri.host, uri.port) { |http| http.request(request) }
5
+
6
+ data = ActiveSupport::JSON.decode(response.body)
7
+ raise WargamingApi::Error::ResponseError.new(data) if !'ok'.eql?(data['status'])
8
+
9
+ data
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ module WargamingApi::Util::Params
2
+ def prepare_params(params = {})
3
+ {
4
+ application_id: WargamingApi::Config::APPLICATION_ID,
5
+ language: WargamingApi::Config::LANGUAGE
6
+ }.merge(params)
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module WargamingApi::Util::Uri
2
+ def api_uri(params)
3
+ host = 'http://api.worldoftanks.ru/'
4
+ path = self.class.to_s.underscore.gsub('wargaming_api/', '').gsub('_', '')
5
+
6
+ URI([host, path, '/?', params.to_param].join)
7
+ end
8
+ end
@@ -0,0 +1,3 @@
1
+ module WargamingApi
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,10 @@
1
+ module WargamingApi::Wot
2
+ end
3
+
4
+ require 'wargaming_api/wot/account'
5
+ require 'wargaming_api/wot/clan'
6
+ require 'wargaming_api/wot/global_war'
7
+ require 'wargaming_api/wot/encyclopedia'
8
+ require 'wargaming_api/wot/ratings'
9
+ require 'wargaming_api/wot/clan_ratings'
10
+ require 'wargaming_api/wot/tanks'
@@ -0,0 +1,7 @@
1
+ class WargamingApi::Wot::Account
2
+ end
3
+
4
+ require 'wargaming_api/wot/account/achievements'
5
+ require 'wargaming_api/wot/account/info'
6
+ require 'wargaming_api/wot/account/list'
7
+ require 'wargaming_api/wot/account/tanks'
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Account
2
+ class Achievements < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Account
2
+ class Info < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Account
2
+ class List < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Account
2
+ class Tanks < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,11 @@
1
+ class WargamingApi::Wot::Clan
2
+ end
3
+
4
+ require 'wargaming_api/wot/clan/list'
5
+ require 'wargaming_api/wot/clan/info'
6
+ require 'wargaming_api/wot/clan/battles'
7
+ require 'wargaming_api/wot/clan/top'
8
+ require 'wargaming_api/wot/clan/provinces'
9
+ require 'wargaming_api/wot/clan/victory_points'
10
+ require 'wargaming_api/wot/clan/victory_points_history'
11
+ require 'wargaming_api/wot/clan/members_info'
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Clan
2
+ class Battles < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Clan
2
+ class Info < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Clan
2
+ class List < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Clan
2
+ class MembersInfo < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Clan
2
+ class Provinces < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Clan
2
+ class Top < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Clan
2
+ class VictoryPoints < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Clan
2
+ class VictoryPointsHistory < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,8 @@
1
+ class WargamingApi::Wot::ClanRatings
2
+ end
3
+
4
+ require 'wargaming_api/wot/clan_ratings/types'
5
+ require 'wargaming_api/wot/clan_ratings/clans'
6
+ require 'wargaming_api/wot/clan_ratings/neighbors'
7
+ require 'wargaming_api/wot/clan_ratings/top'
8
+ require 'wargaming_api/wot/clan_ratings/dates'
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::ClanRatings
2
+ class Clans < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::ClanRatings
2
+ class Dates < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::ClanRatings
2
+ class Neighbors < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::ClanRatings
2
+ class Top < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::ClanRatings
2
+ class Types < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,13 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ end
3
+
4
+ require 'wargaming_api/wot/encyclopedia/tanks'
5
+ require 'wargaming_api/wot/encyclopedia/tank_info'
6
+ require 'wargaming_api/wot/encyclopedia/tank_engines'
7
+ require 'wargaming_api/wot/encyclopedia/tank_turrets'
8
+ require 'wargaming_api/wot/encyclopedia/tank_radios'
9
+ require 'wargaming_api/wot/encyclopedia/tank_chassis'
10
+ require 'wargaming_api/wot/encyclopedia/tank_guns'
11
+ require 'wargaming_api/wot/encyclopedia/achievements'
12
+ require 'wargaming_api/wot/encyclopedia/info'
13
+ require 'wargaming_api/wot/encyclopedia/arenas'
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class Achievements < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class Arenas < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class Info < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class TankChassis < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class TankEngines < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class TankGuns < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class TankInfo < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class TankRadios < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class TankTurrets < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Encyclopedia
2
+ class Tanks < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,13 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ end
3
+
4
+ require 'wargaming_api/wot/global_war/clans'
5
+ require 'wargaming_api/wot/global_war/fame_points'
6
+ require 'wargaming_api/wot/global_war/maps'
7
+ require 'wargaming_api/wot/global_war/provinces'
8
+ require 'wargaming_api/wot/global_war/top'
9
+ require 'wargaming_api/wot/global_war/tournaments'
10
+ require 'wargaming_api/wot/global_war/fame_points_history'
11
+ require 'wargaming_api/wot/global_war/alley_of_fame'
12
+ require 'wargaming_api/wot/global_war/battles'
13
+ require 'wargaming_api/wot/global_war/victory_points_history'
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class AlleyOfFame < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class Battles < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class Clans < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class FamePoints < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class FamePointsHistory < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class Maps < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class Provinces < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class Top < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class Tournaments < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::GlobalWar
2
+ class VictoryPointsHistory < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,8 @@
1
+ class WargamingApi::Wot::Ratings
2
+ end
3
+
4
+ require 'wargaming_api/wot/ratings/types'
5
+ require 'wargaming_api/wot/ratings/accounts'
6
+ require 'wargaming_api/wot/ratings/neighbors'
7
+ require 'wargaming_api/wot/ratings/top'
8
+ require 'wargaming_api/wot/ratings/dates'
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Ratings
2
+ class Accounts < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Ratings
2
+ class Dates < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Ratings
2
+ class Neighbors < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Ratings
2
+ class Top < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Ratings
2
+ class Types < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ class WargamingApi::Wot::Tanks
2
+ end
3
+
4
+ require 'wargaming_api/wot/tanks/stats'
5
+ require 'wargaming_api/wot/tanks/achievements'
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Tanks
2
+ class Achievements < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ class WargamingApi::Wot::Tanks
2
+ class Stats < WargamingApi::Base
3
+ end
4
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'wargaming_api/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "wargaming_api_ruby"
8
+ spec.version = WargamingApi::VERSION
9
+ spec.authors = ["Dmitry Drobotov"]
10
+ spec.email = ["dm.drobotov@gmail.com"]
11
+ spec.summary = %q{Ruby interface for Wargaming API}
12
+ spec.description = %q{Provides classes to access to all Wargaming Games API}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'activesupport'
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.6"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "pry"
26
+ end
metadata ADDED
@@ -0,0 +1,171 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wargaming_api_ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dmitry Drobotov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Provides classes to access to all Wargaming Games API
70
+ email:
71
+ - dm.drobotov@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE.txt
79
+ - README.md
80
+ - Rakefile
81
+ - lib/wargaming_api.rb
82
+ - lib/wargaming_api/base.rb
83
+ - lib/wargaming_api/concern.rb
84
+ - lib/wargaming_api/concern/attributable.rb
85
+ - lib/wargaming_api/config.rb
86
+ - lib/wargaming_api/error.rb
87
+ - lib/wargaming_api/error/response_error.rb
88
+ - lib/wargaming_api/node.rb
89
+ - lib/wargaming_api/util.rb
90
+ - lib/wargaming_api/util/http.rb
91
+ - lib/wargaming_api/util/params.rb
92
+ - lib/wargaming_api/util/uri.rb
93
+ - lib/wargaming_api/version.rb
94
+ - lib/wargaming_api/wot.rb
95
+ - lib/wargaming_api/wot/account.rb
96
+ - lib/wargaming_api/wot/account/achievements.rb
97
+ - lib/wargaming_api/wot/account/info.rb
98
+ - lib/wargaming_api/wot/account/list.rb
99
+ - lib/wargaming_api/wot/account/tanks.rb
100
+ - lib/wargaming_api/wot/clan.rb
101
+ - lib/wargaming_api/wot/clan/battles.rb
102
+ - lib/wargaming_api/wot/clan/info.rb
103
+ - lib/wargaming_api/wot/clan/list.rb
104
+ - lib/wargaming_api/wot/clan/members_info.rb
105
+ - lib/wargaming_api/wot/clan/provinces.rb
106
+ - lib/wargaming_api/wot/clan/top.rb
107
+ - lib/wargaming_api/wot/clan/victory_points.rb
108
+ - lib/wargaming_api/wot/clan/victory_points_history.rb
109
+ - lib/wargaming_api/wot/clan_ratings.rb
110
+ - lib/wargaming_api/wot/clan_ratings/clans.rb
111
+ - lib/wargaming_api/wot/clan_ratings/dates.rb
112
+ - lib/wargaming_api/wot/clan_ratings/neighbors.rb
113
+ - lib/wargaming_api/wot/clan_ratings/top.rb
114
+ - lib/wargaming_api/wot/clan_ratings/types.rb
115
+ - lib/wargaming_api/wot/encyclopedia.rb
116
+ - lib/wargaming_api/wot/encyclopedia/achievements.rb
117
+ - lib/wargaming_api/wot/encyclopedia/arenas.rb
118
+ - lib/wargaming_api/wot/encyclopedia/info.rb
119
+ - lib/wargaming_api/wot/encyclopedia/tank_chassis.rb
120
+ - lib/wargaming_api/wot/encyclopedia/tank_engines.rb
121
+ - lib/wargaming_api/wot/encyclopedia/tank_guns.rb
122
+ - lib/wargaming_api/wot/encyclopedia/tank_info.rb
123
+ - lib/wargaming_api/wot/encyclopedia/tank_radios.rb
124
+ - lib/wargaming_api/wot/encyclopedia/tank_turrets.rb
125
+ - lib/wargaming_api/wot/encyclopedia/tanks.rb
126
+ - lib/wargaming_api/wot/global_war.rb
127
+ - lib/wargaming_api/wot/global_war/alley_of_fame.rb
128
+ - lib/wargaming_api/wot/global_war/battles.rb
129
+ - lib/wargaming_api/wot/global_war/clans.rb
130
+ - lib/wargaming_api/wot/global_war/fame_points.rb
131
+ - lib/wargaming_api/wot/global_war/fame_points_history.rb
132
+ - lib/wargaming_api/wot/global_war/maps.rb
133
+ - lib/wargaming_api/wot/global_war/provinces.rb
134
+ - lib/wargaming_api/wot/global_war/top.rb
135
+ - lib/wargaming_api/wot/global_war/tournaments.rb
136
+ - lib/wargaming_api/wot/global_war/victory_points_history.rb
137
+ - lib/wargaming_api/wot/ratings.rb
138
+ - lib/wargaming_api/wot/ratings/accounts.rb
139
+ - lib/wargaming_api/wot/ratings/dates.rb
140
+ - lib/wargaming_api/wot/ratings/neighbors.rb
141
+ - lib/wargaming_api/wot/ratings/top.rb
142
+ - lib/wargaming_api/wot/ratings/types.rb
143
+ - lib/wargaming_api/wot/tanks.rb
144
+ - lib/wargaming_api/wot/tanks/achievements.rb
145
+ - lib/wargaming_api/wot/tanks/stats.rb
146
+ - wargaming_api_ruby.gemspec
147
+ homepage: ''
148
+ licenses:
149
+ - MIT
150
+ metadata: {}
151
+ post_install_message:
152
+ rdoc_options: []
153
+ require_paths:
154
+ - lib
155
+ required_ruby_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ requirements: []
166
+ rubyforge_project:
167
+ rubygems_version: 2.2.2
168
+ signing_key:
169
+ specification_version: 4
170
+ summary: Ruby interface for Wargaming API
171
+ test_files: []