wot_api_ru 0.0.1 → 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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +10 -0
  4. data/.rspec +3 -0
  5. data/.travis.yml +11 -0
  6. data/Gemfile +14 -0
  7. data/Gemfile.lock +133 -0
  8. data/LICENSE +21 -0
  9. data/README.md +17 -10
  10. data/README.rdoc +3 -0
  11. data/Rakefile +1 -1
  12. data/lib/generators/{wot_api → wot_api_ru}/install_generator.rb +3 -3
  13. data/lib/generators/wot_api_ru/templates/wot_api_ru.rb +2 -0
  14. data/lib/tasks/{wot_api_tasks.rake → wot_api_ru_tasks.rake} +1 -1
  15. data/lib/wot_api_ru.rb +5 -0
  16. data/lib/{wot_api → wot_api_ru}/client.rb +6 -6
  17. data/lib/{wot_api → wot_api_ru}/constants.rb +1 -1
  18. data/lib/{wot_api → wot_api_ru}/settings.rb +1 -1
  19. data/lib/wot_api_ru/version.rb +3 -0
  20. data/spec/dummy/.rspec +3 -0
  21. data/spec/dummy/README.rdoc +28 -0
  22. data/spec/dummy/Rakefile +6 -0
  23. data/spec/dummy/app/assets/images/.keep +0 -0
  24. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  25. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  26. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  27. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  28. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  29. data/spec/dummy/app/mailers/.keep +0 -0
  30. data/spec/dummy/app/models/.keep +0 -0
  31. data/spec/dummy/app/models/concerns/.keep +0 -0
  32. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  33. data/spec/dummy/bin/bundle +3 -0
  34. data/spec/dummy/bin/rails +4 -0
  35. data/spec/dummy/bin/rake +4 -0
  36. data/spec/dummy/config.ru +4 -0
  37. data/spec/dummy/config/application.rb +29 -0
  38. data/spec/dummy/config/boot.rb +5 -0
  39. data/spec/dummy/config/database.yml +25 -0
  40. data/spec/dummy/config/environment.rb +5 -0
  41. data/spec/dummy/config/environments/development.rb +37 -0
  42. data/spec/dummy/config/environments/production.rb +82 -0
  43. data/spec/dummy/config/environments/test.rb +39 -0
  44. data/spec/dummy/config/initializers/assets.rb +8 -0
  45. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  46. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  47. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  48. data/spec/dummy/config/initializers/inflections.rb +16 -0
  49. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  50. data/spec/dummy/config/initializers/session_store.rb +3 -0
  51. data/spec/dummy/config/initializers/wot_api_ru.rb +2 -0
  52. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  53. data/spec/dummy/config/locales/en.yml +23 -0
  54. data/spec/dummy/config/routes.rb +56 -0
  55. data/spec/dummy/lib/assets/.keep +0 -0
  56. data/spec/dummy/log/.keep +0 -0
  57. data/spec/dummy/public/404.html +67 -0
  58. data/spec/dummy/public/422.html +67 -0
  59. data/spec/dummy/public/500.html +66 -0
  60. data/spec/dummy/public/favicon.ico +0 -0
  61. data/spec/rails_helper.rb +43 -0
  62. data/spec/spec_helper.rb +80 -0
  63. data/spec/wot_api_ru/constants_spec.rb +49 -0
  64. data/spec/wot_api_ru/settings_spec.rb +14 -0
  65. data/spec/wot_api_ru/version_spec.rb +6 -0
  66. data/wot_api_ru.gemspec +27 -0
  67. metadata +94 -12
  68. data/lib/generators/wot_api/templates/wot_api.rb +0 -2
  69. data/lib/wot_api.rb +0 -5
  70. data/lib/wot_api/version.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e784df485fc14dd6db77fdecca58b2257864e6a
4
- data.tar.gz: bcf73b0afcc842d3684854c9b19ba2e087421ee5
3
+ metadata.gz: 53225c2c1ce2762a15029a41e014dc9173492146
4
+ data.tar.gz: f54829d42104889bfa5b31c9e153b676a484212a
5
5
  SHA512:
