cybele 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +27 -0
  4. data/cybele.gemspec +0 -1
  5. data/lib/cybele/generators/app_generator.rb +4 -5
  6. data/lib/cybele/helpers/active_storage.rb +8 -22
  7. data/lib/cybele/helpers/devise.rb +5 -0
  8. data/lib/cybele/helpers/general.rb +0 -6
  9. data/lib/cybele/helpers/pronto.rb +1 -1
  10. data/lib/cybele/version.rb +2 -2
  11. data/spec/features/cli_help_spec.rb +5 -0
  12. data/spec/features/new_default_project_spec.rb +30 -175
  13. data/spec/features/new_not_default_no_skip_docker_project_spec.rb +18 -0
  14. data/spec/features/new_not_default_no_skip_sidekiq_project_spec.rb +18 -0
  15. data/spec/features/new_not_default_project_spec.rb +30 -118
  16. data/spec/files/README_DEFAULT.md +39 -0
  17. data/spec/files/README_ONLY_NO_SKIP_DOCKER.md +36 -0
  18. data/spec/files/README_ONLY_NO_SKIP_SIDEKIQ.md +26 -0
  19. data/spec/files/README_SKIP_ALL.md +23 -0
  20. data/spec/spec_helper.rb +0 -9
  21. data/spec/support/cybele_test_helpers.rb +10 -2
  22. data/spec/support/shared_examples/better_errors_test_helper.rb +11 -0
  23. data/spec/support/shared_examples/bullet_test_helper.rb +13 -0
  24. data/spec/support/shared_examples/colorize_test_helper.rb +10 -0
  25. data/spec/support/shared_examples/config_test_helper.rb +36 -0
  26. data/spec/support/shared_examples/cybele_test_helper.rb +10 -0
  27. data/spec/support/shared_examples/default_view_test_helper.rb +11 -0
  28. data/spec/support/shared_examples/devise_test_helper.rb +45 -0
  29. data/spec/support/shared_examples/docker_development_environment.rb +74 -0
  30. data/spec/support/shared_examples/dotenv_test_helper.rb +31 -0
  31. data/spec/support/shared_examples/error_pages_test_helper.rb +24 -0
  32. data/spec/support/shared_examples/force_ssl_test_helper.rb +24 -0
  33. data/spec/support/shared_examples/git_ignore_test_helper.rb +12 -0
  34. data/spec/support/shared_examples/locale_language_test_helper.rb +43 -0
  35. data/spec/support/shared_examples/mailer_test_helper.rb +13 -0
  36. data/spec/support/shared_examples/model_test_helper.rb +13 -0
  37. data/spec/support/shared_examples/pronto_test_helper.rb +41 -0
  38. data/spec/support/shared_examples/rails_i18n_test_helper.rb +10 -0
  39. data/spec/support/shared_examples/ransack_test_helper.rb +10 -0
  40. data/spec/support/shared_examples/recipient_interceptor_test_helper.rb +13 -0
  41. data/spec/support/shared_examples/responder_test_helper.rb +32 -0
  42. data/spec/support/shared_examples/rollbar_test_helper.rb +13 -0
  43. data/spec/support/shared_examples/roo_test_helper.rb +10 -0
  44. data/spec/support/shared_examples/roo_xls_test_helper.rb +10 -0
  45. data/spec/support/shared_examples/sidekiq_environment.rb +29 -0
  46. data/spec/support/shared_examples/to_xls_test_helper.rb +10 -0
  47. data/spec/support/shared_examples/will_paginate_test_helper.rb +11 -0
  48. data/spec/support/shared_examples/write_xlsx_test_helper.rb +10 -0
  49. data/templates/Gemfile.erb +11 -12
  50. data/templates/README.md.erb +14 -2
  51. data/templates/active_storage/active_storage.yml.erb +8 -0
  52. data/templates/active_storage/amazon_env_all.erb +1 -3
  53. data/templates/app_files/app/views/hq/admins/_form.html.haml +2 -2
  54. data/templates/app_files/app/views/hq/admins/edit.html.haml +1 -1
  55. data/templates/app_files/app/views/hq/users/_form.html.haml +2 -2
  56. data/templates/app_files/app/views/hq/users/edit.html.haml +1 -1
  57. data/templates/app_files/app/views/user/profile/_form.html.haml +1 -1
  58. data/templates/bullet/bullet_settings.rb.erb +1 -1
  59. data/templates/cybele_gitignore +1 -1
  60. data/templates/docker/Dockerfile.erb +1 -1
  61. data/templates/docker/docker_env_local_sample.erb +2 -5
  62. data/templates/docker/docker_env_local_sample_host.erb +1 -1
  63. data/templates/docker/docker_env_local_sample_sidekiq.erb +1 -1
  64. data/templates/docker/docker_env_staging_production_sidekiq.erb +1 -1
  65. data/templates/dotenv/.env.local.erb +2 -0
  66. data/templates/dotenv/.env.production.erb +2 -0
  67. data/templates/dotenv/.env.staging.erb +2 -0
  68. data/templates/mailer/.env.local.erb +1 -2
  69. data/templates/pronto/.erb-lint.yml.erb +9 -0
  70. data/templates/ruby-version +1 -1
  71. data/templates/sidekiq/sidekiq.rb.erb +1 -1
  72. metadata +75 -41
  73. data/spec/support/config_test_helper.rb +0 -36
  74. data/spec/support/devise_test_helper.rb +0 -45
  75. data/spec/support/dotenv_test_helper.rb +0 -31
  76. data/spec/support/error_pages_test_helper.rb +0 -24
  77. data/spec/support/force_ssl_test_helper.rb +0 -24
  78. data/spec/support/git_ignore_test_helper.rb +0 -10
  79. data/spec/support/locale_language_test_helper.rb +0 -43
  80. data/spec/support/pronto_test_helpers.rb +0 -41
  81. data/spec/support/responder_test_helper.rb +0 -32
  82. data/templates/guardfile/guardfile_settings.rb.erb +0 -49
  83. data/templates/pronto/config.reek.erb +0 -42
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ConfigTestHelper
4
- def config_test
5
- gemfile_file = content('Gemfile')
6
- expect(gemfile_file).to match(/^gem 'config'/)
7
- expect(File).not_to exist(file_project_path('config/settings.local.yml'))
8
-
9
- config_development_file_test
10
- config_staging_file_test
11
- config_production_file_test
12
- config_test_file_test
13
- end
14
-
15
- private
16
-
17
- def config_development_file_test
18
- config_development_file = content('config/environments/development.rb')
19
- expect(config_development_file).to match(/^Rails.application.configure/)
20
- end
21
-
22
- def config_staging_file_test
23
- config_staging_file = content('config/environments/staging.rb')
24
- expect(config_staging_file).to match(/^Rails.application.configure/)
25
- end
26
-
27
- def config_production_file_test
28
- config_production_file = content('config/environments/production.rb')
29
- expect(config_production_file).to match(/^Rails.application.configure/)
30
- end
31
-
32
- def config_test_file_test
33
- config_test_file = content('config/environments/test.rb')
34
- expect(config_test_file).to match(/^Rails.application.configure/)
35
- end
36
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DeviseTestHelper
4
- def devise_test
5
- gemfile_file = content('Gemfile')
6
- expect(gemfile_file).to match(/^gem 'devise'/)
7
-
8
- devise_initializers_test
9
- devise_route_file_test
10
- devise_model_file_test
11
- file_control_test
12
- end
13
-
14
- private
15
-
16
- def devise_initializers_test
17
- initializers_devise = content('config/initializers/devise.rb')
18
- expect(initializers_devise).to match('mailer')
19
- expect(initializers_devise).to match('mailer_sender')
20
-
21
- filter_parameter_logging = content('config/initializers/filter_parameter_logging.rb')
22
- expect(filter_parameter_logging).to match(':password')
23
- expect(filter_parameter_logging).to match(':password_confirmation')
24
- end
25
-
26
- def devise_route_file_test
27
- devise_route = content('config/routes.rb')
28
- expect(devise_route).to match('devise_for :users')
29
- end
30
-
31
- def devise_model_file_test # rubocop:disable Metrics/AbcSize
32
- devise_model_file = content('app/models/user.rb')
33
- expect(devise_model_file).to match(':database_authenticatable')
34
- expect(devise_model_file).to match(':registerable')
35
- expect(devise_model_file).to match(':recoverable')
36
- expect(devise_model_file).to match(':rememberable')
37
- expect(devise_model_file).to match(':trackable')
38
- expect(devise_model_file).to match(':validatable')
39
- end
40
-
41
- def file_control_test
42
- expect(File).to exist(file_project_path('config/locales/devise.en.yml'))
43
- expect(File).to exist(file_project_path('config/locales/devise.tr.yml'))
44
- end
45
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module DotenvTestHelper
4
- def dotenv_test
5
- gemfile_file = content('Gemfile')
6
- expect(gemfile_file).to match(/^gem 'dotenv-rails'/)
7
-
8
- env_file_test
9
- env_staging_file_test
10
- env_production_file_test
11
- end
12
-
13
- private
14
-
15
- def env_file_test
16
- %w[.env.sample .env.local .environments/.env.local].each do |env|
17
- expect(File).to exist(file_project_path(env))
18
- expect(content(env)).to match('ROOT_PATH=http://localhost:3000')
19
- end
20
- end
21
-
22
- def env_staging_file_test
23
- env_staging_file = content('.environments/.env.staging')
24
- expect(env_staging_file).to match('ROOT_PATH=https://staging-dummy_app.herokuapp.com')
25
- end
26
-
27
- def env_production_file_test
28
- env_production_file = content('.environments/.env.production')
29
- expect(env_production_file).to match('ROOT_PATH=https://dummy_app.herokuapp.com')
30
- end
31
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ErrorPagesTestHelper
4
- def error_pages_test
5
- controller_file_test
6
- routes_file_test
7
- end
8
-
9
- private
10
-
11
- def controller_file_test # rubocop:disable Metrics/AbcSize
12
- application_controller_file = content('app/controllers/application_controller.rb')
13
- expect(application_controller_file).to match('rescue_from Exception')
14
- expect(application_controller_file).to match('rescue_from ActiveRecord::RecordNotFound')
15
- expect(application_controller_file).to match('rescue_from ActionController::RoutingError')
16
- expect(application_controller_file).to match('server_error')
17
- expect(application_controller_file).to match('page_not_found')
18
- end
19
-
20
- def routes_file_test
21
- route_file = content('config/routes.rb')
22
- expect(route_file).to match('unmatched_route')
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ForceSSLTestHelper
4
- def force_ssl_test
5
- %w[staging production].each do |env|
6
- expect(content("config/environments/#{env}.rb")).to match('config.force_ssl')
7
- end
8
- force_ssl_environment_test
9
- end
10
-
11
- private
12
-
13
- def force_ssl_environment_test
14
- %w[
15
- .env.sample
16
- .environments/.env.local
17
- .environments/.env.staging
18
- .environments/.env.production
19
- ].each do |env|
20
- expect(File).to exist(file_project_path(env))
21
- expect(content(env)).to match('RAILS_FORCE_SSL=')
22
- end
23
- end
24
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module GitIgnoreTestHelper
4
- def git_ignore_test
5
- application_controller_file = content('.gitignore')
6
- expect(application_controller_file).to match('.DS_Store')
7
- expect(application_controller_file).to match('.secret')
8
- expect(application_controller_file).to match('.env')
9
- end
10
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module LocaleLanguageTestHelper
4
- def locale_language_test
5
- expect(File).to exist(file_project_path('config/locales/en.yml'))
6
-
7
- file_content_control_test
8
- english_file_test
9
- turkish_file_test
10
- end
11
-
12
- private
13
-
14
- def file_content_control_test
15
- locale_file = content('config/locales/tr.yml')
16
- expect(locale_file).to match('phone:')
17
- expect(locale_file).to match('date:')
18
- expect(locale_file).to match('time:')
19
- expect(locale_file).to match('number:')
20
- end
21
-
22
- def english_file_test
23
- locale_file = content('config/locales/mailer.en.yml')
24
- expect(locale_file).to match('mailer:')
25
-
26
- locale_file = content('config/locales/models.en.yml')
27
- expect(locale_file).to match('activerecord:')
28
-
29
- locale_file = content('config/locales/view.en.yml')
30
- expect(locale_file).to match('view:')
31
- end
32
-
33
- def turkish_file_test
34
- locale_file = content('config/locales/mailer.tr.yml')
35
- expect(locale_file).to match('mailer:')
36
-
37
- locale_file = content('config/locales/models.tr.yml')
38
- expect(locale_file).to match('activerecord:')
39
-
40
- locale_file = content('config/locales/view.tr.yml')
41
- expect(locale_file).to match('view:')
42
- end
43
- end
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ProntoTestHelpers
4
- def pronto_test
5
- gemfile_file = content('Gemfile')
6
- pronto_gems.each do |gem|
7
- expect(gemfile_file).to match(gem)
8
- end
9
- file_exist_test(
10
- %w[
11
- example.pronto.yml
12
- .pronto.yml
13
- .haml-lint.yml
14
- config.reek
15
- .rubocop.yml
16
- bin/rubo
17
- ]
18
- )
19
- pronto_gitignore_test
20
- end
21
-
22
- private
23
-
24
- def pronto_gems
25
- [
26
- "gem 'pronto'",
27
- "gem 'pronto-brakeman'",
28
- "gem 'pronto-fasterer'",
29
- "gem 'pronto-flay'",
30
- "gem 'pronto-haml'",
31
- "gem 'pronto-poper'",
32
- "gem 'pronto-reek'",
33
- "gem 'pronto-rubocop'"
34
- ]
35
- end
36
-
37
- def pronto_gitignore_test
38
- gemfile_file = content('.gitignore')
39
- expect(gemfile_file).to match('.pronto.yml')
40
- end
41
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ResponderTestHelper
4
- def responder_test
5
- gemfile_file = content('Gemfile')
6
- expect(gemfile_file).to match(/^gem 'responders'/)
7
-
8
- lib_file = content('lib/application_responder.rb')
9
- expect(lib_file).to match(/^class ApplicationResponder/)
10
-
11
- controller_file_test
12
- i18n_file_test
13
- end
14
-
15
- private
16
-
17
- def controller_file_test
18
- controller_file = content('app/controllers/application_controller.rb')
19
- expect(controller_file).to match("^require 'application_responder'")
20
- expect(controller_file).to match('# self.responder = ApplicationResponder')
21
- expect(controller_file).to match('respond_to :html, :js, :json')
22
- end
23
-
24
- def i18n_file_test # rubocop:disable Metrics/AbcSize
25
- expect(File).to exist(file_project_path('config/locales/responders.en.yml'))
26
- locale_file = content('config/locales/responders.tr.yml')
27
- expect(locale_file).not_to match('# alert:')
28
- expect(locale_file).to match('create:')
29
- expect(locale_file).to match('update:')
30
- expect(locale_file).to match('destroy:')
31
- end
32
- end
@@ -1,49 +0,0 @@
1
- guard :rspec, cmd: 'bundle exec rspec' do
2
- require 'guard/rspec/dsl'
3
- dsl = Guard::RSpec::Dsl.new(self)
4
-
5
- # Feel free to open issues for suggestions and improvements
6
-
7
- # RSpec files
8
- rspec = dsl.rspec
9
- watch(rspec.spec_helper) { rspec.spec_dir }
10
- watch(rspec.spec_support) { rspec.spec_dir }
11
- watch(rspec.spec_files)
12
-
13
- # Ruby files
14
- ruby = dsl.ruby
15
- dsl.watch_spec_files_for(ruby.lib_files)
16
-
17
- # Rails files
18
- rails = dsl.rails(view_extensions: %w(erb haml slim))
19
- dsl.watch_spec_files_for(rails.app_files)
20
- dsl.watch_spec_files_for(rails.views)
21
-
22
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { 'spec/features' }
23
- watch(%r{^app/models/(.+)\.rb$}) { 'spec/features' }
24
- watch(rails.controllers) do |m|
25
- [
26
- rspec.spec.call("routing/#{m[1]}_routing"),
27
- rspec.spec.call("controllers/#{m[1]}_controller"),
28
- rspec.spec.call("acceptance/#{m[1]}")
29
- ]
30
- end
31
-
32
- # Rails config changes
33
- watch(rails.spec_helper) { rspec.spec_dir }
34
- watch(rails.routes) { 'spec' } #{ "#{rspec.spec_dir}/routing" }
35
- watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
36
-
37
- # Watch jobs
38
- watch(%r{^app/jobs/(.+)_(job)\.rb$}) { 'spec/jobs' }
39
-
40
- # Capybara features specs
41
- watch(rails.view_dirs) { 'spec/features' } # { |m| rspec.spec.call("features/#{m[1]}") }
42
- watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
43
-
44
- # Turnip features and steps
45
- watch(%r{^spec/acceptance/(.+)\.feature$})
46
- watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
47
- Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance'
48
- end
49
- end
@@ -1,42 +0,0 @@
1
- DuplicateMethodCall:
2
- enabled: false
3
-
4
- FeatureEnvy:
5
- enabled: false
6
-
7
- UtilityFunction:
8
- public_methods_only: true
9
-
10
- TooManyStatements:
11
- enabled: true
12
- max_statements: 6
13
-
14
- IrresponsibleModule:
15
- enabled: false
16
-
17
- "app/controllers/":
18
- InstanceVariableAssumption:
19
- enabled: false
20
- "app/mailers":
21
- InstanceVariableAssumption:
22
- enabled: false
23
- "app/jobs":
24
- InstanceVariableAssumption:
25
- enabled: false
26
- "app/helpers":
27
- UtilityFunction:
28
- enabled: false
29
- "config":
30
- UncommunicativeModuleName:
31
- enabled: false
32
- "db/migrate":
33
- TooManyStatements:
34
- enabled: false
35
- UncommunicativeVariableName:
36
- enabled: false
37
- "lib/modules":
38
- IrresponsibleModule:
39
- enabled: true
40
- "lib/tasks":
41
- UtilityFunction:
42
- enabled: false