kazan 0.3.1 → 0.4.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.
- checksums.yaml +4 -4
- data/README.md +3 -8
- data/lib/kazan/app_builder.rb +5 -15
- data/lib/kazan/generators/app_generator.rb +8 -2
- data/lib/kazan/version.rb +1 -1
- data/spec/project_spec.rb +2 -12
- data/templates/Gemfile.api.erb +0 -2
- data/templates/Gemfile.erb +2 -3
- data/templates/_application.html.erb +5 -5
- data/templates/_javascript.html.erb +0 -2
- data/templates/i18n-tasks.yml +121 -0
- data/templates/i18n_spec.rb +17 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a146cf90117988b0e012a40f7caaad4e4fabd78
|
4
|
+
data.tar.gz: 3d12728bee49099e001b83d07a30a5880291e433
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0933b186353c97a1fff600a1fd413f11bb26739d98ad83f73536196507d54ab636c3e162eed4e392084c31b0095bb5eb6e323395567bf6dd0ea7bdcebd05b37c'
|
7
|
+
data.tar.gz: b7481dba81323156d85a26890b99861dfdf67c71f1f346618aa9f0d48e4a335c03e7638fabae5417b33dca4d4662805c0e855526fb54165a8e8e5b8a6b0b55cd
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Kazan creates rails project and setups predefined gems and tools.
|
4
4
|
|
5
|
-