6
- metadata.gz: af49872f2e85690b29b0343feb613a55e6dd72086b1a9c990e6625f8671613b1e505d49b9aa245ee81e5e331cc9fb4160b02318060161f14d18d3f913a831bd4
7
- data.tar.gz: ec46ac5a4d4a1ef882a83cda4174a53ec2253d01a334dd49503fbf3e71bd33018f4f10abafb174244190d11286debb8d0ec0d00df9c932b68797bca23506b00e
6
+ metadata.gz: a94f6a6504287f9dc9b7ba82c0588196b7175dd5dd17bfeaf572ca0aedc5ac9bb7590419d830d9f61b646c99904f1e76c20032f902a1cde7f09a58b0783fc8d9
7
+ data.tar.gz: 8bd540fdd8b4f9ca5f45d03487857211deb6dd5107456c387aaf59ba3d5ee8c2f3d75b894c09c05df46cb514bf23c33acafef10f9e9fc735928035622490cd29
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ spec/dummy/db/*.sqlite3
5
+ spec/dummy/db/*.sqlite3-journal
6
+ spec/dummy/log/*.log
7
+ spec/dummy/tmp/
8
+ spec/dummy/config/secrets.yml
9
+ spec/dummy/.sass-cache
10
+ coverage/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --warnings
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ script: bundle exec rspec
5
+ install:
6
+ - 'bundle install'
7
+ branches:
8
+ only:
9
+ - 'master'
10
+ notifications:
11
+ email: false
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
- WotApi
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
- WotApi works with Rails 4.1 onwards. You can add it to your Gemfile with:
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/wot_api', :tag => 'v0.0.1'
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 WotApi and add it to your Gemfile, you need to run the generator:
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 wot_api:install
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/wot_api.rb :
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
- WotApi::Settings[:application_id] = ENV['WOT_API_APP_ID']
33
+ WotApiRu::Settings[:application_id] = ENV['WOT_API_RU_APP_ID']
27
34
  ```
28
35
 
29
- After this steps you can create WotApi client and call to Wargaming.net Public API:
36
+ After this steps you can create WotApiRu client and call to Wargaming.net Public API:
30
37
 
31
38
  ```ruby
32
- client = WotApi::Client.new
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 WotApi::Client#account_list with parameters of API etc.
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
@@ -0,0 +1,3 @@
1
+ = WotApiRu
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ require 'rdoc/task'
8
8
 
9
9
  RDoc::Task.new(:rdoc) do |rdoc|
10
10
  rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'WotApi'
11
+ rdoc.title = 'WotApiRu'
12
12
  rdoc.options << '--line-numbers'
13
13
  rdoc.rdoc_files.include('README.rdoc')
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
@@ -1,18 +1,18 @@
1
1
  require 'rails/generators'
2
2
 
3
- module WotApi
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
- "wot_api"
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 "wot_api.rb", "config/initializers/wot_api.rb"
15
+ copy_file "wot_api_ru.rb", "config/initializers/wot_api_ru.rb"
16
16
  end
17
17
  end
18
18
  end
@@ -0,0 +1,2 @@
1
+ # Set your application Wargaming key here!
2
+ WotApiRu::Settings[:application_id] = ENV['WOT_API_RU_APP_ID']
@@ -1,4 +1,4 @@
1
1
  # desc "Explaining what the task does"
2
- # task :wot_api do
2
+ # task :wot_api_ru do
3
3
  # # Task goes here
4
4
  # end
data/lib/wot_api_ru.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'generators/wot_api_ru/install_generator'
2
+ require 'wot_api_ru/client'
3
+
4
+ module WotApiRu
5
+ end
@@ -1,15 +1,15 @@
1
- require 'wot_api/constants'
2
- require 'wot_api/settings'
1
+ require 'wot_api_ru/constants'
2
+ require 'wot_api_ru/settings'
3
3
  require 'rest_client'
4
4
 
5
- module WotApi
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 WotApi::Constants::PATH[meth.to_sym].nil?
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] ||= WotApi::Settings[:application_id]
12
- path = WotApi::Constants::HOST + WotApi::Constants::PATH[meth.to_sym]
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
 
@@ -1,4 +1,4 @@
1
- module WotApi
1
+ module WotApiRu
2
2
  module Constants
3
3
 
4
4
  HOST = 'https://api.worldoftanks.ru/wot/'
@@ -1,4 +1,4 @@
1
- module WotApi
1
+ module WotApiRu
2
2
  class Settings
3
3
 
4
4
  @@options = Hash.new
@@ -0,0 +1,3 @@
1
+ module WotApiRu
2
+ VERSION = '0.1.0'
3
+ end
data/spec/dummy/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --warnings
3
+ --require spec_helper
@@ -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>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
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
+ */