wot_api_ru 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.gitignore +10 -0
- data/.rspec +3 -0
- data/.travis.yml +11 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +133 -0
- data/LICENSE +21 -0
- data/README.md +17 -10
- data/README.rdoc +3 -0
- data/Rakefile +1 -1
- data/lib/generators/{wot_api → wot_api_ru}/install_generator.rb +3 -3
- data/lib/generators/wot_api_ru/templates/wot_api_ru.rb +2 -0
- data/lib/tasks/{wot_api_tasks.rake → wot_api_ru_tasks.rake} +1 -1
- data/lib/wot_api_ru.rb +5 -0
- data/lib/{wot_api → wot_api_ru}/client.rb +6 -6
- data/lib/{wot_api → wot_api_ru}/constants.rb +1 -1
- data/lib/{wot_api → wot_api_ru}/settings.rb +1 -1
- data/lib/wot_api_ru/version.rb +3 -0
- data/spec/dummy/.rspec +3 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +29 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wot_api_ru.rb +2 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +56 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/rails_helper.rb +43 -0
- data/spec/spec_helper.rb +80 -0
- data/spec/wot_api_ru/constants_spec.rb +49 -0
- data/spec/wot_api_ru/settings_spec.rb +14 -0
- data/spec/wot_api_ru/version_spec.rb +6 -0
- data/wot_api_ru.gemspec +27 -0
- metadata +94 -12
- data/lib/generators/wot_api/templates/wot_api.rb +0 -2
- data/lib/wot_api.rb +0 -5
- data/lib/wot_api/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53225c2c1ce2762a15029a41e014dc9173492146
|
4
|
+
data.tar.gz: f54829d42104889bfa5b31c9e153b676a484212a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a94f6a6504287f9dc9b7ba82c0588196b7175dd5dd17bfeaf572ca0aedc5ac9bb7590419d830d9f61b646c99904f1e76c20032f902a1cde7f09a58b0783fc8d9
|
7
|
+
data.tar.gz: 8bd540fdd8b4f9ca5f45d03487857211deb6dd5107456c387aaf59ba3d5ee8c2f3d75b894c09c05df46cb514bf23c33acafef10f9e9fc735928035622490cd29
|
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
# Declare your gem's dependencies in wot_api_ru.gemspec.
|
4
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
5
|
+
# development dependencies will be added by default to the :development group.
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
# Declare any dependencies that are still in development here instead of in
|
9
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
10
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
11
|
+
# your gem to rubygems.org.
|
12
|
+
|
13
|
+
# To use debugger
|
14
|
+
# gem 'debugger'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
wot_api_ru (0.1.0)
|
5
|
+
rails (~> 4.1, >= 4.1.4)
|
6
|
+
rest_client (~> 1.7, >= 1.7.3)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionmailer (4.1.4)
|
12
|
+
actionpack (= 4.1.4)
|
13
|
+
actionview (= 4.1.4)
|
14
|
+
mail (~> 2.5.4)
|
15
|
+
actionpack (4.1.4)
|
16
|
+
actionview (= 4.1.4)
|
17
|
+
activesupport (= 4.1.4)
|
18
|
+
rack (~> 1.5.2)
|
19
|
+
rack-test (~> 0.6.2)
|
20
|
+
actionview (4.1.4)
|
21
|
+
activesupport (= 4.1.4)
|
22
|
+
builder (~> 3.1)
|
23
|
+
erubis (~> 2.7.0)
|
24
|
+
activemodel (4.1.4)
|
25
|
+
activesupport (= 4.1.4)
|
26
|
+
builder (~> 3.1)
|
27
|
+
activerecord (4.1.4)
|
28
|
+
activemodel (= 4.1.4)
|
29
|
+
activesupport (= 4.1.4)
|
30
|
+
arel (~> 5.0.0)
|
31
|
+
activesupport (4.1.4)
|
32
|
+
i18n (~> 0.6, >= 0.6.9)
|
33
|
+
json (~> 1.7, >= 1.7.7)
|
34
|
+
minitest (~> 5.1)
|
35
|
+
thread_safe (~> 0.1)
|
36
|
+
tzinfo (~> 1.1)
|
37
|
+
arel (5.0.1.20140414130214)
|
38
|
+
builder (3.2.2)
|
39
|
+
coveralls (0.7.0)
|
40
|
+
multi_json (~> 1.3)
|
41
|
+
rest-client
|
42
|
+
simplecov (>= 0.7)
|
43
|
+
term-ansicolor
|
44
|
+
thor
|
45
|
+
diff-lcs (1.2.5)
|
46
|
+
docile (1.1.5)
|
47
|
+
erubis (2.7.0)
|
48
|
+
hike (1.2.3)
|
49
|
+
i18n (0.6.11)
|
50
|
+
json (1.8.1)
|
51
|
+
mail (2.5.4)
|
52
|
+
mime-types (~> 1.16)
|
53
|
+
treetop (~> 1.4.8)
|
54
|
+
mime-types (1.25.1)
|
55
|
+
minitest (5.4.0)
|
56
|
+
multi_json (1.10.1)
|
57
|
+
netrc (0.7.7)
|
58
|
+
polyglot (0.3.5)
|
59
|
+
rack (1.5.2)
|
60
|
+
rack-test (0.6.2)
|
61
|
+
rack (>= 1.0)
|
62
|
+
rails (4.1.4)
|
63
|
+
actionmailer (= 4.1.4)
|
64
|
+
actionpack (= 4.1.4)
|
65
|
+
actionview (= 4.1.4)
|
66
|
+
activemodel (= 4.1.4)
|
67
|
+
activerecord (= 4.1.4)
|
68
|
+
activesupport (= 4.1.4)
|
69
|
+
bundler (>= 1.3.0, < 2.0)
|
70
|
+
railties (= 4.1.4)
|
71
|
+
sprockets-rails (~> 2.0)
|
72
|
+
railties (4.1.4)
|
73
|
+
actionpack (= 4.1.4)
|
74
|
+
activesupport (= 4.1.4)
|
75
|
+
rake (>= 0.8.7)
|
76
|
+
thor (>= 0.18.1, < 2.0)
|
77
|
+
rake (10.3.2)
|
78
|
+
rest-client (1.7.2)
|
79
|
+
mime-types (>= 1.16, < 3.0)
|
80
|
+
netrc (~> 0.7)
|
81
|
+
rest_client (1.7.3)
|
82
|
+
netrc (~> 0.7.7)
|
83
|
+
rspec-core (3.0.2)
|
84
|
+
rspec-support (~> 3.0.0)
|
85
|
+
rspec-expectations (3.0.2)
|
86
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
87
|
+
rspec-support (~> 3.0.0)
|
88
|
+
rspec-mocks (3.0.2)
|
89
|
+
rspec-support (~> 3.0.0)
|
90
|
+
rspec-rails (3.0.1)
|
91
|
+
actionpack (>= 3.0)
|
92
|
+
activesupport (>= 3.0)
|
93
|
+
railties (>= 3.0)
|
94
|
+
rspec-core (~> 3.0.0)
|
95
|
+
rspec-expectations (~> 3.0.0)
|
96
|
+
rspec-mocks (~> 3.0.0)
|
97
|
+
rspec-support (~> 3.0.0)
|
98
|
+
rspec-support (3.0.2)
|
99
|
+
simplecov (0.8.2)
|
100
|
+
docile (~> 1.1.0)
|
101
|
+
multi_json
|
102
|
+
simplecov-html (~> 0.8.0)
|
103
|
+
simplecov-html (0.8.0)
|
104
|
+
sprockets (2.12.1)
|
105
|
+
hike (~> 1.2)
|
106
|
+
multi_json (~> 1.0)
|
107
|
+
rack (~> 1.0)
|
108
|
+
tilt (~> 1.1, != 1.3.0)
|
109
|
+
sprockets-rails (2.1.3)
|
110
|
+
actionpack (>= 3.0)
|
111
|
+
activesupport (>= 3.0)
|
112
|
+
sprockets (~> 2.8)
|
113
|
+
sqlite3 (1.3.9)
|
114
|
+
term-ansicolor (1.3.0)
|
115
|
+
tins (~> 1.0)
|
116
|
+
thor (0.19.1)
|
117
|
+
thread_safe (0.3.4)
|
118
|
+
tilt (1.4.1)
|
119
|
+
tins (1.3.0)
|
120
|
+
treetop (1.4.15)
|
121
|
+
polyglot
|
122
|
+
polyglot (>= 0.3.1)
|
123
|
+
tzinfo (1.2.1)
|
124
|
+
thread_safe (~> 0.1)
|
125
|
+
|
126
|
+
PLATFORMS
|
127
|
+
ruby
|
128
|
+
|
129
|
+
DEPENDENCIES
|
130
|
+
coveralls (~> 0.7, >= 0.7.0)
|
131
|
+
rspec-rails (~> 3.0, >= 3.0.1)
|
132
|
+
sqlite3 (~> 1.3, >= 1.3.9)
|
133
|
+
wot_api_ru!
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Ivan Bondarenko
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,39 +1,46 @@
|
|
1
|
-
|
1
|
+
WotApiRu
|
2
2
|
=======
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/wot_api_ru.png)](http://badge.fury.io/rb/wot_api_ru)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/shved270189/wot_api_ru.png)](https://codeclimate.com/github/shved270189/wot_api_ru)
|
5
|
+
[![Dependency Status](https://gemnasium.com/shved270189/wot_api_ru.svg)](https://gemnasium.com/shved270189/wot_api_ru)
|
6
|
+
[![Build Status](https://travis-ci.org/shved270189/wot_api_ru.svg?branch=master)](https://travis-ci.org/shved270189/wot_api_ru)
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/shved270189/wot_api_ru/badge.png?branch=master)](https://coveralls.io/r/shved270189/wot_api_ru?branch=master)
|
8
|
+
[![PullReview stats](https://www.pullreview.com/github/shved270189/wot_api_ru/badges/master.svg?)](https://www.pullreview.com/github/shved270189/wot_api_ru/reviews/master)
|
3
9
|
|
4
10
|
Ruby gem for [Wargaming.net Public API](http://ru.wargaming.net/developers/documentation/guide/getting-started/)
|
5
11
|
|
6
12
|
## Getting started
|
7
13
|
|
8
|
-
|
14
|
+
WotApiRu works with Rails 4.1 onwards. You can add it to your Gemfile with:
|
9
15
|
|
10
16
|
```ruby
|
11
|
-
gem 'wot_api_ru', github: 'shved270189/
|
17
|
+
gem 'wot_api_ru', github: 'shved270189/wot_api_ru' # from GitHub
|
18
|
+
gem 'wot_api_ru' # from rubygems
|
12
19
|
```
|
13
20
|
|
14
21
|
Run the bundle command to install it.
|
15
22
|
|
16
|
-
After you install
|
23
|
+
After you install WotApiRu and add it to your Gemfile, you need to run the generator:
|
17
24
|
|
18
25
|
```console
|
19
|
-
rails generate
|
26
|
+
rails generate wot_api_ru:install
|
20
27
|
```
|
21
28
|
|
22
|
-
The generator will install an initializer. Set your [application id](https://ru.wargaming.net/developers/applications/) in config/initializers/
|
29
|
+
The generator will install an initializer. Set your [application id](https://ru.wargaming.net/developers/applications/) in config/initializers/wot_api_ru.rb :
|
23
30
|
|
24
31
|
```ruby
|
25
32
|
# Set your application Wargaming key here!
|
26
|
-
|
33
|
+
WotApiRu::Settings[:application_id] = ENV['WOT_API_RU_APP_ID']
|
27
34
|
```
|
28
35
|
|
29
|
-
After this steps you can create
|
36
|
+
After this steps you can create WotApiRu client and call to Wargaming.net Public API:
|
30
37
|
|
31
38
|
```ruby
|
32
|
-
client =
|
39
|
+
client = WotApiRu::Client.new
|
33
40
|
client.account_list(search: 'saltovka')
|
34
41
|
```
|
35
42
|
All API's method you can see on [API dicumentation](http://ru.wargaming.net/developers/api_reference).
|
36
|
-
If you want call [api.worldoftanks.ru/wot/account/list](http://ru.wargaming.net/developers/api_reference/wot/account/list/) then you can use
|
43
|
+
If you want call [api.worldoftanks.ru/wot/account/list](http://ru.wargaming.net/developers/api_reference/wot/account/list/) then you can use WotApiRu::Client#account_list with parameters of API etc.
|
37
44
|
|
38
45
|
## License
|
39
46
|
|
data/README.rdoc
ADDED
data/Rakefile
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
require 'rails/generators'
|
2
2
|
|
3
|
-
module
|
3
|
+
module WotApiRu
|
4
4
|
class InstallGenerator < Rails::Generators::Base
|
5
5
|
include Rails::Generators::ResourceHelpers
|
6
6
|
desc "Some description of my generator here"
|
7
7
|
|
8
8
|
def name
|
9
|
-
"
|
9
|
+
"wot_api_ru"
|
10
10
|
end
|
11
11
|
|
12
12
|
source_root File.expand_path("../templates", __FILE__)
|
13
13
|
|
14
14
|
def copy_initializer_file
|
15
|
-
copy_file "
|
15
|
+
copy_file "wot_api_ru.rb", "config/initializers/wot_api_ru.rb"
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
data/lib/wot_api_ru.rb
ADDED
@@ -1,15 +1,15 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
1
|
+
require 'wot_api_ru/constants'
|
2
|
+
require 'wot_api_ru/settings'
|
3
3
|
require 'rest_client'
|
4
4
|
|
5
|
-
module
|
5
|
+
module WotApiRu
|
6
6
|
class Client
|
7
7
|
|
8
8
|
def method_missing(meth, *args, &block)
|
9
|
-
raise NoMethodError, "undefined method #{meth} for #{self.class.to_s}" if
|
9
|
+
raise NoMethodError, "undefined method #{meth} for #{self.class.to_s}" if WotApiRu::Constants::PATH[meth.to_sym].nil?
|
10
10
|
options = args[0]
|
11
|
-
options[:application_id] ||=
|
12
|
-
path =
|
11
|
+
options[:application_id] ||= WotApiRu::Settings[:application_id]
|
12
|
+
path = WotApiRu::Constants::HOST + WotApiRu::Constants::PATH[meth.to_sym]
|
13
13
|
invoke(path, options)
|
14
14
|
end
|
15
15
|
|
data/spec/dummy/.rspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/spec/dummy/Rakefile
ADDED
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|