|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -24,10 +24,6 @@ This generator maps all flags to rails native generator, for example you can cre
|
|
24
24
|
|
25
25
|
See all gems that will be installed to project in [Gemfile](https://github.com/khusnetdinov/kazan/blob/master/templates/Gemfile.erb) for web application or for api [Gemfile.api](https://github.com/khusnetdinov/kazan/blob/master/templates/Gemfile.api.erb).
|
26
26
|
|
27
|
-
## Options
|
28
|
-
|
29
|
-
- `--static` to use [Bitters](https://github.com/thoughtbot/bitters), [Bourbon](https://github.com/thoughtbot/bourbon), [Neat](https://github.com/thoughtbot/neat), [Refills](https://github.com/thoughtbot/refills).
|
30
|
-
|
31
27
|
## Gems
|
32
28
|
|
33
29
|
It includes applications gems:
|
@@ -36,9 +32,7 @@ It includes applications gems:
|
|
36
32
|
- [I18n](https://github.com/svenfuchs/rails-i18n) is central point to collect locale data for use in Ruby on Rails.
|
37
33
|
- [PostgreSQL](https://www.postgresql.org/) database with [PG](https://rubygems.org/gems/pg/versions/0.18.4) adapter is used by defaul.
|
38
34
|
- [Puma](http://puma.io/) is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications.
|
39
|
-
- [Rack Canonical Host](https://github.com/tylerhunt/rack-canonical-host) is middleware that lets you define a single host name as the canonical host for your application. Requests for other host names will then be redirected to the canonical host.
|
40
35
|
- [Rack Timeout](https://github.com/heroku/rack-timeout) aborts requests that are taking too long; an exception is raised.
|
41
|
-
- [Recepient Interceptor](https://github.com/croaky/recipient_interceptor) never accidentally send emails to real people from your staging environment.
|
42
36
|
- [Rails 5.0.0](http://rubyonrails.org/)
|
43
37
|
- [Rails Config](https://github.com/railsconfig/config) helps you easily manage environment specific settings in an easy and usable manner.
|
44
38
|
- [Rollbar](https://rollbar.com/) error monitoring fits right into your continuous delivery and deployment workflows to provide confidence in every code release.
|
@@ -46,7 +40,6 @@ It includes applications gems:
|
|
46
40
|
|
47
41
|
It includes assets gems [API EXCLUDED]:
|
48
42
|
|
49
|
-
- [Autoprefixer Rails](https://github.com/ai/autoprefixer-rails) is a tool to parse CSS and add vendor prefixes to CSS rules using values from the [Can I Use](http://caniuse.com/).
|
50
43
|
- [Normalize Css](https://necolas.github.io/normalize.css/) makes browsers render all elements more consistently and in line with modern standards. It precisely targets only the styles that need normalizing.
|
51
44
|
- [Sass](http://sass-lang.com/) is the most mature, stable, and powerful professional grade CSS extension language in the world.
|
52
45
|
|
@@ -72,6 +65,8 @@ It includes tests gems:
|
|
72
65
|
- [Factory Girl](https://github.com/thoughtbot/factory_girl) is a fixtures replacement with a straightforward definition syntax.
|
73
66
|
- [Faker](https://github.com/stympy/faker) a port of Perl's Data::Faker library that generates fake data.
|
74
67
|
- [Formulaic](https://github.com/thoughtbot/formulaic) [API EXCLUDED] the tedium of formulaic form filling with Capybara.
|
68
|
+
- [I18n-Tasks](https://github.com/glebm/i18n-tasks) [API EXCLUDED] Gem that helps manage locales and test if are there problems.
|
69
|
+
- [I18n-Yaml-Sorter](https://github.com/redealumni/i18n_yaml_sorter) [API EXCLUDED] Sort all locales by keys.
|
75
70
|
- [Launchy](https://github.com/copiousfreetime/launchy) [API EXCLUDED] helper class for launching cross-platform applications in a fire and forget manner.
|
76
71
|
- [Rspec](https://github.com/rspec/rspec-rails) is a testing framework for Rails.
|
77
72
|
- [Simplecov](https://github.com/colszowka/simplecov) is a code coverage analysis tool for Ruby.
|
data/lib/kazan/app_builder.rb
CHANGED
@@ -65,7 +65,6 @@ module Kazan
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def assets_config
|
68
|
-
copy_file 'browserslist', 'app/assets/stylesheets/browserslist'
|
69
68
|
copy_file 'errors.rb', 'config/initializers/errors.rb'
|
70
69
|
copy_file 'json_encoding.rb', 'config/initializers/json_encoding.rb'
|
71
70
|
end
|
@@ -150,11 +149,6 @@ module Kazan
|
|
150
149
|
|
151
150
|
def stylesheets_gems
|
152
151
|
gems = <<-RUBY
|
153
|
-
|
154
|
-
gem 'bourbon', '5.0.0.beta.6'
|
155
|
-
gem 'neat', '~> 1.8.0'
|
156
|
-
gem 'bitters'
|
157
|
-
gem 'refills', group: [:development, :test]
|
158
152
|
RUBY
|
159
153
|
|
160
154
|
inject_into_file 'Gemfile', gems,
|
@@ -171,15 +165,6 @@ gem 'refills', group: [:development, :test]
|
|
171
165
|
force: true)
|
172
166
|
end
|
173
167
|
|
174
|
-
def refills
|
175
|
-
generate 'refills:import', 'flashes'
|
176
|
-
remove_dir 'app/views/refills'
|
177
|
-
end
|
178
|
-
|
179
|
-
def bitters
|
180
|
-
run 'bitters install --path app/assets/stylesheets'
|
181
|
-
end
|
182
|
-
|
183
168
|
def static_pages
|
184
169
|
meta_tags = <<-EOS
|
185
170
|
<meta charset="utf-8" />
|
@@ -193,6 +178,11 @@ gem 'refills', group: [:development, :test]
|
|
193
178
|
end
|
194
179
|
end
|
195
180
|
|
181
|
+
def setup_locales
|
182
|
+
copy_file 'i18n-tasks.yml', 'config/i18n-tasks.yml'
|
183
|
+
copy_file 'i18n_spec.rb', 'spec/i18n_spec.rb'
|
184
|
+
end
|
185
|
+
|
196
186
|
def bundler_audit_config
|
197
187
|
copy_file 'bundler_audit.rake', 'lib/tasks/bundler_audit.rake'
|
198
188
|
append_file 'Rakefile', %{\ntask default: 'bundler:audit'\n}
|
@@ -33,6 +33,7 @@ module Kazan
|
|
33
33
|
invoke :setup_assets
|
34
34
|
invoke :setup_helpers
|
35
35
|
invoke :setup_error_pages
|
36
|
+
invoke :setup_locales
|
36
37
|
|
37
38
|
invoke :setup_static
|
38
39
|
|
@@ -135,8 +136,6 @@ module Kazan
|
|
135
136
|
build :remove_turbolinks
|
136
137
|
build :stylesheets_gems
|
137
138
|
build :stylesheets_manifest
|
138
|
-
build :refils
|
139
|
-
build :bitters
|
140
139
|
end
|
141
140
|
end
|
142
141
|
end
|
@@ -148,6 +147,13 @@ module Kazan
|
|
148
147
|
end
|
149
148
|
end
|
150
149
|
|
150
|
+
def setup_locales
|
151
|
+
unless options[:api]
|
152
|
+
say 'Setup locales tools'
|
153
|
+
build :setup_locales
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
151
157
|
def setup_bundler_audit
|
152
158
|
say 'Setup bundler audit'
|
153
159
|
build :bundler_audit_config
|
data/lib/kazan/version.rb
CHANGED
data/spec/project_spec.rb
CHANGED
@@ -20,7 +20,6 @@ RSpec.describe 'Project with configuration' do
|
|
20
20
|
'Gemfile',
|
21
21
|
'Procfile',
|
22
22
|
'README.md',
|
23
|
-
# 'browserList',
|
24
23
|
'.ruby-version',
|
25
24
|
'.gitignore',
|
26
25
|
'.env.local.example',
|
@@ -44,11 +43,9 @@ RSpec.describe 'Project with configuration' do
|
|
44
43
|
|
45
44
|
GEMS = [
|
46
45
|
'annotate',
|
47
|
-
'autoprefixer-rails',
|
48
46
|
'awesome_print',
|
49
47
|
'better_errors',
|
50
48
|
'bullet',
|
51
|
-
'bundler-audit',
|
52
49
|
'capybara',
|
53
50
|
'config',
|
54
51
|
'database_cleaner',
|
@@ -67,11 +64,10 @@ RSpec.describe 'Project with configuration' do
|
|
67
64
|
'pry-rails',
|
68
65
|
'puma',
|
69
66
|
'rack-mini-profiler',
|
70
|
-
'rack-canonical-host',
|
71
67
|
'rack-timeout',
|
72
|
-
'recipient_interceptor',
|
73
68
|
'rails',
|
74
|
-
'
|
69
|
+
'i18n-tasks',
|
70
|
+
'i18n_yaml_sorter',
|
75
71
|
'rollbar',
|
76
72
|
'rspec-rails',
|
77
73
|
'sass-rails',
|
@@ -141,12 +137,6 @@ RSpec.describe 'Project with configuration' do
|
|
141
137
|
end
|
142
138
|
end
|
143
139
|
|
144
|
-
# describe 'simple_from.rb' do
|
145
|
-
# subject { load_file 'config/initializers/simple_form.rb' }
|
146
|
-
|
147
|
-
# it { is_expected.to be_truthy }
|
148
|
-
# end
|
149
|
-
|
150
140
|
RSPEC.each do |helper|
|
151
141
|
describe helper do
|
152
142
|
subject { load_file "spec/#{helper}" }
|
data/templates/Gemfile.api.erb
CHANGED
data/templates/Gemfile.erb
CHANGED
@@ -8,7 +8,6 @@ gem 'config'
|
|
8
8
|
|
9
9
|
gem 'pg'
|
10
10
|
|
11
|
-
gem 'autoprefixer-rails'
|
12
11
|
gem 'normalize-rails', '~> 3.0.0'
|
13
12
|
gem 'sass-rails', '~> 5.0'
|
14
13
|
|
@@ -22,8 +21,6 @@ gem 'simple_form'
|
|
22
21
|
|
23
22
|
gem 'rollbar'
|
24
23
|
|
25
|
-
gem 'recipient_interceptor'
|
26
|
-
gem 'rack-canonical-host'
|
27
24
|
gem 'puma'
|
28
25
|
|
29
26
|
group :development do
|
@@ -35,6 +32,8 @@ group :development do
|
|
35
32
|
gem 'spring'
|
36
33
|
gem 'spring-commands-rspec'
|
37
34
|
gem 'web-console'
|
35
|
+
gem 'i18n-tasks'
|
36
|
+
gem 'i18n_yaml_sorter'
|
38
37
|
end
|
39
38
|
|
40
39
|
group :development, :test do
|
@@ -4,14 +4,14 @@
|
|
4
4
|
<meta charset="utf-8" />
|
5
5
|
<meta name="ROBOTS" content="NOODP" />
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
7
|
-
<title
|
7
|
+
<title>Application</title>
|
8
8
|
<%= stylesheet_link_tag :application, media: "all" %>
|
9
9
|
<%= csrf_meta_tags %>
|
10
10
|
</head>
|
11
|
-
<body
|
12
|
-
<%= render "shared/flashes" -%>
|
11
|
+
<body>
|
12
|
+
<%= render "layouts/shared/flashes" -%>
|
13
13
|
<%= yield %>
|
14
|
-
<%= render "shared/javascript" %>
|
15
|
-
<%= render "shared/styles" %>
|
14
|
+
<%= render "layouts/shared/javascript" %>
|
15
|
+
<%= render "layouts/shared/styles" %>
|
16
16
|
</body>
|
17
17
|
</html>
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
|
2
|
+
|
3
|
+
# The "main" locale.
|
4
|
+
base_locale: en
|
5
|
+
## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
|
6
|
+
# locales: [es, fr]
|
7
|
+
## Reporting locale, default: en. Available: en, ru.
|
8
|
+
# internal_locale: en
|
9
|
+
|
10
|
+
# Read and write translations.
|
11
|
+
data:
|
12
|
+
## Translations are read from the file system. Supported format: YAML, JSON.
|
13
|
+
## Provide a custom adapter:
|
14
|
+
# adapter: I18n::Tasks::Data::FileSystem
|
15
|
+
|
16
|
+
# Locale files or `File.find` patterns where translations are read from:
|
17
|
+
read:
|
18
|
+
## Default:
|
19
|
+
# - config/locales/%{locale}.yml
|
20
|
+
## More files:
|
21
|
+
# - config/locales/**/*.%{locale}.yml
|
22
|
+
## Another gem (replace %#= with %=):
|
23
|
+
# - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"
|
24
|
+
|
25
|
+
# Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
|
26
|
+
# `i18n-tasks normalize -p` will force move the keys according to these rules
|
27
|
+
write:
|
28
|
+
## For example, write devise and simple form keys to their respective files:
|
29
|
+
# - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
|
30
|
+
## Catch-all default:
|
31
|
+
# - config/locales/%{locale}.yml
|
32
|
+
|
33
|
+
## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
|
34
|
+
# router: conservative_router
|
35
|
+
|
36
|
+
yaml:
|
37
|
+
write:
|
38
|
+
# do not wrap lines at 80 characters
|
39
|
+
line_width: -1
|
40
|
+
|
41
|
+
## Pretty-print JSON:
|
42
|
+
# json:
|
43
|
+
# write:
|
44
|
+
# indent: ' '
|
45
|
+
# space: ' '
|
46
|
+
# object_nl: "\n"
|
47
|
+
# array_nl: "\n"
|
48
|
+
|
49
|
+
# Find translate calls
|
50
|
+
search:
|
51
|
+
## Paths or `File.find` patterns to search in:
|
52
|
+
# paths:
|
53
|
+
# - app/
|
54
|
+
|
55
|
+
## Root directories for relative keys resolution.
|
56
|
+
# relative_roots:
|
57
|
+
# - app/controllers
|
58
|
+
# - app/helpers
|
59
|
+
# - app/mailers
|
60
|
+
# - app/presenters
|
61
|
+
# - app/views
|
62
|
+
|
63
|
+
## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
|
64
|
+
## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json)
|
65
|
+
exclude:
|
66
|
+
- app/assets/images
|
67
|
+
- app/assets/fonts
|
68
|
+
- app/assets/videos
|
69
|
+
|
70
|
+
## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
|
71
|
+
## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
|
72
|
+
# only: ["*.rb", "*.html.slim"]
|
73
|
+
|
74
|
+
## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
|
75
|
+
# strict: true
|
76
|
+
|
77
|
+
## Multiple scanners can be used. Their results are merged.
|
78
|
+
## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
|
79
|
+
## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
|
80
|
+
|
81
|
+
## Google Translate
|
82
|
+
# translation:
|
83
|
+
# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
|
84
|
+
# api_key: "AbC-dEf5"
|
85
|
+
|
86
|
+
## Do not consider these keys missing:
|
87
|
+
# ignore_missing:
|
88
|
+
# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
|
89
|
+
# - '{devise,simple_form}.*'
|
90
|
+
|
91
|
+
## Consider these keys used:
|
92
|
+
# ignore_unused:
|
93
|
+
# - 'activerecord.attributes.*'
|
94
|
+
# - '{devise,kaminari,will_paginate}.*'
|
95
|
+
# - 'simple_form.{yes,no}'
|
96
|
+
# - 'simple_form.{placeholders,hints,labels}.*'
|
97
|
+
# - 'simple_form.{error_notification,required}.:'
|
98
|
+
|
99
|
+
## Exclude these keys from the `i18n-tasks eq-base' report:
|
100
|
+
# ignore_eq_base:
|
101
|
+
# all:
|
102
|
+
# - common.ok
|
103
|
+
# fr,es:
|
104
|
+
# - common.brand
|
105
|
+
|
106
|
+
## Ignore these keys completely:
|
107
|
+
# ignore:
|
108
|
+
# - kaminari.*
|
109
|
+
|
110
|
+
## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
|
111
|
+
## e.g. in case of a relative key defined in a helper method.
|
112
|
+
## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
|
113
|
+
#
|
114
|
+
# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
|
115
|
+
# only: %w(*.html.haml *.html.slim),
|
116
|
+
# patterns: [['= title\b', '.page_title']] %>
|
117
|
+
#
|
118
|
+
# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
|
119
|
+
#
|
120
|
+
# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
|
121
|
+
# patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'i18n/tasks'
|
2
|
+
|
3
|
+
RSpec.describe 'I18n' do
|
4
|
+
let(:i18n) { I18n::Tasks::BaseTask.new }
|
5
|
+
let(:missing_keys) { i18n.missing_keys }
|
6
|
+
let(:unused_keys) { i18n.unused_keys }
|
7
|
+
|
8
|
+
it 'does not have missing keys' do
|
9
|
+
message = "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missing' to show them"
|
10
|
+
expect(missing_keys).to be_empty, message
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'does not have unused keys' do
|
14
|
+
message = "#{unused_keys.leaves.count} unused i18n keys, run `i18n-tasks unused' to show them"
|
15
|
+
expect(unused_keys).to be_empty, message
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kazan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marat Khusnetdinov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -118,7 +118,9 @@ files:
|
|
118
118
|
- templates/errors.rb
|
119
119
|
- templates/factory_girl.rb
|
120
120
|
- templates/flashes_helper.rb
|
121
|
+
- templates/i18n-tasks.yml
|
121
122
|
- templates/i18n.rb
|
123
|
+
- templates/i18n_spec.rb
|
122
124
|
- templates/json_encoding.rb
|
123
125
|
- templates/project_gitignore
|
124
126
|
- templates/puma.rb
|
@@ -150,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
152
|
version: '0'
|
151
153
|
requirements: []
|
152
154
|
rubyforge_project:
|
153
|
-
rubygems_version: 2.
|
155
|
+
rubygems_version: 2.6.14
|
154
156
|
signing_key:
|
155
157
|
specification_version: 4
|
156
158
|
summary: Kazan creates rails project and setups predefined gems and tools.
|