wot_api_ru 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 +2 -0
- data/Gemfile.lock +37 -1
- data/Guardfile +23 -0
- data/README.md +2 -1
- data/Rakefile +0 -14
- data/lib/generators/wot_api_ru/install_generator.rb +6 -0
- data/lib/wot_api_ru.rb +1 -0
- data/lib/wot_api_ru/client.rb +4 -0
- data/lib/wot_api_ru/constants.rb +4 -0
- data/lib/wot_api_ru/settings.rb +11 -0
- data/lib/wot_api_ru/version.rb +2 -1
- data/spec/lib/wot_api_ru/version_spec.rb +1 -1
- data/wot_api_ru.gemspec +2 -0
- metadata +43 -2
- data/README.rdoc +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 952a84805fac7710edd19fb79e18d2285c0fd6a1
|
|
4
|
+
data.tar.gz: ebaa8b54aa08c27d3e84d780e4ffba140efbd932
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5cbc9730e656a3fc94b42350af158d0482d61755ee0088ec85445d8288468d7e7e4b1699e3077d83b4dfb9354b68399c8586072a0f78f76a6c5f465eb38b9870
|
|
7
|
+
data.tar.gz: d46d685972e6ac22ef3c67f90997fec6bbcec22a165c69052d349cc8bc4ef08b01735af88003efd95e1d90cefbec2182bd49bf0c32c593a16c471aea37ea0165
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
wot_api_ru (0.1.
|
|
4
|
+
wot_api_ru (0.1.2)
|
|
5
5
|
rails (~> 4.1, >= 4.1.4)
|
|
6
6
|
rest_client (~> 1.7, >= 1.7.3)
|
|
7
7
|
|
|
@@ -36,6 +36,9 @@ GEM
|
|
|
36
36
|
tzinfo (~> 1.1)
|
|
37
37
|
arel (5.0.1.20140414130214)
|
|
38
38
|
builder (3.2.2)
|
|
39
|
+
celluloid (0.15.2)
|
|
40
|
+
timers (~> 1.1.0)
|
|
41
|
+
coderay (1.1.0)
|
|
39
42
|
coveralls (0.7.0)
|
|
40
43
|
multi_json (~> 1.3)
|
|
41
44
|
rest-client
|
|
@@ -45,20 +48,41 @@ GEM
|
|
|
45
48
|
diff-lcs (1.2.5)
|
|
46
49
|
docile (1.1.5)
|
|
47
50
|
erubis (2.7.0)
|
|
51
|
+
ffi (1.9.3)
|
|
52
|
+
formatador (0.2.5)
|
|
48
53
|
generator_spec (0.9.2)
|
|
49
54
|
activesupport (>= 3.0.0)
|
|
50
55
|
railties (>= 3.0.0)
|
|
56
|
+
guard (2.6.1)
|
|
57
|
+
formatador (>= 0.2.4)
|
|
58
|
+
listen (~> 2.7)
|
|
59
|
+
lumberjack (~> 1.0)
|
|
60
|
+
pry (>= 0.9.12)
|
|
61
|
+
thor (>= 0.18.1)
|
|
62
|
+
guard-rspec (4.2.10)
|
|
63
|
+
guard (~> 2.1)
|
|
64
|
+
rspec (>= 2.14, < 4.0)
|
|
51
65
|
hike (1.2.3)
|
|
52
66
|
i18n (0.6.11)
|
|
53
67
|
json (1.8.1)
|
|
68
|
+
listen (2.7.9)
|
|
69
|
+
celluloid (>= 0.15.2)
|
|
70
|
+
rb-fsevent (>= 0.9.3)
|
|
71
|
+
rb-inotify (>= 0.9)
|
|
72
|
+
lumberjack (1.0.9)
|
|
54
73
|
mail (2.5.4)
|
|
55
74
|
mime-types (~> 1.16)
|
|
56
75
|
treetop (~> 1.4.8)
|
|
76
|
+
method_source (0.8.2)
|
|
57
77
|
mime-types (1.25.1)
|
|
58
78
|
minitest (5.4.0)
|
|
59
79
|
multi_json (1.10.1)
|
|
60
80
|
netrc (0.7.7)
|
|
61
81
|
polyglot (0.3.5)
|
|
82
|
+
pry (0.10.0)
|
|
83
|
+
coderay (~> 1.1.0)
|
|
84
|
+
method_source (~> 0.8.1)
|
|
85
|
+
slop (~> 3.4)
|
|
62
86
|
rack (1.5.2)
|
|
63
87
|
rack-test (0.6.2)
|
|
64
88
|
rack (>= 1.0)
|
|
@@ -78,11 +102,18 @@ GEM
|
|
|
78
102
|
rake (>= 0.8.7)
|
|
79
103
|
thor (>= 0.18.1, < 2.0)
|
|
80
104
|
rake (10.3.2)
|
|
105
|
+
rb-fsevent (0.9.4)
|
|
106
|
+
rb-inotify (0.9.5)
|
|
107
|
+
ffi (>= 0.5.0)
|
|
81
108
|
rest-client (1.7.2)
|
|
82
109
|
mime-types (>= 1.16, < 3.0)
|
|
83
110
|
netrc (~> 0.7)
|
|
84
111
|
rest_client (1.7.3)
|
|
85
112
|
netrc (~> 0.7.7)
|
|
113
|
+
rspec (3.0.0)
|
|
114
|
+
rspec-core (~> 3.0.0)
|
|
115
|
+
rspec-expectations (~> 3.0.0)
|
|
116
|
+
rspec-mocks (~> 3.0.0)
|
|
86
117
|
rspec-core (3.0.2)
|
|
87
118
|
rspec-support (~> 3.0.0)
|
|
88
119
|
rspec-expectations (3.0.2)
|
|
@@ -104,6 +135,7 @@ GEM
|
|
|
104
135
|
multi_json
|
|
105
136
|
simplecov-html (~> 0.8.0)
|
|
106
137
|
simplecov-html (0.8.0)
|
|
138
|
+
slop (3.5.0)
|
|
107
139
|
sprockets (2.12.1)
|
|
108
140
|
hike (~> 1.2)
|
|
109
141
|
multi_json (~> 1.0)
|
|
@@ -119,12 +151,14 @@ GEM
|
|
|
119
151
|
thor (0.19.1)
|
|
120
152
|
thread_safe (0.3.4)
|
|
121
153
|
tilt (1.4.1)
|
|
154
|
+
timers (1.1.0)
|
|
122
155
|
tins (1.3.0)
|
|
123
156
|
treetop (1.4.15)
|
|
124
157
|
polyglot
|
|
125
158
|
polyglot (>= 0.3.1)
|
|
126
159
|
tzinfo (1.2.1)
|
|
127
160
|
thread_safe (~> 0.1)
|
|
161
|
+
yard (0.8.7.4)
|
|
128
162
|
|
|
129
163
|
PLATFORMS
|
|
130
164
|
ruby
|
|
@@ -132,6 +166,8 @@ PLATFORMS
|
|
|
132
166
|
DEPENDENCIES
|
|
133
167
|
coveralls (~> 0.7, >= 0.7.0)
|
|
134
168
|
generator_spec (~> 0.9, >= 0.9.2)
|
|
169
|
+
guard-rspec (~> 4.2, >= 4.2.10)
|
|
135
170
|
rspec-rails (~> 3.0, >= 3.0.1)
|
|
136
171
|
sqlite3 (~> 1.3, >= 1.3.9)
|
|
137
172
|
wot_api_ru!
|
|
173
|
+
yard (~> 0.8, >= 0.8.7.4)
|
data/Guardfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# A sample Guardfile
|
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
|
3
|
+
|
|
4
|
+
guard :rspec do
|
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
|
8
|
+
|
|
9
|
+
# Rails example
|
|
10
|
+
watch(%r{^spec/dummy/app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
|
11
|
+
watch(%r{^spec/dummy/app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
|
12
|
+
watch(%r{^spec/dummy/app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
|
13
|
+
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
|
14
|
+
watch('config/routes.rb') { "spec/routing" }
|
|
15
|
+
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
|
16
|
+
|
|
17
|
+
# Capybara features specs
|
|
18
|
+
watch(%r{^spec/dummy/app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
|
|
19
|
+
|
|
20
|
+
# Turnip features and steps
|
|
21
|
+
watch(%r{^spec/acceptance/(.+)\.feature$})
|
|
22
|
+
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
|
23
|
+
end
|
data/README.md
CHANGED
|
@@ -2,9 +2,10 @@ WotApiRu
|
|
|
2
2
|
=======
|
|
3
3
|
[](http://badge.fury.io/rb/wot_api_ru)
|
|
4
4
|
[](https://codeclimate.com/github/shved270189/wot_api_ru)
|
|
5
|
-
[](https://gemnasium.com/shved270189/wot_api_ru)
|
|
6
5
|
[](https://travis-ci.org/shved270189/wot_api_ru)
|
|
7
6
|
[](https://coveralls.io/r/shved270189/wot_api_ru?branch=master)
|
|
7
|
+
[](http://inch-ci.org/github/shved270189/wot_api_ru)
|
|
8
|
+
[](https://gemnasium.com/shved270189/wot_api_ru)
|
|
8
9
|
[](https://www.pullreview.com/github/shved270189/wot_api_ru/reviews/master)
|
|
9
10
|
|
|
10
11
|
Ruby gem for [Wargaming.net Public API](http://ru.wargaming.net/developers/documentation/guide/getting-started/)
|
data/Rakefile
CHANGED
|
@@ -4,18 +4,4 @@ rescue LoadError
|
|
|
4
4
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
-
require 'rdoc/task'
|
|
8
|
-
|
|
9
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
|
-
rdoc.rdoc_dir = 'rdoc'
|
|
11
|
-
rdoc.title = 'WotApiRu'
|
|
12
|
-
rdoc.options << '--line-numbers'
|
|
13
|
-
rdoc.rdoc_files.include('README.rdoc')
|
|
14
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
7
|
Bundler::GemHelper.install_tasks
|
|
21
|
-
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
require 'rails/generators'
|
|
2
2
|
|
|
3
3
|
module WotApiRu
|
|
4
|
+
# @author Ivan Bondarenko
|
|
5
|
+
# Rails generator for generate initializer wot_api_ru file
|
|
4
6
|
class InstallGenerator < Rails::Generators::Base
|
|
5
7
|
include Rails::Generators::ResourceHelpers
|
|
6
8
|
desc 'Generate initialize file of wot_api_ru'
|
|
7
9
|
|
|
10
|
+
# Generator name
|
|
11
|
+
# @return [String] generator name
|
|
8
12
|
def name
|
|
9
13
|
'wot_api_ru'
|
|
10
14
|
end
|
|
11
15
|
|
|
12
16
|
source_root File.expand_path('../templates', __FILE__)
|
|
13
17
|
|
|
18
|
+
# Create initialize wot_api_ru file
|
|
19
|
+
# @note This method create config/initializers/wot_api_ru.rb in rails application
|
|
14
20
|
def copy_initializer_file
|
|
15
21
|
copy_file 'wot_api_ru.rb', 'config/initializers/wot_api_ru.rb'
|
|
16
22
|
end
|
data/lib/wot_api_ru.rb
CHANGED
data/lib/wot_api_ru/client.rb
CHANGED
|
@@ -3,7 +3,11 @@ require 'wot_api_ru/settings'
|
|
|
3
3
|
require 'rest_client'
|
|
4
4
|
|
|
5
5
|
module WotApiRu
|
|
6
|
+
# @author Ivan Bondarenko
|
|
7
|
+
# Class of client for send response to Wargaming.net Public API
|
|
6
8
|
class Client
|
|
9
|
+
# This method dynamic call Wargaming.net Public API methods from WotApiRu::PATH values
|
|
10
|
+
# @note If you call method which undefined as key in WotApiRu::PATH then method raise NoMethodError
|
|
7
11
|
def method_missing(meth, *args, &block)
|
|
8
12
|
raise NoMethodError, "undefined method #{meth} for #{self.class.to_s}" if WotApiRu::Constants::PATH[meth.to_sym].nil?
|
|
9
13
|
options = args[0] || {}
|
data/lib/wot_api_ru/constants.rb
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
module WotApiRu
|
|
2
|
+
# @author Ivan Bondarenko
|
|
3
|
+
# Class of application constants
|
|
2
4
|
module Constants
|
|
5
|
+
# Host for response to Wargaming.net Public API
|
|
3
6
|
HOST = 'https://api.worldoftanks.ru/wot/'
|
|
4
7
|
|
|
8
|
+
# Hash of pathes to Wargaming.net Public API methods
|
|
5
9
|
PATH = {
|
|
6
10
|
# All pathes require: application_id
|
|
7
11
|
|
data/lib/wot_api_ru/settings.rb
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
module WotApiRu
|
|
2
|
+
# @author Ivan Bondarenko
|
|
3
|
+
# Storage for application settings
|
|
2
4
|
class Settings
|
|
3
5
|
@options = Hash.new
|
|
4
6
|
|
|
5
7
|
class << self
|
|
8
|
+
# Get settings
|
|
9
|
+
# @note This method may get parameter which user set in initializer wot_api_ru
|
|
10
|
+
# @param ind [String, Symbol] the key of setting value
|
|
11
|
+
# @return [String] value settings
|
|
6
12
|
def [](ind)
|
|
7
13
|
@options[ind.to_sym]
|
|
8
14
|
end
|
|
9
15
|
|
|
16
|
+
# Set settings
|
|
17
|
+
# @note This method may set or modify application settings
|
|
18
|
+
# @param ind [String, Symbol] the key of setting value
|
|
19
|
+
# @param val [] the value of setting value
|
|
20
|
+
# @return [] val
|
|
10
21
|
def []=(ind, val)
|
|
11
22
|
@options[ind.to_sym] = val.to_s
|
|
12
23
|
end
|
data/lib/wot_api_ru/version.rb
CHANGED
data/wot_api_ru.gemspec
CHANGED
|
@@ -25,4 +25,6 @@ Gem::Specification.new do |s|
|
|
|
25
25
|
s.add_development_dependency "rspec-rails", '~> 3.0', '>= 3.0.1'
|
|
26
26
|
s.add_development_dependency "coveralls", '~> 0.7', '>= 0.7.0'
|
|
27
27
|
s.add_development_dependency "generator_spec", '~> 0.9', '>= 0.9.2'
|
|
28
|
+
s.add_development_dependency "guard-rspec", '~> 4.2', '>= 4.2.10'
|
|
29
|
+
s.add_development_dependency "yard", '~> 0.8', '>= 0.8.7.4'
|
|
28
30
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wot_api_ru
|
|
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
|
- Ivan Bondarenko
|
|
@@ -130,6 +130,46 @@ dependencies:
|
|
|
130
130
|
- - ">="
|
|
131
131
|
- !ruby/object:Gem::Version
|
|
132
132
|
version: 0.9.2
|
|
133
|
+
- !ruby/object:Gem::Dependency
|
|
134
|
+
name: guard-rspec
|
|
135
|
+
requirement: !ruby/object:Gem::Requirement
|
|
136
|
+
requirements:
|
|
137
|
+
- - "~>"
|
|
138
|
+
- !ruby/object:Gem::Version
|
|
139
|
+
version: '4.2'
|
|
140
|
+
- - ">="
|
|
141
|
+
- !ruby/object:Gem::Version
|
|
142
|
+
version: 4.2.10
|
|
143
|
+
type: :development
|
|
144
|
+
prerelease: false
|
|
145
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
146
|
+
requirements:
|
|
147
|
+
- - "~>"
|
|
148
|
+
- !ruby/object:Gem::Version
|
|
149
|
+
version: '4.2'
|
|
150
|
+
- - ">="
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: 4.2.10
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: yard
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - "~>"
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: '0.8'
|
|
160
|
+
- - ">="
|
|
161
|
+
- !ruby/object:Gem::Version
|
|
162
|
+
version: 0.8.7.4
|
|
163
|
+
type: :development
|
|
164
|
+
prerelease: false
|
|
165
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
166
|
+
requirements:
|
|
167
|
+
- - "~>"
|
|
168
|
+
- !ruby/object:Gem::Version
|
|
169
|
+
version: '0.8'
|
|
170
|
+
- - ">="
|
|
171
|
+
- !ruby/object:Gem::Version
|
|
172
|
+
version: 0.8.7.4
|
|
133
173
|
description: Gem for Wargaming.net Public API http://ru.wargaming.net/developers/api_reference
|
|
134
174
|
.
|
|
135
175
|
email:
|
|
@@ -145,10 +185,10 @@ files:
|
|
|
145
185
|
- ".travis.yml"
|
|
146
186
|
- Gemfile
|
|
147
187
|
- Gemfile.lock
|
|
188
|
+
- Guardfile
|
|
148
189
|
- LICENSE
|
|
149
190
|
- MIT-LICENSE
|
|
150
191
|
- README.md
|
|
151
|
-
- README.rdoc
|
|
152
192
|
- Rakefile
|
|
153
193
|
- lib/generators/wot_api_ru/install_generator.rb
|
|
154
194
|
- lib/generators/wot_api_ru/templates/wot_api_ru.rb
|
|
@@ -234,3 +274,4 @@ signing_key:
|
|
|
234
274
|
specification_version: 4
|
|
235
275
|
summary: Wargaming.net Public API.
|
|
236
276
|
test_files: []
|
|
277
|
+
has_rdoc:
|
data/README.rdoc
DELETED