onotole 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/onotole/add_user_gems/after_install_patch.rb +5 -8
- data/lib/onotole/add_user_gems/before_bundle_patch.rb +2 -2
- data/lib/onotole/add_user_gems/goodbye_message.rb +6 -0
- data/lib/onotole/default_scripts.rb +4 -0
- data/lib/onotole/generators/app_generator.rb +1 -0
- data/lib/onotole/tests.rb +1 -1
- data/lib/onotole/version.rb +1 -1
- data/templates/kill_postgress_conections.rake +18 -0
- data/templates/redis.rake +7 -0
- data/templates/support.rb +2 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41f3ef736978148e10f7583125f87b2bfa9433af
|
4
|
+
data.tar.gz: 91c526717b66b76498ab9c97bf62ba0fa148f2fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0444ab901be8c5fc53db3b0d269fe500430219193783c59e1bb891694fd33be3ffd19cf65de42be046d3904065bb891fe62af73394c179c7bad4770abfc78dfb
|
7
|
+
data.tar.gz: 6b904acfb2d9ec82295bc5cf648b856ff6e9c134b01eb43a92e052b0cf7fb966f7650ab1afb5adfd5861d6bb965902a62f5dbfcfc0fc73a59b34024b4ba6276a
|
data/README.md
CHANGED
@@ -345,6 +345,8 @@ coverage.
|
|
345
345
|
* Moved asset gems in assets group in Gemfile
|
346
346
|
* Disable logging and deferred garbage collecting gives up 20% test speed
|
347
347
|
improvement
|
348
|
+
* Rake task for killing PostgreSQL conventions `db:kill_postgres_connections`
|
349
|
+
* Rake task `redis:flushall`
|
348
350
|
|
349
351
|
## Heroku
|
350
352
|
|
@@ -48,7 +48,7 @@ module Onotole
|
|
48
48
|
if AppBuilder.devise_model
|
49
49
|
rails_generator "devise #{AppBuilder.devise_model.titleize}"
|
50
50
|
inject_into_file('app/controllers/application_controller.rb',
|
51
|
-
"\
|
51
|
+
"\n# before_action :authenticate_#{AppBuilder.devise_model.downcase}!",
|
52
52
|
after: 'before_action :configure_permitted_parameters, if: :devise_controller?')
|
53
53
|
end
|
54
54
|
if user_choose?(:bootstrap3)
|
@@ -72,7 +72,7 @@ end
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def after_install_guard
|
75
|
-
bundle_command
|
75
|
+
bundle_command "exec guard init #{quiet_suffix}"
|
76
76
|
replace_in_file 'Guardfile',
|
77
77
|
"guard 'puma' do",
|
78
78
|
'guard :puma, port: 3000 do', quiet_err = true
|
@@ -97,8 +97,7 @@ end
|
|
97
97
|
AppBuilder.use_asset_pipelline = false
|
98
98
|
touch AppBuilder.app_file_scss
|
99
99
|
append_file(AppBuilder.app_file_scss,
|
100
|
-
"\n@import '
|
101
|
-
\n@import 'bootstrap-sprockets';
|
100
|
+
"\n@import 'bootstrap-sprockets';
|
102
101
|
\n@import 'bootstrap';")
|
103
102
|
inject_into_file(AppBuilder.js_file, "\n//= require bootstrap-sprockets",
|
104
103
|
after: '//= require jquery_ujs')
|
@@ -110,9 +109,6 @@ end
|
|
110
109
|
remove_file 'app/views/layouts/application.html.erb'
|
111
110
|
rails_generator 'bootstrap:install static'
|
112
111
|
rails_generator 'bootstrap:layout'
|
113
|
-
inject_into_file('app/assets/stylesheets/bootstrap_and_overrides.css',
|
114
|
-
" =require devise_bootstrap_views\n",
|
115
|
-
before: ' */')
|
116
112
|
end
|
117
113
|
|
118
114
|
def after_install_normalize
|
@@ -299,7 +295,7 @@ end
|
|
299
295
|
end
|
300
296
|
|
301
297
|
def after_install_image_optim
|
302
|
-
|
298
|
+
File.open('config/initializers/image_optim.rb', 'w') do |f|
|
303
299
|
f.write 'Rails.application.config.assets.image_optim = {svgo: false, pngout: false}'
|
304
300
|
end
|
305
301
|
end
|
@@ -328,6 +324,7 @@ DATA
|
|
328
324
|
append_file '.env', 'REDIS_PATH=redis://localhost:6379/0'
|
329
325
|
append_file '.env.production', 'REDIS_PATH=redis://localhost:6379/0'
|
330
326
|
|
327
|
+
copy_file 'redis.rake', 'lib/tasks/redis.rake'
|
331
328
|
rubocop_conf = <<-DATA
|
332
329
|
Style/GlobalVars:
|
333
330
|
Enabled: false
|
@@ -98,11 +98,11 @@ module Onotole
|
|
98
98
|
|
99
99
|
# v.3.5 syntax. will be deprecated in 4.0
|
100
100
|
def configure_permitted_parameters
|
101
|
-
devise_parameter_sanitizer.
|
101
|
+
devise_parameter_sanitizer.permit(:sign_in) do |user_params|
|
102
102
|
user_params.permit(:email, :password, :remember_me)
|
103
103
|
end
|
104
104
|
|
105
|
-
devise_parameter_sanitizer.
|
105
|
+
devise_parameter_sanitizer.permit(:sign_up) do |user_params|
|
106
106
|
user_params.permit(:email, :password, :password_confirmation)
|
107
107
|
end
|
108
108
|
end
|
@@ -8,6 +8,7 @@ module Onotole
|
|
8
8
|
image_optim_check
|
9
9
|
rack_cors_check
|
10
10
|
ckeditor_check
|
11
|
+
devise_user_check
|
11
12
|
say_color BOLDGREEN, "Congratulations! Onotole gives you: 'Intellect+= 1'"
|
12
13
|
end
|
13
14
|
|
@@ -44,5 +45,10 @@ module Onotole
|
|
44
45
|
return unless user_choose? :ckeditor
|
45
46
|
say_color YELLOW, 'Visit ckeditor homepage and install back-end for it.'
|
46
47
|
end
|
48
|
+
|
49
|
+
def devise_user_check
|
50
|
+
return unless AppBuilder.devise_model
|
51
|
+
say_color GREEN, 'Turn on devise auth in application.rb or in your controlled. It is turned off by default'
|
52
|
+
end
|
47
53
|
end
|
48
54
|
end
|
@@ -204,5 +204,9 @@ end
|
|
204
204
|
def add_dotenv_to_startup
|
205
205
|
inject_into_file('config/application.rb', "\nDotenv::Railtie.load\n", after: 'Bundler.require(*Rails.groups)')
|
206
206
|
end
|
207
|
+
|
208
|
+
def provide_kill_postgres_connections_task
|
209
|
+
copy_file 'kill_postgress_conections.rake', 'lib/tasks/kill_postgress_conections.rake'
|
210
|
+
end
|
207
211
|
end
|
208
212
|
end
|
@@ -114,6 +114,7 @@ module Onotole
|
|
114
114
|
build :raise_on_unpermitted_parameters
|
115
115
|
build :provide_setup_script
|
116
116
|
build :provide_dev_prime_task
|
117
|
+
build :provide_kill_postgres_connections_task
|
117
118
|
build :configure_generators
|
118
119
|
build :configure_i18n_for_missing_translations
|
119
120
|
build :configure_quiet_assets
|
data/lib/onotole/tests.rb
CHANGED
@@ -28,7 +28,7 @@ end
|
|
28
28
|
remove_file 'spec/rails_helper.rb'
|
29
29
|
remove_file 'spec/spec_helper.rb'
|
30
30
|
copy_file 'rails_helper.rb', 'spec/rails_helper.rb'
|
31
|
-
copy_file 'deferred_garbage_collection.rb', 'spec/deferred_garbage_collection.rb'
|
31
|
+
copy_file 'deferred_garbage_collection.rb', 'spec/support/deferred_garbage_collection.rb'
|
32
32
|
template 'spec_helper.rb.erb', 'spec/spec_helper.rb'
|
33
33
|
end
|
34
34
|
|
data/lib/onotole/version.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
if Rails.env.development?
|
3
|
+
namespace :db do
|
4
|
+
desc 'Kill Postgres connections'
|
5
|
+
task kill_postgres_connections: :environment do
|
6
|
+
db_name = "#{File.basename(Rails.root)}_#{Rails.env}"
|
7
|
+
sh = <<EOF
|
8
|
+
ps xa \
|
9
|
+
| grep postgres: \
|
10
|
+
| grep #{db_name} \
|
11
|
+
| grep -v grep \
|
12
|
+
| awk '{print $1}' \
|
13
|
+
| sudo xargs kill
|
14
|
+
EOF
|
15
|
+
puts `#{sh}`
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/templates/support.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onotole
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kvokka
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-04-
|
12
|
+
date: 2016-04-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- templates/inet_input.rb
|
162
162
|
- templates/json_encoding.rb
|
163
163
|
- templates/kaminari.rb
|
164
|
+
- templates/kill_postgress_conections.rake
|
164
165
|
- templates/newrelic.yml.erb
|
165
166
|
- templates/onotole_layout.html.erb.erb
|
166
167
|
- templates/onotole_overcommit.yml
|
@@ -168,6 +169,7 @@ files:
|
|
168
169
|
- templates/puma.rb.erb
|
169
170
|
- templates/rack_mini_profiler.rb
|
170
171
|
- templates/rails_helper.rb
|
172
|
+
- templates/redis.rake
|
171
173
|
- templates/rubocop.yml
|
172
174
|
- templates/secrets.yml
|
173
175
|
- templates/shoulda_matchers_config_rspec.rb
|