From 224c0de176fcf27a98a4d35745b001b757653a03 Mon Sep 17 00:00:00 2001 From: "Andrew W. Lee" Date: Mon, 10 Feb 2020 20:07:07 -1000 Subject: [PATCH] Add integration tests to project (#747) Adds integration tests to the project that's able to run in CI across different ruby versions. * Adds a Rails 5.2.4.1 app * Adds a Rails 6.0.2.1 app Fixes #733 --- .github/workflows/ci.yml | 22 +- .gitignore | 6 - .rubocop.yml | 1 + .rubocop_todo.yml | 404 +++--------------- .travis.yml | 29 +- Gemfile | 5 +- spec/integration/integration_helper.rb | 25 ++ spec/integration/rails_5.2.4.1/.gitignore | 31 ++ spec/integration/rails_5.2.4.1/Gemfile | 59 +++ spec/integration/rails_5.2.4.1/Gemfile.lock | 215 ++++++++++ spec/integration/rails_5.2.4.1/README.md | 24 ++ spec/integration/rails_5.2.4.1/Rakefile | 6 + .../app/assets/config/manifest.js | 3 + .../rails_5.2.4.1/app/assets/images/.keep | 0 .../app/assets/javascripts/application.js | 16 + .../app/assets/javascripts/cable.js | 13 + .../app/assets/javascripts/channels/.keep | 0 .../app/assets/stylesheets/application.css | 15 + .../app/channels/application_cable/channel.rb | 4 + .../channels/application_cable/connection.rb | 4 + .../app/controllers/application_controller.rb | 2 + .../app/controllers/concerns/.keep | 0 .../app/helpers/application_helper.rb | 2 + .../rails_5.2.4.1/app/jobs/application_job.rb | 2 + .../app/mailers/application_mailer.rb | 4 + .../app/models/application_record.rb | 3 + .../rails_5.2.4.1/app/models/concerns/.keep | 0 .../rails_5.2.4.1/app/models/task.rb | 2 + .../app/views/layouts/application.html.erb | 15 + .../app/views/layouts/mailer.html.erb | 13 + .../app/views/layouts/mailer.text.erb | 1 + spec/integration/rails_5.2.4.1/bin/bundle | 3 + spec/integration/rails_5.2.4.1/bin/rails | 4 + spec/integration/rails_5.2.4.1/bin/rake | 4 + spec/integration/rails_5.2.4.1/bin/setup | 36 ++ spec/integration/rails_5.2.4.1/bin/update | 31 ++ spec/integration/rails_5.2.4.1/bin/yarn | 11 + spec/integration/rails_5.2.4.1/config.ru | 5 + .../rails_5.2.4.1/config/application.rb | 19 + spec/integration/rails_5.2.4.1/config/boot.rb | 4 + .../rails_5.2.4.1/config/cable.yml | 10 + .../rails_5.2.4.1/config/credentials.yml.enc | 1 + .../rails_5.2.4.1/config/database.yml | 25 ++ .../rails_5.2.4.1/config/environment.rb | 5 + .../config/environments/development.rb | 61 +++ .../config/environments/production.rb | 94 ++++ .../rails_5.2.4.1/config/environments/test.rb | 46 ++ .../application_controller_renderer.rb | 8 + .../config/initializers/assets.rb | 14 + .../initializers/backtrace_silencers.rb | 7 + .../initializers/content_security_policy.rb | 25 ++ .../config/initializers/cookies_serializer.rb | 5 + .../initializers/filter_parameter_logging.rb | 4 + .../config/initializers/inflections.rb | 16 + .../config/initializers/mime_types.rb | 4 + .../config/initializers/wrap_parameters.rb | 14 + .../rails_5.2.4.1/config/locales/en.yml | 33 ++ spec/integration/rails_5.2.4.1/config/puma.rb | 37 ++ .../rails_5.2.4.1/config/routes.rb | 4 + .../rails_5.2.4.1/config/spring.rb | 6 + .../rails_5.2.4.1/config/storage.yml | 34 ++ .../db/migrate/20200204052946_create_tasks.rb | 11 + spec/integration/rails_5.2.4.1/db/schema.rb | 23 + spec/integration/rails_5.2.4.1/db/seeds.rb | 7 + .../rails_5.2.4.1/lib/assets/.keep | 0 .../integration/rails_5.2.4.1/lib/tasks/.keep | 0 spec/integration/rails_5.2.4.1/log/.keep | 0 spec/integration/rails_5.2.4.1/package.json | 5 + .../integration/rails_5.2.4.1/public/404.html | 67 +++ .../integration/rails_5.2.4.1/public/422.html | 67 +++ .../integration/rails_5.2.4.1/public/500.html | 66 +++ .../public/apple-touch-icon-precomposed.png | 0 .../rails_5.2.4.1/public/apple-touch-icon.png | 0 .../rails_5.2.4.1/public/favicon.ico | 0 .../rails_5.2.4.1/public/robots.txt | 1 + spec/integration/rails_5.2.4.1/storage/.keep | 0 .../test/application_system_test_case.rb | 5 + .../rails_5.2.4.1/test/controllers/.keep | 0 .../rails_5.2.4.1/test/fixtures/.keep | 0 .../rails_5.2.4.1/test/fixtures/files/.keep | 0 .../rails_5.2.4.1/test/fixtures/tasks.yml | 11 + .../rails_5.2.4.1/test/helpers/.keep | 0 .../rails_5.2.4.1/test/integration/.keep | 0 .../rails_5.2.4.1/test/mailers/.keep | 0 .../rails_5.2.4.1/test/models/.keep | 0 .../rails_5.2.4.1/test/models/task_test.rb | 7 + .../rails_5.2.4.1/test/system/.keep | 0 .../rails_5.2.4.1/test/test_helper.rb | 10 + spec/integration/rails_5.2.4.1/tmp/.keep | 0 spec/integration/rails_5.2.4.1/vendor/.keep | 0 spec/integration/rails_5.2.4.1_spec.rb | 155 +++++++ spec/integration/rails_6.0.2.1/.gitignore | 36 ++ spec/integration/rails_6.0.2.1/.keep | 0 spec/integration/rails_6.0.2.1/.rubocop.yml | 1 + .../rails_6.0.2.1/.rubocop_todo.yml | 156 +++++++ spec/integration/rails_6.0.2.1/Gemfile | 45 ++ spec/integration/rails_6.0.2.1/Gemfile.lock | 201 +++++++++ spec/integration/rails_6.0.2.1/README.md | 24 ++ spec/integration/rails_6.0.2.1/Rakefile | 6 + .../app/assets/config/manifest.js | 2 + .../rails_6.0.2.1/app/assets/images/.keep | 0 .../app/assets/stylesheets/application.css | 15 + .../app/channels/application_cable/channel.rb | 4 + .../channels/application_cable/connection.rb | 4 + .../app/controllers/application_controller.rb | 2 + .../app/controllers/concerns/.keep | 0 .../app/helpers/application_helper.rb | 2 + .../rails_6.0.2.1/app/jobs/application_job.rb | 7 + .../app/mailers/application_mailer.rb | 4 + .../app/models/application_record.rb | 3 + .../rails_6.0.2.1/app/models/concerns/.keep | 0 .../rails_6.0.2.1/app/models/task.rb | 2 + .../app/views/layouts/application.html.erb | 14 + .../app/views/layouts/mailer.html.erb | 13 + .../app/views/layouts/mailer.text.erb | 1 + spec/integration/rails_6.0.2.1/bin/bundle | 105 +++++ spec/integration/rails_6.0.2.1/bin/rails | 4 + spec/integration/rails_6.0.2.1/bin/rake | 4 + spec/integration/rails_6.0.2.1/bin/setup | 33 ++ spec/integration/rails_6.0.2.1/config.ru | 5 + .../rails_6.0.2.1/config/application.rb | 32 ++ spec/integration/rails_6.0.2.1/config/boot.rb | 4 + .../rails_6.0.2.1/config/cable.yml | 10 + .../rails_6.0.2.1/config/credentials.yml.enc | 1 + .../rails_6.0.2.1/config/database.yml | 25 ++ .../rails_6.0.2.1/config/environment.rb | 5 + .../config/environments/development.rb | 55 +++ .../config/environments/production.rb | 106 +++++ .../rails_6.0.2.1/config/environments/test.rb | 48 +++ .../application_controller_renderer.rb | 8 + .../initializers/backtrace_silencers.rb | 7 + .../initializers/content_security_policy.rb | 28 ++ .../config/initializers/cookies_serializer.rb | 5 + .../initializers/filter_parameter_logging.rb | 4 + .../config/initializers/inflections.rb | 16 + .../config/initializers/mime_types.rb | 4 + .../config/initializers/wrap_parameters.rb | 14 + .../rails_6.0.2.1/config/locales/en.yml | 33 ++ spec/integration/rails_6.0.2.1/config/puma.rb | 38 ++ .../rails_6.0.2.1/config/routes.rb | 4 + .../rails_6.0.2.1/config/storage.yml | 34 ++ .../db/migrate/20200201204456_create_tasks.rb | 11 + spec/integration/rails_6.0.2.1/db/schema.rb | 23 + spec/integration/rails_6.0.2.1/db/seeds.rb | 7 + .../rails_6.0.2.1/lib/assets/.keep | 0 .../integration/rails_6.0.2.1/lib/tasks/.keep | 0 spec/integration/rails_6.0.2.1/log/.keep | 0 .../integration/rails_6.0.2.1/public/404.html | 67 +++ .../integration/rails_6.0.2.1/public/422.html | 67 +++ .../integration/rails_6.0.2.1/public/500.html | 66 +++ .../public/apple-touch-icon-precomposed.png | 0 .../rails_6.0.2.1/public/apple-touch-icon.png | 0 .../rails_6.0.2.1/public/favicon.ico | 0 .../rails_6.0.2.1/public/robots.txt | 1 + spec/integration/rails_6.0.2.1/storage/.keep | 0 .../test/application_system_test_case.rb | 5 + .../application_cable/connection_test.rb | 11 + .../rails_6.0.2.1/test/controllers/.keep | 0 .../rails_6.0.2.1/test/fixtures/.keep | 0 .../rails_6.0.2.1/test/fixtures/files/.keep | 0 .../rails_6.0.2.1/test/fixtures/tasks.yml | 11 + .../rails_6.0.2.1/test/helpers/.keep | 0 .../rails_6.0.2.1/test/integration/.keep | 0 .../rails_6.0.2.1/test/mailers/.keep | 0 .../rails_6.0.2.1/test/models/.keep | 0 .../rails_6.0.2.1/test/models/task_test.rb | 7 + .../rails_6.0.2.1/test/system/.keep | 0 .../rails_6.0.2.1/test/test_helper.rb | 13 + spec/integration/rails_6.0.2.1/tmp/.keep | 0 spec/integration/rails_6.0.2.1/vendor/.keep | 0 spec/integration/rails_6.0.2.1_spec.rb | 170 ++++++++ spec/spec_helper.rb | 61 --- 172 files changed, 3188 insertions(+), 437 deletions(-) create mode 100644 spec/integration/integration_helper.rb create mode 100644 spec/integration/rails_5.2.4.1/.gitignore create mode 100644 spec/integration/rails_5.2.4.1/Gemfile create mode 100644 spec/integration/rails_5.2.4.1/Gemfile.lock create mode 100644 spec/integration/rails_5.2.4.1/README.md create mode 100644 spec/integration/rails_5.2.4.1/Rakefile create mode 100644 spec/integration/rails_5.2.4.1/app/assets/config/manifest.js create mode 100644 spec/integration/rails_5.2.4.1/app/assets/images/.keep create mode 100644 spec/integration/rails_5.2.4.1/app/assets/javascripts/application.js create mode 100644 spec/integration/rails_5.2.4.1/app/assets/javascripts/cable.js create mode 100644 spec/integration/rails_5.2.4.1/app/assets/javascripts/channels/.keep create mode 100644 spec/integration/rails_5.2.4.1/app/assets/stylesheets/application.css create mode 100644 spec/integration/rails_5.2.4.1/app/channels/application_cable/channel.rb create mode 100644 spec/integration/rails_5.2.4.1/app/channels/application_cable/connection.rb create mode 100644 spec/integration/rails_5.2.4.1/app/controllers/application_controller.rb create mode 100644 spec/integration/rails_5.2.4.1/app/controllers/concerns/.keep create mode 100644 spec/integration/rails_5.2.4.1/app/helpers/application_helper.rb create mode 100644 spec/integration/rails_5.2.4.1/app/jobs/application_job.rb create mode 100644 spec/integration/rails_5.2.4.1/app/mailers/application_mailer.rb create mode 100644 spec/integration/rails_5.2.4.1/app/models/application_record.rb create mode 100644 spec/integration/rails_5.2.4.1/app/models/concerns/.keep create mode 100644 spec/integration/rails_5.2.4.1/app/models/task.rb create mode 100644 spec/integration/rails_5.2.4.1/app/views/layouts/application.html.erb create mode 100644 spec/integration/rails_5.2.4.1/app/views/layouts/mailer.html.erb create mode 100644 spec/integration/rails_5.2.4.1/app/views/layouts/mailer.text.erb create mode 100755 spec/integration/rails_5.2.4.1/bin/bundle create mode 100755 spec/integration/rails_5.2.4.1/bin/rails create mode 100755 spec/integration/rails_5.2.4.1/bin/rake create mode 100755 spec/integration/rails_5.2.4.1/bin/setup create mode 100755 spec/integration/rails_5.2.4.1/bin/update create mode 100755 spec/integration/rails_5.2.4.1/bin/yarn create mode 100644 spec/integration/rails_5.2.4.1/config.ru create mode 100644 spec/integration/rails_5.2.4.1/config/application.rb create mode 100644 spec/integration/rails_5.2.4.1/config/boot.rb create mode 100644 spec/integration/rails_5.2.4.1/config/cable.yml create mode 100644 spec/integration/rails_5.2.4.1/config/credentials.yml.enc create mode 100644 spec/integration/rails_5.2.4.1/config/database.yml create mode 100644 spec/integration/rails_5.2.4.1/config/environment.rb create mode 100644 spec/integration/rails_5.2.4.1/config/environments/development.rb create mode 100644 spec/integration/rails_5.2.4.1/config/environments/production.rb create mode 100644 spec/integration/rails_5.2.4.1/config/environments/test.rb create mode 100644 spec/integration/rails_5.2.4.1/config/initializers/application_controller_renderer.rb create mode 100644 spec/integration/rails_5.2.4.1/config/initializers/assets.rb create mode 100644 spec/integration/rails_5.2.4.1/config/initializers/backtrace_silencers.rb create mode 100644 spec/integration/rails_5.2.4.1/config/initializers/content_security_policy.rb create mode 100644 spec/integration/rails_5.2.4.1/config/initializers/cookies_serializer.rb create mode 100644 spec/integration/rails_5.2.4.1/config/initializers/filter_parameter_logging.rb create mode 100644 spec/integration/rails_5.2.4.1/config/initializers/inflections.rb create mode 100644 spec/integration/rails_5.2.4.1/config/initializers/mime_types.rb create mode 100644 spec/integration/rails_5.2.4.1/config/initializers/wrap_parameters.rb create mode 100644 spec/integration/rails_5.2.4.1/config/locales/en.yml create mode 100644 spec/integration/rails_5.2.4.1/config/puma.rb create mode 100644 spec/integration/rails_5.2.4.1/config/routes.rb create mode 100644 spec/integration/rails_5.2.4.1/config/spring.rb create mode 100644 spec/integration/rails_5.2.4.1/config/storage.yml create mode 100644 spec/integration/rails_5.2.4.1/db/migrate/20200204052946_create_tasks.rb create mode 100644 spec/integration/rails_5.2.4.1/db/schema.rb create mode 100644 spec/integration/rails_5.2.4.1/db/seeds.rb create mode 100644 spec/integration/rails_5.2.4.1/lib/assets/.keep create mode 100644 spec/integration/rails_5.2.4.1/lib/tasks/.keep create mode 100644 spec/integration/rails_5.2.4.1/log/.keep create mode 100644 spec/integration/rails_5.2.4.1/package.json create mode 100644 spec/integration/rails_5.2.4.1/public/404.html create mode 100644 spec/integration/rails_5.2.4.1/public/422.html create mode 100644 spec/integration/rails_5.2.4.1/public/500.html create mode 100644 spec/integration/rails_5.2.4.1/public/apple-touch-icon-precomposed.png create mode 100644 spec/integration/rails_5.2.4.1/public/apple-touch-icon.png create mode 100644 spec/integration/rails_5.2.4.1/public/favicon.ico create mode 100644 spec/integration/rails_5.2.4.1/public/robots.txt create mode 100644 spec/integration/rails_5.2.4.1/storage/.keep create mode 100644 spec/integration/rails_5.2.4.1/test/application_system_test_case.rb create mode 100644 spec/integration/rails_5.2.4.1/test/controllers/.keep create mode 100644 spec/integration/rails_5.2.4.1/test/fixtures/.keep create mode 100644 spec/integration/rails_5.2.4.1/test/fixtures/files/.keep create mode 100644 spec/integration/rails_5.2.4.1/test/fixtures/tasks.yml create mode 100644 spec/integration/rails_5.2.4.1/test/helpers/.keep create mode 100644 spec/integration/rails_5.2.4.1/test/integration/.keep create mode 100644 spec/integration/rails_5.2.4.1/test/mailers/.keep create mode 100644 spec/integration/rails_5.2.4.1/test/models/.keep create mode 100644 spec/integration/rails_5.2.4.1/test/models/task_test.rb create mode 100644 spec/integration/rails_5.2.4.1/test/system/.keep create mode 100644 spec/integration/rails_5.2.4.1/test/test_helper.rb create mode 100644 spec/integration/rails_5.2.4.1/tmp/.keep create mode 100644 spec/integration/rails_5.2.4.1/vendor/.keep create mode 100644 spec/integration/rails_5.2.4.1_spec.rb create mode 100644 spec/integration/rails_6.0.2.1/.gitignore create mode 100644 spec/integration/rails_6.0.2.1/.keep create mode 100644 spec/integration/rails_6.0.2.1/.rubocop.yml create mode 100644 spec/integration/rails_6.0.2.1/.rubocop_todo.yml create mode 100644 spec/integration/rails_6.0.2.1/Gemfile create mode 100644 spec/integration/rails_6.0.2.1/Gemfile.lock create mode 100644 spec/integration/rails_6.0.2.1/README.md create mode 100644 spec/integration/rails_6.0.2.1/Rakefile create mode 100644 spec/integration/rails_6.0.2.1/app/assets/config/manifest.js create mode 100644 spec/integration/rails_6.0.2.1/app/assets/images/.keep create mode 100644 spec/integration/rails_6.0.2.1/app/assets/stylesheets/application.css create mode 100644 spec/integration/rails_6.0.2.1/app/channels/application_cable/channel.rb create mode 100644 spec/integration/rails_6.0.2.1/app/channels/application_cable/connection.rb create mode 100644 spec/integration/rails_6.0.2.1/app/controllers/application_controller.rb create mode 100644 spec/integration/rails_6.0.2.1/app/controllers/concerns/.keep create mode 100644 spec/integration/rails_6.0.2.1/app/helpers/application_helper.rb create mode 100644 spec/integration/rails_6.0.2.1/app/jobs/application_job.rb create mode 100644 spec/integration/rails_6.0.2.1/app/mailers/application_mailer.rb create mode 100644 spec/integration/rails_6.0.2.1/app/models/application_record.rb create mode 100644 spec/integration/rails_6.0.2.1/app/models/concerns/.keep create mode 100644 spec/integration/rails_6.0.2.1/app/models/task.rb create mode 100644 spec/integration/rails_6.0.2.1/app/views/layouts/application.html.erb create mode 100644 spec/integration/rails_6.0.2.1/app/views/layouts/mailer.html.erb create mode 100644 spec/integration/rails_6.0.2.1/app/views/layouts/mailer.text.erb create mode 100755 spec/integration/rails_6.0.2.1/bin/bundle create mode 100755 spec/integration/rails_6.0.2.1/bin/rails create mode 100755 spec/integration/rails_6.0.2.1/bin/rake create mode 100755 spec/integration/rails_6.0.2.1/bin/setup create mode 100644 spec/integration/rails_6.0.2.1/config.ru create mode 100644 spec/integration/rails_6.0.2.1/config/application.rb create mode 100644 spec/integration/rails_6.0.2.1/config/boot.rb create mode 100644 spec/integration/rails_6.0.2.1/config/cable.yml create mode 100644 spec/integration/rails_6.0.2.1/config/credentials.yml.enc create mode 100644 spec/integration/rails_6.0.2.1/config/database.yml create mode 100644 spec/integration/rails_6.0.2.1/config/environment.rb create mode 100644 spec/integration/rails_6.0.2.1/config/environments/development.rb create mode 100644 spec/integration/rails_6.0.2.1/config/environments/production.rb create mode 100644 spec/integration/rails_6.0.2.1/config/environments/test.rb create mode 100644 spec/integration/rails_6.0.2.1/config/initializers/application_controller_renderer.rb create mode 100644 spec/integration/rails_6.0.2.1/config/initializers/backtrace_silencers.rb create mode 100644 spec/integration/rails_6.0.2.1/config/initializers/content_security_policy.rb create mode 100644 spec/integration/rails_6.0.2.1/config/initializers/cookies_serializer.rb create mode 100644 spec/integration/rails_6.0.2.1/config/initializers/filter_parameter_logging.rb create mode 100644 spec/integration/rails_6.0.2.1/config/initializers/inflections.rb create mode 100644 spec/integration/rails_6.0.2.1/config/initializers/mime_types.rb create mode 100644 spec/integration/rails_6.0.2.1/config/initializers/wrap_parameters.rb create mode 100644 spec/integration/rails_6.0.2.1/config/locales/en.yml create mode 100644 spec/integration/rails_6.0.2.1/config/puma.rb create mode 100644 spec/integration/rails_6.0.2.1/config/routes.rb create mode 100644 spec/integration/rails_6.0.2.1/config/storage.yml create mode 100644 spec/integration/rails_6.0.2.1/db/migrate/20200201204456_create_tasks.rb create mode 100644 spec/integration/rails_6.0.2.1/db/schema.rb create mode 100644 spec/integration/rails_6.0.2.1/db/seeds.rb create mode 100644 spec/integration/rails_6.0.2.1/lib/assets/.keep create mode 100644 spec/integration/rails_6.0.2.1/lib/tasks/.keep create mode 100644 spec/integration/rails_6.0.2.1/log/.keep create mode 100644 spec/integration/rails_6.0.2.1/public/404.html create mode 100644 spec/integration/rails_6.0.2.1/public/422.html create mode 100644 spec/integration/rails_6.0.2.1/public/500.html create mode 100644 spec/integration/rails_6.0.2.1/public/apple-touch-icon-precomposed.png create mode 100644 spec/integration/rails_6.0.2.1/public/apple-touch-icon.png create mode 100644 spec/integration/rails_6.0.2.1/public/favicon.ico create mode 100644 spec/integration/rails_6.0.2.1/public/robots.txt create mode 100644 spec/integration/rails_6.0.2.1/storage/.keep create mode 100644 spec/integration/rails_6.0.2.1/test/application_system_test_case.rb create mode 100644 spec/integration/rails_6.0.2.1/test/channels/application_cable/connection_test.rb create mode 100644 spec/integration/rails_6.0.2.1/test/controllers/.keep create mode 100644 spec/integration/rails_6.0.2.1/test/fixtures/.keep create mode 100644 spec/integration/rails_6.0.2.1/test/fixtures/files/.keep create mode 100644 spec/integration/rails_6.0.2.1/test/fixtures/tasks.yml create mode 100644 spec/integration/rails_6.0.2.1/test/helpers/.keep create mode 100644 spec/integration/rails_6.0.2.1/test/integration/.keep create mode 100644 spec/integration/rails_6.0.2.1/test/mailers/.keep create mode 100644 spec/integration/rails_6.0.2.1/test/models/.keep create mode 100644 spec/integration/rails_6.0.2.1/test/models/task_test.rb create mode 100644 spec/integration/rails_6.0.2.1/test/system/.keep create mode 100644 spec/integration/rails_6.0.2.1/test/test_helper.rb create mode 100644 spec/integration/rails_6.0.2.1/tmp/.keep create mode 100644 spec/integration/rails_6.0.2.1/vendor/.keep create mode 100644 spec/integration/rails_6.0.2.1_spec.rb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e834132c..27c292d3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ jobs: test: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: ruby: ['2.4.x', '2.5.x', '2.6.x'] @@ -24,11 +25,20 @@ jobs: with: ruby-version: ${{ matrix.ruby }} - - name: Bundle + - name: Install sqlite run: | - gem update --system - gem update bundler - bundle install --jobs 4 --retry 3 + sudo apt-get install libsqlite3-dev - - name: Test - run: bundle exec rubocop && bundle exec rspec + - name: Update System + run: | + gem update --system --no-document + + - name: Bundle install for Annotate models + run: | + bundle install --jobs=4 --retry=3 + + - name: Run Tests + run: bundle exec rspec + + - name: Rubocop + run: bundle exec rubocop diff --git a/.gitignore b/.gitignore index c2e56f804..bd5cc0e0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -!/spec/integration/*/log/.gitkeep -!/spec/integration/*/tmp/.gitkeep *.gem .DS_Store .bundle @@ -16,8 +14,4 @@ /doc/* /pkg/* /spec/debug.log -/spec/integration/*/bin/ -/spec/integration/*/db/test.* -/spec/integration/*/log/* -/spec/integration/*/tmp/* .byebug_history diff --git a/.rubocop.yml b/.rubocop.yml index c85567c07..0ee94770e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,6 +6,7 @@ AllCops: - 'vendor/**/*' - 'spec/fixtures/**/*' - 'tmp/**/*' + - 'spec/integration/**/*' Metrics/BlockLength: Exclude: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5c0697b68..cdda12a3c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,35 +1,11 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2019-12-24 20:33:53 -0800 using RuboCop version 0.68.1. +# on 2020-02-05 17:13:49 -1000 using RuboCop version 0.68.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 9 -# Configuration parameters: Include. -# Include: **/*.gemfile, **/Gemfile, **/gems.rb -Bundler/DuplicatedGem: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/Gemfile' - - 'spec/integration/rails_3.2.2/Gemfile' - - 'spec/integration/rails_3.2.8/Gemfile' - - 'spec/integration/rails_3.2_autoloading_factory_girl/Gemfile' - - 'spec/integration/rails_3.2_custom_inflections/Gemfile' - - 'spec/integration/rails_3.2_with_asset_pipeline/Gemfile' - - 'spec/integration/rails_4.1.1/Gemfile' - - 'spec/integration/rails_4.2.0/Gemfile' - - 'spec/integration/standalone/Gemfile' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: TreatCommentsAsGroupSeparators, Include. -# Include: **/*.gemfile, **/Gemfile, **/gems.rb -Bundler/OrderedGems: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/Gemfile' - - 'spec/integration/rails_3.2_with_asset_pipeline/Gemfile' - # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: TreatCommentsAsGroupSeparators, Include. @@ -45,13 +21,7 @@ Gemspec/RequiredRubyVersion: Exclude: - 'annotate.gemspec' -# Offense count: 2 -# Cop supports --auto-correct. -Layout/AlignArray: - Exclude: - - 'spec/lib/annotate/annotate_models_spec.rb' - -# Offense count: 111 +# Offense count: 65 # Cop supports --auto-correct. # Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. # SupportedHashRocketStyles: key, separator, table @@ -60,10 +30,6 @@ Layout/AlignArray: Layout/AlignHash: Exclude: - 'lib/generators/annotate/templates/auto_annotate_models.rake' - - 'spec/integration/rails_2.3_with_bundler/config/initializers/unified_initializer.rb' - - 'spec/integration/rails_4.1.1/lib/tasks/auto_annotate_models.rake' - - 'spec/integration/rails_4.2.0/lib/tasks/auto_annotate_models.rake' - - 'spec/integration/standalone/config/init.rb' - 'spec/lib/annotate/annotate_models_spec.rb' # Offense count: 1 @@ -74,80 +40,22 @@ Layout/BlockAlignment: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 47 -# Cop supports --auto-correct. -Layout/ClosingHeredocIndentation: - Exclude: - - 'spec/integration/rails_2.3_with_bundler.rb' - - 'spec/integration/rails_3.2.2.rb' - - 'spec/integration/rails_3.2.8.rb' - - 'spec/integration/rails_3.2_autoloading_factory_girl.rb' - - 'spec/integration/rails_3.2_custom_inflections.rb' - - 'spec/integration/rails_3.2_with_asset_pipeline.rb' - - 'spec/integration/standalone.rb' - - 'spec/lib/annotate/annotate_models_spec.rb' - -# Offense count: 14 +# Offense count: 9 # Cop supports --auto-correct. Layout/EmptyLineAfterGuardClause: Exclude: - 'Rakefile' - 'lib/annotate.rb' - 'lib/annotate/annotate_models.rb' - - 'lib/annotate/annotate_routes.rb' - - 'spec/integration/integration_spec.rb' -# Offense count: 10 +# Offense count: 2 # Cop supports --auto-correct. Layout/EmptyLineAfterMagicComment: Exclude: - 'annotate.gemspec' - - 'spec/integration/rails_3.2.2/db/schema.rb' - - 'spec/integration/rails_3.2.8/db/schema.rb' - - 'spec/integration/rails_3.2_autoloading_factory_girl/db/schema.rb' - - 'spec/integration/rails_3.2_custom_inflections/db/schema.rb' - - 'spec/integration/rails_3.2_with_asset_pipeline/db/schema.rb' - - 'spec/integration/rails_4.1.1/db/schema.rb' - - 'spec/integration/rails_4.2.0/db/schema.rb' - - 'spec/integration/standalone/db/schema.rb' - 'spec/lib/annotate/annotate_models_spec.rb' -# Offense count: 2 -# Cop supports --auto-correct. -Layout/EmptyLines: - Exclude: - - 'spec/integration/rails_4.1.1/Gemfile' - - 'spec/integration/rails_4.2.0/Gemfile' - -# Offense count: 1 -# Cop supports --auto-correct. -Layout/EmptyLinesAroundAccessModifier: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Layout/EmptyLinesAroundArguments: - Exclude: - - 'spec/lib/annotate/annotate_routes_spec.rb' - -# Offense count: 6 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: empty_lines, no_empty_lines -Layout/EmptyLinesAroundBlockBody: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/db/schema.rb' - - 'spec/integration/rails_4.1.1/db/schema.rb' - - 'spec/integration/rails_4.2.0/db/schema.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Layout/EmptyLinesAroundExceptionHandlingKeywords: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - -# Offense count: 24 +# Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. Layout/ExtraSpacing: @@ -155,58 +63,6 @@ Layout/ExtraSpacing: - 'Guardfile' - 'lib/annotate/annotate_models.rb' - 'lib/tasks/annotate_routes.rake' - - 'spec/integration/rails_2.3_with_bundler/script/console' - - 'spec/integration/rails_3.2.2/script/rails' - - 'spec/integration/rails_3.2.8/script/rails' - - 'spec/integration/rails_3.2_autoloading_factory_girl/script/rails' - - 'spec/integration/rails_3.2_custom_inflections/script/rails' - - 'spec/integration/rails_3.2_with_asset_pipeline/script/rails' - - 'spec/integration/rails_4.1.1/Gemfile' - - 'spec/integration/rails_4.1.1/config.ru' - - 'spec/integration/rails_4.2.0/Gemfile' - - 'spec/integration/rails_4.2.0/config.ru' - -# Offense count: 6 -# Cop supports --auto-correct. -# Configuration parameters: IndentationWidth. -# SupportedStyles: special_inside_parentheses, consistent, align_braces -Layout/IndentFirstHashElement: - EnforcedStyle: consistent - -# Offense count: 55 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent -Layout/IndentHeredoc: - Exclude: - - 'spec/integration/integration_spec.rb' - - 'spec/integration/rails_2.3_with_bundler.rb' - - 'spec/integration/rails_3.2.2.rb' - - 'spec/integration/rails_3.2.8.rb' - - 'spec/integration/rails_3.2_autoloading_factory_girl.rb' - - 'spec/integration/rails_3.2_custom_inflections.rb' - - 'spec/integration/rails_3.2_with_asset_pipeline.rb' - - 'spec/integration/standalone.rb' - - 'spec/lib/annotate/annotate_models_spec.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: normal, rails -Layout/IndentationConsistency: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - -# Offense count: 5 -# Cop supports --auto-correct. -# Configuration parameters: Width, IgnoredPatterns. -Layout/IndentationWidth: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - - 'spec/integration/rails_4.1.1/app/models/sub1/sub2/sub3/event.rb' - - 'spec/integration/rails_4.1.1/app/models/task.rb' - - 'spec/integration/rails_4.2.0/app/models/sub1/sub2/sub3/event.rb' - - 'spec/integration/rails_4.2.0/app/models/task.rb' # Offense count: 4 # Cop supports --auto-correct. @@ -224,30 +80,15 @@ Layout/MultilineOperationIndentation: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 3 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: space, no_space Layout/SpaceAroundEqualsInParameterDefault: Exclude: - 'lib/annotate/annotate_routes.rb' - - 'spec/integration/common_validation.rb' - -# Offense count: 9 -# Cop supports --auto-correct. -Layout/SpaceAroundKeyword: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/Gemfile' - - 'spec/integration/rails_3.2.2/Gemfile' - - 'spec/integration/rails_3.2.8/Gemfile' - - 'spec/integration/rails_3.2_autoloading_factory_girl/Gemfile' - - 'spec/integration/rails_3.2_custom_inflections/Gemfile' - - 'spec/integration/rails_3.2_with_asset_pipeline/Gemfile' - - 'spec/integration/rails_4.1.1/Gemfile' - - 'spec/integration/rails_4.2.0/Gemfile' - - 'spec/integration/standalone/Gemfile' -# Offense count: 5 +# Offense count: 6 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment. Layout/SpaceAroundOperators: @@ -270,15 +111,6 @@ Layout/SpaceBeforeComment: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. -# SupportedStyles: space, no_space, compact -# SupportedStylesForEmptyBrackets: space, no_space -Layout/SpaceInsideArrayLiteralBrackets: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/config/environment.rb' - # Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. @@ -313,57 +145,18 @@ Layout/SpaceInsideStringInterpolation: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 6 -# Cop supports --auto-correct. -# Configuration parameters: IndentationWidth. -Layout/Tab: - Exclude: - - 'spec/integration/rails_4.1.1/app/models/sub1/sub2/sub3/event.rb' - - 'spec/integration/rails_4.1.1/app/models/task.rb' - - 'spec/integration/rails_4.2.0/app/models/sub1/sub2/sub3/event.rb' - - 'spec/integration/rails_4.2.0/app/models/task.rb' - -# Offense count: 4 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: final_newline, final_blank_line -Layout/TrailingBlankLines: - Exclude: - - 'spec/integration/rails_4.1.1/app/models/task_observer.rb' - - 'spec/integration/rails_4.1.1/config/initializers/cookies_serializer.rb' - - 'spec/integration/rails_4.2.0/app/models/task_observer.rb' - - 'spec/integration/rails_4.2.0/config/initializers/cookies_serializer.rb' - -# Offense count: 3 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: AllowInHeredoc. Layout/TrailingWhitespace: Exclude: - - 'spec/integration/rails_2.3_with_bundler/db/schema.rb' - 'spec/lib/annotate/annotate_routes_spec.rb' -# Offense count: 3 +# Offense count: 2 # Configuration parameters: AllowSafeAssignment. Lint/AssignmentInCondition: Exclude: - 'lib/annotate/annotate_models.rb' - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - -# Offense count: 6 -# Cop supports --auto-correct. -Lint/DeprecatedClassMethods: - Exclude: - - 'lib/annotate/annotate_routes.rb' - - 'spec/integration/rails_3.2.2/config/boot.rb' - - 'spec/integration/rails_3.2.8/config/boot.rb' - - 'spec/integration/rails_3.2_autoloading_factory_girl/config/boot.rb' - - 'spec/integration/rails_3.2_custom_inflections/config/boot.rb' - - 'spec/integration/rails_3.2_with_asset_pipeline/config/boot.rb' - -# Offense count: 1 -Lint/DuplicateMethods: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' # Offense count: 1 Lint/HandleExceptions: @@ -378,11 +171,10 @@ Lint/InheritException: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 3 +# Offense count: 2 # Configuration parameters: MaximumRangeSize. Lint/MissingCopEnableDirective: Exclude: - - 'lib/annotate.rb' - 'lib/annotate/annotate_models.rb' - 'lib/annotate/annotate_routes.rb' @@ -391,55 +183,45 @@ Lint/RescueException: Exclude: - 'Rakefile' -# Offense count: 5 -# Cop supports --auto-correct. -Lint/ScriptPermission: - Exclude: - - 'spec/integration/rails_3.2.2/Rakefile' - - 'spec/integration/rails_3.2.8/Rakefile' - - 'spec/integration/rails_3.2_autoloading_factory_girl/Rakefile' - - 'spec/integration/rails_3.2_custom_inflections/Rakefile' - - 'spec/integration/rails_3.2_with_asset_pipeline/Rakefile' - # Offense count: 1 Lint/ShadowingOuterLocalVariable: Exclude: - 'Rakefile' -# Offense count: 20 +# Offense count: 21 Metrics/AbcSize: - Max: 155 + Max: 145 -# Offense count: 31 +# Offense count: 8 # Configuration parameters: CountComments, ExcludedMethods. # ExcludedMethods: refine Metrics/BlockLength: - Max: 268 + Max: 53 # Offense count: 1 # Configuration parameters: CountBlocks. Metrics/BlockNesting: Max: 4 -# Offense count: 10 +# Offense count: 11 Metrics/CyclomaticComplexity: - Max: 41 + Max: 37 -# Offense count: 30 +# Offense count: 29 # Configuration parameters: CountComments, ExcludedMethods. Metrics/MethodLength: - Max: 80 + Max: 71 # Offense count: 8 Metrics/PerceivedComplexity: - Max: 47 + Max: 42 # Offense count: 1 Naming/AccessorMethodName: Exclude: - 'lib/annotate.rb' -# Offense count: 79 +# Offense count: 82 # Configuration parameters: Blacklist. # Blacklist: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$)) Naming/HeredocDelimiterNaming: @@ -447,13 +229,12 @@ Naming/HeredocDelimiterNaming: - 'spec/lib/annotate/annotate_models_spec.rb' - 'spec/lib/annotate/annotate_routes_spec.rb' -# Offense count: 2 +# Offense count: 1 # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: Exclude: - 'lib/annotate/annotate_routes.rb' - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' # Offense count: 1 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. @@ -469,49 +250,18 @@ Style/AccessModifierDeclarations: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: percent_q, bare_percent -Style/BarePercentLiterals: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: braces, no_braces, context_dependent -Style/BracesAroundHashParameters: - Exclude: - - 'spec/integration/rails_4.1.1/lib/tasks/auto_annotate_models.rake' - - 'spec/integration/rails_4.2.0/lib/tasks/auto_annotate_models.rake' - - 'spec/integration/standalone/config/init.rb' - # Offense count: 1 Style/CaseEquality: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 14 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: Exclude: - 'lib/annotate/active_record_patch.rb' - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - - 'spec/integration/rails_2.3_with_bundler/test/test_helper.rb' - - 'spec/integration/rails_3.2.2/test/test_helper.rb' - - 'spec/integration/rails_3.2.8/test/test_helper.rb' - - 'spec/integration/rails_3.2_autoloading_factory_girl/test/test_helper.rb' - - 'spec/integration/rails_3.2_custom_inflections/test/test_helper.rb' - - 'spec/integration/rails_3.2_with_asset_pipeline/test/test_helper.rb' - - 'spec/integration/rails_4.1.1/app/models/sub1/sub2/sub3/event.rb' - - 'spec/integration/rails_4.1.1/app/models/sub1/user.rb' - - 'spec/integration/rails_4.1.1/test/test_helper.rb' - - 'spec/integration/rails_4.2.0/app/models/sub1/sub2/sub3/event.rb' - - 'spec/integration/rails_4.2.0/app/models/sub1/user.rb' - - 'spec/integration/rails_4.2.0/test/test_helper.rb' # Offense count: 2 Style/ClassVars: @@ -536,25 +286,18 @@ Style/Documentation: - 'lib/generators/annotate/install_generator.rb' - 'lib/tasks/annotate_models_migrate.rake' -# Offense count: 10 +# Offense count: 2 # Cop supports --auto-correct. Style/Encoding: Exclude: - 'annotate.gemspec' - - 'spec/integration/rails_3.2.2/db/schema.rb' - - 'spec/integration/rails_3.2.8/db/schema.rb' - - 'spec/integration/rails_3.2_autoloading_factory_girl/db/schema.rb' - - 'spec/integration/rails_3.2_custom_inflections/db/schema.rb' - - 'spec/integration/rails_3.2_with_asset_pipeline/db/schema.rb' - - 'spec/integration/rails_4.1.1/db/schema.rb' - - 'spec/integration/rails_4.2.0/db/schema.rb' - - 'spec/integration/standalone/db/schema.rb' - 'spec/lib/annotate/annotate_models_spec.rb' -# Offense count: 48 +# Offense count: 1 # Cop supports --auto-correct. Style/ExpandPathArguments: - Enabled: false + Exclude: + - 'annotate.gemspec' # Offense count: 10 # Cop supports --auto-correct. @@ -572,29 +315,29 @@ Style/FormatStringToken: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 189 +# Offense count: 26 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: when_needed, always, never Style/FrozenStringLiteralComment: Enabled: false -# Offense count: 5 +# Offense count: 1 # Configuration parameters: MinBodyLength. Style/GuardClause: Exclude: - - 'lib/annotate/annotate_routes.rb' - 'lib/tasks/annotate_models_migrate.rake' - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' -# Offense count: 57 +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys Style/HashSyntax: - Enabled: false + Exclude: + - 'lib/tasks/annotate_routes.rake' + - 'spec/lib/annotate/annotate_models_spec.rb' -# Offense count: 11 +# Offense count: 8 # Cop supports --auto-correct. Style/IfUnlessModifier: Exclude: @@ -620,28 +363,16 @@ Style/MissingRespondToMissing: Exclude: - 'lib/annotate/active_record_patch.rb' -# Offense count: 3 +# Offense count: 1 Style/MixinUsage: Exclude: - 'Rakefile' - - 'spec/integration/integration_spec.rb' -# Offense count: 3 +# Offense count: 2 Style/MultilineBlockChain: Exclude: - 'Rakefile' - 'lib/annotate/annotate_models.rb' - - 'spec/spec_helper.rb' - -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: literals, strict -Style/MutableConstant: - Exclude: - - 'lib/annotate/annotate_routes.rb' - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' - - 'spec/integration/rails_2.3_with_bundler/config/environment.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -651,12 +382,6 @@ Style/NestedParenthesizedCalls: Exclude: - 'bin/annotate' -# Offense count: 9 -# Cop supports --auto-correct. -# Configuration parameters: Strict. -Style/NumericLiterals: - MinDigits: 15 - # Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. @@ -667,7 +392,7 @@ Style/NumericPredicate: - 'lib/annotate.rb' - 'lib/annotate/annotate_models.rb' -# Offense count: 20 +# Offense count: 12 # Cop supports --auto-correct. # Configuration parameters: PreferredDelimiters. Style/PercentLiteralDelimiters: @@ -676,22 +401,8 @@ Style/PercentLiteralDelimiters: - 'lib/annotate/annotate_models.rb' - 'lib/annotate/annotate_routes.rb' - 'lib/tasks/annotate_models_migrate.rake' - - 'spec/integration/rails_3.2.2/config/application.rb' - - 'spec/integration/rails_3.2.8/config/application.rb' - - 'spec/integration/rails_3.2_autoloading_factory_girl/config/application.rb' - - 'spec/integration/rails_3.2_custom_inflections/config/application.rb' - - 'spec/integration/rails_3.2_with_asset_pipeline/config/application.rb' - - 'spec/integration/rails_4.1.1/app/models/task.rb' - - 'spec/integration/rails_4.2.0/app/models/task.rb' - 'spec/lib/annotate/annotate_models_spec.rb' - 'spec/lib/tasks/annotate_models_migrate_spec.rb' - - 'spec/spec_helper.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -Style/PerlBackrefs: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -737,12 +448,11 @@ Style/RegexpLiteral: - 'lib/annotate/annotate_models.rb' - 'lib/annotate/annotate_routes.rb' -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. Style/RescueModifier: Exclude: - 'lib/annotate/annotate_models.rb' - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -760,28 +470,28 @@ Style/SafeNavigation: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: AllowAsExpressionSeparator. -Style/Semicolon: - Exclude: - - 'spec/integration/rails_2.3_with_bundler/config/initializers/unified_initializer.rb' - -# Offense count: 18 +# Offense count: 15 # Cop supports --auto-correct. Style/StderrPuts: Exclude: - 'Rakefile' - 'lib/annotate.rb' - 'lib/annotate/annotate_models.rb' - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' -# Offense count: 249 +# Offense count: 111 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. # SupportedStyles: single_quotes, double_quotes Style/StringLiterals: - Enabled: false + Exclude: + - 'annotate.gemspec' + - 'lib/annotate/annotate_models.rb' + - 'lib/annotate/parser.rb' + - 'lib/tasks/annotate_models_migrate.rake' + - 'lib/tasks/annotate_routes.rake' + - 'spec/lib/annotate/annotate_models_spec.rb' + - 'spec/lib/annotate/annotate_routes_spec.rb' + - 'spec/lib/annotate/parser_spec.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -791,7 +501,7 @@ Style/StringLiteralsInInterpolation: Exclude: - 'lib/annotate/annotate_models.rb' -# Offense count: 10 +# Offense count: 8 # Cop supports --auto-correct. # Configuration parameters: MinSize. # SupportedStyles: percent, brackets @@ -804,7 +514,7 @@ Style/SymbolLiteral: Exclude: - 'spec/lib/annotate/annotate_models_spec.rb' -# Offense count: 1 +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyleForMultiline. # SupportedStylesForMultiline: comma, consistent_comma, no_comma @@ -814,23 +524,13 @@ Style/TrailingCommaInArrayLiteral: # Offense count: 2 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInHashLiteral: - Exclude: - - 'spec/integration/rails_4.1.1/lib/tasks/auto_annotate_models.rake' - - 'spec/integration/rails_4.2.0/lib/tasks/auto_annotate_models.rake' - -# Offense count: 4 -# Cop supports --auto-correct. Style/UnneededPercentQ: Exclude: - 'annotate.gemspec' - - 'spec/integration/rails_2.3_with_bundler/config/boot.rb' -# Offense count: 477 +# Offense count: 353 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: - Max: 276 + Max: 264 diff --git a/.travis.yml b/.travis.yml index 1d2e4a5ce..0f536f13f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,37 @@ -sudo: false language: ruby rvm: -- 2.4.9 -- 2.5.7 -- 2.6.5 -- ruby-head + - 2.4.9 + - 2.5.7 + - 2.6.5 + - ruby-head + +env: + - RAILS_ENV=development RACK_ENV=development matrix: allow_failures: - - rvm: ruby-head + - rvm: ruby-head + +addons: + apt_packages: + - libsqlite3-dev before_install: -- yes | gem update --system -- gem update bundler + - gem update --system --no-document --quiet + +install: + - bundle install --jobs=3 --retry=3 script: -- bundle exec rubocop && bundle exec rspec + - bundle exec rspec + - bundle exec rubocop jobs: include: - stage: gem release if: tag =~ ^v rvm: 2.6.0 - script: echo "Deploying to rubygems.org ..." + script: echo "Deploying to rubygems.org ..." deploy: provider: rubygems api_key: $RUBYGEMS_API_KEY diff --git a/Gemfile b/Gemfile index cd3dae1be..8e5150059 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' ruby '>= 2.2.0' -gem 'activerecord', '>= 4.2.5', require: false +gem 'activerecord', '>= 4.2.5', '< 6', require: false gem 'rake', require: false group :development do @@ -31,11 +31,12 @@ group :development, :test do platforms :mri, :mingw do gem 'pry', require: false - gem 'pry-coolline', require: false + gem 'pry-byebug', require: false end end group :test do gem 'files', require: false + gem 'git', require: false gem 'wrong', require: false end diff --git a/spec/integration/integration_helper.rb b/spec/integration/integration_helper.rb new file mode 100644 index 000000000..b0c2094ee --- /dev/null +++ b/spec/integration/integration_helper.rb @@ -0,0 +1,25 @@ +class IntegrationHelper + MIN_RUBY_VERSIONS = { + 'rails_5.2.4.1' => '>= 2.2.2', + 'rails_6.0.2.1' => '>= 2.5.0' + }.freeze + + def self.able_to_run?(file_path, ruby_version) + file_name = File.basename(file_path) + rails_app = File.basename(file_name, '_spec.rb') + ruby_dependency = MIN_RUBY_VERSIONS[rails_app] + + required_version = Gem::Dependency.new('', ruby_dependency) + able_to_run = required_version.match?('', ruby_version) + + unless able_to_run + output = "\n" \ + "Skipping running the integration test for #{file_name}.\n" \ + "The current version of Ruby is #{ruby_version}, " \ + "but the integration test requires Ruby #{ruby_dependency}." + puts output + end + + able_to_run + end +end diff --git a/spec/integration/rails_5.2.4.1/.gitignore b/spec/integration/rails_5.2.4.1/.gitignore new file mode 100644 index 000000000..81452db92 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/.gitignore @@ -0,0 +1,31 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore uploaded files in development +/storage/* +!/storage/.keep + +/node_modules +/yarn-error.log + +/public/assets +.byebug_history + +# Ignore master key for decrypting credentials and more. +/config/master.key diff --git a/spec/integration/rails_5.2.4.1/Gemfile b/spec/integration/rails_5.2.4.1/Gemfile new file mode 100644 index 000000000..261d6dd6f --- /dev/null +++ b/spec/integration/rails_5.2.4.1/Gemfile @@ -0,0 +1,59 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.2.4', '>= 5.2.4.1' +# Use sqlite3 as the database for Active Record +gem 'sqlite3' +# Use Puma as the app server +gem 'puma', '~> 3.11' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3.0' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'mini_racer', platforms: :ruby + +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.2' +# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks +gem 'turbolinks', '~> 5' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.5' +# Use Redis adapter to run Action Cable in production +# gem 'redis', '~> 4.0' +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use ActiveStorage variant +# gem 'mini_magick', '~> 4.8' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +# Reduces boot times through caching; required in config/boot.rb +gem 'bootsnap', '>= 1.1.0', require: false + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] +end + +group :development do + gem 'annotate', path: '../../..' + + # Access an interactive console on exception pages or by calling 'console' anywhere in the code. + gem 'web-console', '>= 3.3.0' + gem 'listen', '>= 3.0.5', '< 3.2' +end + +group :test do + # Adds support for Capybara system testing and selenium driver + gem 'capybara', '>= 2.15' + gem 'selenium-webdriver' + # Easy installation and use of chromedriver to run system tests with Chrome + gem 'chromedriver-helper' +end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/spec/integration/rails_5.2.4.1/Gemfile.lock b/spec/integration/rails_5.2.4.1/Gemfile.lock new file mode 100644 index 000000000..8f3558fa0 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/Gemfile.lock @@ -0,0 +1,215 @@ +PATH + remote: ../../.. + specs: + annotate (3.0.3) + activerecord (>= 3.2, < 7.0) + rake (>= 10.4, < 14.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (5.2.4.1) + actionpack (= 5.2.4.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (5.2.4.1) + actionpack (= 5.2.4.1) + actionview (= 5.2.4.1) + activejob (= 5.2.4.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.2.4.1) + actionview (= 5.2.4.1) + activesupport (= 5.2.4.1) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.2.4.1) + activesupport (= 5.2.4.1) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.2.4.1) + activesupport (= 5.2.4.1) + globalid (>= 0.3.6) + activemodel (5.2.4.1) + activesupport (= 5.2.4.1) + activerecord (5.2.4.1) + activemodel (= 5.2.4.1) + activesupport (= 5.2.4.1) + arel (>= 9.0) + activestorage (5.2.4.1) + actionpack (= 5.2.4.1) + activerecord (= 5.2.4.1) + marcel (~> 0.3.1) + activesupport (5.2.4.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + archive-zip (0.12.0) + io-like (~> 0.3.0) + arel (9.0.0) + bindex (0.8.1) + bootsnap (1.4.5) + msgpack (~> 1.0) + builder (3.2.4) + byebug (11.1.1) + capybara (3.31.0) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + childprocess (3.0.0) + chromedriver-helper (2.1.1) + archive-zip (~> 0.10) + nokogiri (~> 1.8) + coffee-rails (4.2.2) + coffee-script (>= 2.2.0) + railties (>= 4.0.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.12.2) + concurrent-ruby (1.1.5) + crass (1.0.6) + erubi (1.9.0) + execjs (2.7.0) + ffi (1.12.2) + globalid (0.4.2) + activesupport (>= 4.2.0) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + io-like (0.3.0) + jbuilder (2.9.1) + activesupport (>= 4.2.0) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + loofah (2.4.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (0.9.2) + mimemagic (0.3.4) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + msgpack (1.3.2) + nio4r (2.5.2) + nokogiri (1.10.7) + mini_portile2 (~> 2.4.0) + public_suffix (4.0.3) + puma (3.12.2) + rack (2.1.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (5.2.4.1) + actioncable (= 5.2.4.1) + actionmailer (= 5.2.4.1) + actionpack (= 5.2.4.1) + actionview (= 5.2.4.1) + activejob (= 5.2.4.1) + activemodel (= 5.2.4.1) + activerecord (= 5.2.4.1) + activestorage (= 5.2.4.1) + activesupport (= 5.2.4.1) + bundler (>= 1.3.0) + railties (= 5.2.4.1) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (5.2.4.1) + actionpack (= 5.2.4.1) + activesupport (= 5.2.4.1) + method_source + rake (>= 0.8.7) + thor (>= 0.19.0, < 2.0) + rake (13.0.1) + rb-fsevent (0.10.3) + rb-inotify (0.10.1) + ffi (~> 1.0) + regexp_parser (1.6.0) + ruby_dep (1.5.0) + rubyzip (2.2.0) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sass-rails (5.1.0) + railties (>= 5.2.0) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + thor (1.0.1) + thread_safe (0.3.6) + tilt (2.0.10) + turbolinks (5.2.1) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) + tzinfo (1.2.6) + thread_safe (~> 0.1) + uglifier (4.2.0) + execjs (>= 0.3.0, < 3) + web-console (3.7.0) + actionview (>= 5.0) + activemodel (>= 5.0) + bindex (>= 0.4.0) + railties (>= 5.0) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + +PLATFORMS + ruby + +DEPENDENCIES + annotate! + bootsnap (>= 1.1.0) + byebug + capybara (>= 2.15) + chromedriver-helper + coffee-rails (~> 4.2) + jbuilder (~> 2.5) + listen (>= 3.0.5, < 3.2) + puma (~> 3.11) + rails (~> 5.2.4, >= 5.2.4.1) + sass-rails (~> 5.0) + selenium-webdriver + sqlite3 + turbolinks (~> 5) + tzinfo-data + uglifier (>= 1.3.0) + web-console (>= 3.3.0) + +BUNDLED WITH + 2.1.2 diff --git a/spec/integration/rails_5.2.4.1/README.md b/spec/integration/rails_5.2.4.1/README.md new file mode 100644 index 000000000..7db80e4ca --- /dev/null +++ b/spec/integration/rails_5.2.4.1/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/spec/integration/rails_5.2.4.1/Rakefile b/spec/integration/rails_5.2.4.1/Rakefile new file mode 100644 index 000000000..e85f91391 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative 'config/application' + +Rails.application.load_tasks diff --git a/spec/integration/rails_5.2.4.1/app/assets/config/manifest.js b/spec/integration/rails_5.2.4.1/app/assets/config/manifest.js new file mode 100644 index 000000000..b16e53d6d --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/assets/config/manifest.js @@ -0,0 +1,3 @@ +//= link_tree ../images +//= link_directory ../javascripts .js +//= link_directory ../stylesheets .css diff --git a/spec/integration/rails_5.2.4.1/app/assets/images/.keep b/spec/integration/rails_5.2.4.1/app/assets/images/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/app/assets/javascripts/application.js b/spec/integration/rails_5.2.4.1/app/assets/javascripts/application.js new file mode 100644 index 000000000..82e6f0f6c --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's +// vendor/assets/javascripts directory can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// compiled file. JavaScript code in this file should be added after the last require_* statement. +// +// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details +// about supported directives. +// +//= require rails-ujs +//= require activestorage +//= require turbolinks +//= require_tree . diff --git a/spec/integration/rails_5.2.4.1/app/assets/javascripts/cable.js b/spec/integration/rails_5.2.4.1/app/assets/javascripts/cable.js new file mode 100644 index 000000000..739aa5f02 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/assets/javascripts/cable.js @@ -0,0 +1,13 @@ +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the `rails generate channel` command. +// +//= require action_cable +//= require_self +//= require_tree ./channels + +(function() { + this.App || (this.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); diff --git a/spec/integration/rails_5.2.4.1/app/assets/javascripts/channels/.keep b/spec/integration/rails_5.2.4.1/app/assets/javascripts/channels/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/app/assets/stylesheets/application.css b/spec/integration/rails_5.2.4.1/app/assets/stylesheets/application.css new file mode 100644 index 000000000..d05ea0f51 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/spec/integration/rails_5.2.4.1/app/channels/application_cable/channel.rb b/spec/integration/rails_5.2.4.1/app/channels/application_cable/channel.rb new file mode 100644 index 000000000..d67269728 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/spec/integration/rails_5.2.4.1/app/channels/application_cable/connection.rb b/spec/integration/rails_5.2.4.1/app/channels/application_cable/connection.rb new file mode 100644 index 000000000..0ff5442f4 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/spec/integration/rails_5.2.4.1/app/controllers/application_controller.rb b/spec/integration/rails_5.2.4.1/app/controllers/application_controller.rb new file mode 100644 index 000000000..09705d12a --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/spec/integration/rails_5.2.4.1/app/controllers/concerns/.keep b/spec/integration/rails_5.2.4.1/app/controllers/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/app/helpers/application_helper.rb b/spec/integration/rails_5.2.4.1/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/spec/integration/rails_5.2.4.1/app/jobs/application_job.rb b/spec/integration/rails_5.2.4.1/app/jobs/application_job.rb new file mode 100644 index 000000000..a009ace51 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/spec/integration/rails_5.2.4.1/app/mailers/application_mailer.rb b/spec/integration/rails_5.2.4.1/app/mailers/application_mailer.rb new file mode 100644 index 000000000..286b2239d --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/spec/integration/rails_5.2.4.1/app/models/application_record.rb b/spec/integration/rails_5.2.4.1/app/models/application_record.rb new file mode 100644 index 000000000..10a4cba84 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/spec/integration/rails_5.2.4.1/app/models/concerns/.keep b/spec/integration/rails_5.2.4.1/app/models/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/app/models/task.rb b/spec/integration/rails_5.2.4.1/app/models/task.rb new file mode 100644 index 000000000..3c2342421 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/models/task.rb @@ -0,0 +1,2 @@ +class Task < ApplicationRecord +end diff --git a/spec/integration/rails_5.2.4.1/app/views/layouts/application.html.erb b/spec/integration/rails_5.2.4.1/app/views/layouts/application.html.erb new file mode 100644 index 000000000..8255d055e --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/views/layouts/application.html.erb @@ -0,0 +1,15 @@ + + + + Rails5241 + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> + + + + <%= yield %> + + diff --git a/spec/integration/rails_5.2.4.1/app/views/layouts/mailer.html.erb b/spec/integration/rails_5.2.4.1/app/views/layouts/mailer.html.erb new file mode 100644 index 000000000..cbd34d2e9 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/spec/integration/rails_5.2.4.1/app/views/layouts/mailer.text.erb b/spec/integration/rails_5.2.4.1/app/views/layouts/mailer.text.erb new file mode 100644 index 000000000..37f0bddbd --- /dev/null +++ b/spec/integration/rails_5.2.4.1/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/spec/integration/rails_5.2.4.1/bin/bundle b/spec/integration/rails_5.2.4.1/bin/bundle new file mode 100755 index 000000000..f19acf5b5 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/bin/bundle @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) +load Gem.bin_path('bundler', 'bundle') diff --git a/spec/integration/rails_5.2.4.1/bin/rails b/spec/integration/rails_5.2.4.1/bin/rails new file mode 100755 index 000000000..073966023 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/spec/integration/rails_5.2.4.1/bin/rake b/spec/integration/rails_5.2.4.1/bin/rake new file mode 100755 index 000000000..17240489f --- /dev/null +++ b/spec/integration/rails_5.2.4.1/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/spec/integration/rails_5.2.4.1/bin/setup b/spec/integration/rails_5.2.4.1/bin/setup new file mode 100755 index 000000000..94fd4d797 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/bin/setup @@ -0,0 +1,36 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + # puts "\n== Copying sample files ==" + # unless File.exist?('config/database.yml') + # cp 'config/database.yml.sample', 'config/database.yml' + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:setup' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/spec/integration/rails_5.2.4.1/bin/update b/spec/integration/rails_5.2.4.1/bin/update new file mode 100755 index 000000000..58bfaed51 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/bin/update @@ -0,0 +1,31 @@ +#!/usr/bin/env ruby +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a way to update your development environment automatically. + # Add necessary update steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # Install JavaScript dependencies if using Yarn + # system('bin/yarn') + + puts "\n== Updating database ==" + system! 'bin/rails db:migrate' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/spec/integration/rails_5.2.4.1/bin/yarn b/spec/integration/rails_5.2.4.1/bin/yarn new file mode 100755 index 000000000..460dd565b --- /dev/null +++ b/spec/integration/rails_5.2.4.1/bin/yarn @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +APP_ROOT = File.expand_path('..', __dir__) +Dir.chdir(APP_ROOT) do + begin + exec "yarnpkg", *ARGV + rescue Errno::ENOENT + $stderr.puts "Yarn executable was not detected in the system." + $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" + exit 1 + end +end diff --git a/spec/integration/rails_5.2.4.1/config.ru b/spec/integration/rails_5.2.4.1/config.ru new file mode 100644 index 000000000..f7ba0b527 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config.ru @@ -0,0 +1,5 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application diff --git a/spec/integration/rails_5.2.4.1/config/application.rb b/spec/integration/rails_5.2.4.1/config/application.rb new file mode 100644 index 000000000..a497104ac --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/application.rb @@ -0,0 +1,19 @@ +require_relative 'boot' + +require 'rails/all' + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Rails5241 + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 5.2 + + # Settings in config/environments/* take precedence over those specified here. + # Application configuration can go into files in config/initializers + # -- all .rb files in that directory are automatically loaded after loading + # the framework and any gems in your application. + end +end diff --git a/spec/integration/rails_5.2.4.1/config/boot.rb b/spec/integration/rails_5.2.4.1/config/boot.rb new file mode 100644 index 000000000..b9e460cef --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/boot.rb @@ -0,0 +1,4 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. +require 'bootsnap/setup' # Speed up boot time by caching expensive operations. diff --git a/spec/integration/rails_5.2.4.1/config/cable.yml b/spec/integration/rails_5.2.4.1/config/cable.yml new file mode 100644 index 000000000..bbe9fb1e2 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: async + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: rails_5_2_4_1_production diff --git a/spec/integration/rails_5.2.4.1/config/credentials.yml.enc b/spec/integration/rails_5.2.4.1/config/credentials.yml.enc new file mode 100644 index 000000000..2ef7ab8c7 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/credentials.yml.enc @@ -0,0 +1 @@ +kaq24JvP21fLJw+1dPA4vJwDDrmXYkK9Z0eGm427byJIzbzyz4/iZOeOaMbmgPus3C1brzeGXrXvH/XObBtrktOftldHzYN9EjYIvip+Z38ep7kv5FhkL2OMlOAJCOkIv0xxyZld6pn6VR6QyJ8GmO/vJh1/k0AMpioQA4QPVi4AZyRxNNlO8UkQ4nidlYBjueoZDTbrKwDUNGwnCfSihDYzWsyNqQfEuvZDjd8UdpPUFDRVkG7TI4EVGfJD2TSmnbm2XCxrfRvSkWL5M7qJavBSJTJ2pUc4sZhmSlVjCBV1nuW+gvl5UC5yABmc2MwnftfwEplXObKdEHIR7y1EQ92KGqsgmoOZTnqEbEbN4jWDI14SS3DDoosu2mROI88R7rWCMjMDmjOlaVELYvzoXYW4hfNBvXvqbb2O--vdG9CDzyXc67QVYu--pSJBykeDMvvx3dUeH5L3ng== \ No newline at end of file diff --git a/spec/integration/rails_5.2.4.1/config/database.yml b/spec/integration/rails_5.2.4.1/config/database.yml new file mode 100644 index 000000000..0d02f2498 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/database.yml @@ -0,0 +1,25 @@ +# SQLite version 3.x +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/spec/integration/rails_5.2.4.1/config/environment.rb b/spec/integration/rails_5.2.4.1/config/environment.rb new file mode 100644 index 000000000..426333bb4 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/spec/integration/rails_5.2.4.1/config/environments/development.rb b/spec/integration/rails_5.2.4.1/config/environments/development.rb new file mode 100644 index 000000000..1311e3e4e --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/environments/development.rb @@ -0,0 +1,61 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join('tmp', 'caching-dev.txt').exist? + config.action_controller.perform_caching = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options) + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + # Debug mode disables concatenation and preprocessing of assets. + # This option may cause significant delays in view rendering with a large + # number of complex assets. + config.assets.debug = true + + # Suppress logger output for asset requests. + config.assets.quiet = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true + + # Use an evented file watcher to asynchronously detect changes in source code, + # routes, locales, etc. This feature depends on the listen gem. + config.file_watcher = ActiveSupport::EventedFileUpdateChecker +end diff --git a/spec/integration/rails_5.2.4.1/config/environments/production.rb b/spec/integration/rails_5.2.4.1/config/environments/production.rb new file mode 100644 index 000000000..431c8ee69 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/environments/production.rb @@ -0,0 +1,94 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Compress JavaScripts and CSS. + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options) + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment) + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "rails_5_2_4_1_#{Rails.env}" + + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false +end diff --git a/spec/integration/rails_5.2.4.1/config/environments/test.rb b/spec/integration/rails_5.2.4.1/config/environments/test.rb new file mode 100644 index 000000000..0a38fd3ce --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/environments/test.rb @@ -0,0 +1,46 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # The test environment is used exclusively to run your application's + # test suite. You never need to work with it otherwise. Remember that + # your test database is "scratch space" for the test suite and is wiped + # and recreated between test runs. Don't rely on the data there! + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory + config.active_storage.service = :test + + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true +end diff --git a/spec/integration/rails_5.2.4.1/config/initializers/application_controller_renderer.rb b/spec/integration/rails_5.2.4.1/config/initializers/application_controller_renderer.rb new file mode 100644 index 000000000..89d2efab2 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/initializers/application_controller_renderer.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# ActiveSupport::Reloader.to_prepare do +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) +# end diff --git a/spec/integration/rails_5.2.4.1/config/initializers/assets.rb b/spec/integration/rails_5.2.4.1/config/initializers/assets.rb new file mode 100644 index 000000000..4b828e80c --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/initializers/assets.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# Version of your assets, change this if you want to expire all your assets. +Rails.application.config.assets.version = '1.0' + +# Add additional assets to the asset load path. +# Rails.application.config.assets.paths << Emoji.images_path +# Add Yarn node_modules folder to the asset load path. +Rails.application.config.assets.paths << Rails.root.join('node_modules') + +# Precompile additional assets. +# application.js, application.css, and all non-JS/CSS in the app/assets +# folder are already added. +# Rails.application.config.assets.precompile += %w( admin.js admin.css ) diff --git a/spec/integration/rails_5.2.4.1/config/initializers/backtrace_silencers.rb b/spec/integration/rails_5.2.4.1/config/initializers/backtrace_silencers.rb new file mode 100644 index 000000000..59385cdf3 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/integration/rails_5.2.4.1/config/initializers/content_security_policy.rb b/spec/integration/rails_5.2.4.1/config/initializers/content_security_policy.rb new file mode 100644 index 000000000..d3bcaa5ec --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/initializers/content_security_policy.rb @@ -0,0 +1,25 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy +# For further information see the following documentation +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy + +# Rails.application.config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https + +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end + +# If you are using UJS then enable automatic nonce generation +# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } + +# Report CSP violations to a specified URI +# For further information see the following documentation: +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only +# Rails.application.config.content_security_policy_report_only = true diff --git a/spec/integration/rails_5.2.4.1/config/initializers/cookies_serializer.rb b/spec/integration/rails_5.2.4.1/config/initializers/cookies_serializer.rb new file mode 100644 index 000000000..5a6a32d37 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/initializers/cookies_serializer.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Specify a serializer for the signed and encrypted cookie jars. +# Valid options are :json, :marshal, and :hybrid. +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/spec/integration/rails_5.2.4.1/config/initializers/filter_parameter_logging.rb b/spec/integration/rails_5.2.4.1/config/initializers/filter_parameter_logging.rb new file mode 100644 index 000000000..4a994e1e7 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/spec/integration/rails_5.2.4.1/config/initializers/inflections.rb b/spec/integration/rails_5.2.4.1/config/initializers/inflections.rb new file mode 100644 index 000000000..ac033bf9d --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/spec/integration/rails_5.2.4.1/config/initializers/mime_types.rb b/spec/integration/rails_5.2.4.1/config/initializers/mime_types.rb new file mode 100644 index 000000000..dc1899682 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/spec/integration/rails_5.2.4.1/config/initializers/wrap_parameters.rb b/spec/integration/rails_5.2.4.1/config/initializers/wrap_parameters.rb new file mode 100644 index 000000000..bbfc3961b --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/spec/integration/rails_5.2.4.1/config/locales/en.yml b/spec/integration/rails_5.2.4.1/config/locales/en.yml new file mode 100644 index 000000000..decc5a857 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# 'true': 'foo' +# +# To learn more, please read the Rails Internationalization guide +# available at http://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/spec/integration/rails_5.2.4.1/config/puma.rb b/spec/integration/rails_5.2.4.1/config/puma.rb new file mode 100644 index 000000000..b2102072b --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/puma.rb @@ -0,0 +1,37 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +threads threads_count, threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked webserver processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. +# +# preload_app! + +# Allow puma to be restarted by `rails restart` command. +plugin :tmp_restart diff --git a/spec/integration/rails_5.2.4.1/config/routes.rb b/spec/integration/rails_5.2.4.1/config/routes.rb new file mode 100644 index 000000000..2a9234a0a --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/routes.rb @@ -0,0 +1,4 @@ +Rails.application.routes.draw do + # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html + resources :tasks +end diff --git a/spec/integration/rails_5.2.4.1/config/spring.rb b/spec/integration/rails_5.2.4.1/config/spring.rb new file mode 100644 index 000000000..9fa7863f9 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/spring.rb @@ -0,0 +1,6 @@ +%w[ + .ruby-version + .rbenv-vars + tmp/restart.txt + tmp/caching-dev.txt +].each { |path| Spring.watch(path) } diff --git a/spec/integration/rails_5.2.4.1/config/storage.yml b/spec/integration/rails_5.2.4.1/config/storage.yml new file mode 100644 index 000000000..d32f76e8f --- /dev/null +++ b/spec/integration/rails_5.2.4.1/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket + +# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/spec/integration/rails_5.2.4.1/db/migrate/20200204052946_create_tasks.rb b/spec/integration/rails_5.2.4.1/db/migrate/20200204052946_create_tasks.rb new file mode 100644 index 000000000..f4b276aa8 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/db/migrate/20200204052946_create_tasks.rb @@ -0,0 +1,11 @@ +class CreateTasks < ActiveRecord::Migration[5.2] + def change + create_table :tasks do |t| + t.string :content + t.integer :count, default: 0 + t.boolean :status, default: false + + t.timestamps + end + end +end diff --git a/spec/integration/rails_5.2.4.1/db/schema.rb b/spec/integration/rails_5.2.4.1/db/schema.rb new file mode 100644 index 000000000..4d585f43c --- /dev/null +++ b/spec/integration/rails_5.2.4.1/db/schema.rb @@ -0,0 +1,23 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 2020_02_04_052946) do + + create_table "tasks", force: :cascade do |t| + t.string "content" + t.integer "count", default: 0 + t.boolean "status", default: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/spec/integration/rails_5.2.4.1/db/seeds.rb b/spec/integration/rails_5.2.4.1/db/seeds.rb new file mode 100644 index 000000000..1beea2acc --- /dev/null +++ b/spec/integration/rails_5.2.4.1/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) +# Character.create(name: 'Luke', movie: movies.first) diff --git a/spec/integration/rails_5.2.4.1/lib/assets/.keep b/spec/integration/rails_5.2.4.1/lib/assets/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/lib/tasks/.keep b/spec/integration/rails_5.2.4.1/lib/tasks/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/log/.keep b/spec/integration/rails_5.2.4.1/log/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/package.json b/spec/integration/rails_5.2.4.1/package.json new file mode 100644 index 000000000..e064671a6 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/package.json @@ -0,0 +1,5 @@ +{ + "name": "rails_5_2_4_1", + "private": true, + "dependencies": {} +} diff --git a/spec/integration/rails_5.2.4.1/public/404.html b/spec/integration/rails_5.2.4.1/public/404.html new file mode 100644 index 000000000..2be3af26f --- /dev/null +++ b/spec/integration/rails_5.2.4.1/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/integration/rails_5.2.4.1/public/422.html b/spec/integration/rails_5.2.4.1/public/422.html new file mode 100644 index 000000000..c08eac0d1 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/integration/rails_5.2.4.1/public/500.html b/spec/integration/rails_5.2.4.1/public/500.html new file mode 100644 index 000000000..78a030af2 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/integration/rails_5.2.4.1/public/apple-touch-icon-precomposed.png b/spec/integration/rails_5.2.4.1/public/apple-touch-icon-precomposed.png new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/public/apple-touch-icon.png b/spec/integration/rails_5.2.4.1/public/apple-touch-icon.png new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/public/favicon.ico b/spec/integration/rails_5.2.4.1/public/favicon.ico new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/public/robots.txt b/spec/integration/rails_5.2.4.1/public/robots.txt new file mode 100644 index 000000000..37b576a4a --- /dev/null +++ b/spec/integration/rails_5.2.4.1/public/robots.txt @@ -0,0 +1 @@ +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/spec/integration/rails_5.2.4.1/storage/.keep b/spec/integration/rails_5.2.4.1/storage/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/test/application_system_test_case.rb b/spec/integration/rails_5.2.4.1/test/application_system_test_case.rb new file mode 100644 index 000000000..d19212abd --- /dev/null +++ b/spec/integration/rails_5.2.4.1/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/spec/integration/rails_5.2.4.1/test/controllers/.keep b/spec/integration/rails_5.2.4.1/test/controllers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/test/fixtures/.keep b/spec/integration/rails_5.2.4.1/test/fixtures/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/test/fixtures/files/.keep b/spec/integration/rails_5.2.4.1/test/fixtures/files/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/test/fixtures/tasks.yml b/spec/integration/rails_5.2.4.1/test/fixtures/tasks.yml new file mode 100644 index 000000000..552ecdf1e --- /dev/null +++ b/spec/integration/rails_5.2.4.1/test/fixtures/tasks.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + content: MyString + count: 1 + status: false + +two: + content: MyString + count: 1 + status: false diff --git a/spec/integration/rails_5.2.4.1/test/helpers/.keep b/spec/integration/rails_5.2.4.1/test/helpers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/test/integration/.keep b/spec/integration/rails_5.2.4.1/test/integration/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/test/mailers/.keep b/spec/integration/rails_5.2.4.1/test/mailers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/test/models/.keep b/spec/integration/rails_5.2.4.1/test/models/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/test/models/task_test.rb b/spec/integration/rails_5.2.4.1/test/models/task_test.rb new file mode 100644 index 000000000..3ca215970 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/test/models/task_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TaskTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/spec/integration/rails_5.2.4.1/test/system/.keep b/spec/integration/rails_5.2.4.1/test/system/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/test/test_helper.rb b/spec/integration/rails_5.2.4.1/test/test_helper.rb new file mode 100644 index 000000000..3ab84e3d1 --- /dev/null +++ b/spec/integration/rails_5.2.4.1/test/test_helper.rb @@ -0,0 +1,10 @@ +ENV['RAILS_ENV'] ||= 'test' +require_relative '../config/environment' +require 'rails/test_help' + +class ActiveSupport::TestCase + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/spec/integration/rails_5.2.4.1/tmp/.keep b/spec/integration/rails_5.2.4.1/tmp/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1/vendor/.keep b/spec/integration/rails_5.2.4.1/vendor/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_5.2.4.1_spec.rb b/spec/integration/rails_5.2.4.1_spec.rb new file mode 100644 index 000000000..6fe8e9ebd --- /dev/null +++ b/spec/integration/rails_5.2.4.1_spec.rb @@ -0,0 +1,155 @@ +require 'bundler' +require 'rspec' +require 'git' +require_relative 'integration_helper' + +describe 'Integration testing on Rails 5.2.4.1', if: IntegrationHelper.able_to_run?(__FILE__, RUBY_VERSION) do + ::RAILS_5_2_APP_NAME = 'rails_5.2.4.1'.freeze + ::RAILS_5_2_PROJECT_PATH = File.expand_path('../..', __dir__).freeze + ::RAILS_5_2_APP_PATH = File.expand_path(RAILS_5_2_APP_NAME, __dir__).freeze + + let!(:git) { Git.open(RAILS_5_2_PROJECT_PATH) } + + before(:all) do + Bundler.with_clean_env do + Dir.chdir RAILS_5_2_APP_PATH do + puts `bundle install` + puts `bin/rails db:migrate` + end + end + end + + after(:each) do + git.reset_hard + end + + describe 'annotate --models' do + let(:command) { 'bundle exec annotate --models' } + + let(:task_model) do + patch = <<~PATCH + +# == Schema Information + +# + +# Table name: tasks + +# + +# id :integer not null, primary key + +# content :string + +# count :integer default("0") + +# status :boolean default("0") + +# created_at :datetime not null + +# updated_at :datetime not null + +# + PATCH + + path = 'app/models/task.rb' + { + path: include(path), + patch: include(patch) + } + end + let(:task_test) do + patch = <<~PATCH + +# == Schema Information + +# + +# Table name: tasks + +# + +# id :integer not null, primary key + +# content :string + +# count :integer default("0") + +# status :boolean default("0") + +# created_at :datetime not null + +# updated_at :datetime not null + +# + PATCH + + path = 'test/models/task_test.rb' + { + path: include(path), + patch: include(patch) + } + end + let(:task_fixture) do + patch = <<~PATCH + +# == Schema Information + +# + +# Table name: tasks + +# + +# id :integer not null, primary key + +# content :string + +# count :integer default("0") + +# status :boolean default("0") + +# created_at :datetime not null + +# updated_at :datetime not null + +# + PATCH + + path = 'test/fixtures/tasks.yml' + { + path: include(path), + patch: include(patch) + } + end + + it 'annotate models' do + Bundler.with_clean_env do + Dir.chdir RAILS_5_2_APP_PATH do + expect(git.diff.any?).to be_falsy + + puts `#{command}` + + expect(git.diff.entries).to contain_exactly( + an_object_having_attributes(task_model), + an_object_having_attributes(task_test), + an_object_having_attributes(task_fixture) + ) + end + end + end + end + + describe 'annotate --routes' do + let(:command) { 'bundle exec annotate --routes' } + + let(:task_routes) do + task_routes_diff = <<-DIFF ++# == Route Map ++# ++# Prefix Verb URI Pattern Controller#Action ++# tasks GET /tasks(.:format) tasks#index ++# POST /tasks(.:format) tasks#create ++# new_task GET /tasks/new(.:format) tasks#new ++# edit_task GET /tasks/:id/edit(.:format) tasks#edit ++# task GET /tasks/:id(.:format) tasks#show ++# PATCH /tasks/:id(.:format) tasks#update ++# PUT /tasks/:id(.:format) tasks#update ++# DELETE /tasks/:id(.:format) tasks#destroy + DIFF + + default_routes_diff = <<-DIFF ++# rails_service_blob GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs#show ++# rails_blob_representation GET /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations#show ++# rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show ++# update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update ++# rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create + DIFF + + path = 'config/routes.rb' + { + path: include(path), + patch: include(task_routes_diff, default_routes_diff) + } + end + + it 'annotate routes.rb' do + Bundler.with_clean_env do + Dir.chdir RAILS_5_2_APP_PATH do + expect(git.diff.any?).to be_falsy + + puts `#{command}` + + expect(git.diff.entries).to contain_exactly(an_object_having_attributes(task_routes)) + end + end + end + end +end diff --git a/spec/integration/rails_6.0.2.1/.gitignore b/spec/integration/rails_6.0.2.1/.gitignore new file mode 100644 index 000000000..376e85884 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' + +# Ignore bundler config. +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal +/db/*.sqlite3-* + +# Ignore all logfiles and tempfiles. +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep + +# Ignore uploaded files in development. +/storage/* +!/storage/.keep + +/public/assets +.byebug_history + +# Ignore master key for decrypting credentials and more. +/config/master.key + +/public/packs +/public/packs-test +/node_modules +/yarn-error.log +yarn-debug.log* +.yarn-integrity \ No newline at end of file diff --git a/spec/integration/rails_6.0.2.1/.keep b/spec/integration/rails_6.0.2.1/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/.rubocop.yml b/spec/integration/rails_6.0.2.1/.rubocop.yml new file mode 100644 index 000000000..cc32da4b9 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/.rubocop.yml @@ -0,0 +1 @@ +inherit_from: .rubocop_todo.yml diff --git a/spec/integration/rails_6.0.2.1/.rubocop_todo.yml b/spec/integration/rails_6.0.2.1/.rubocop_todo.yml new file mode 100644 index 000000000..b7b989b77 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/.rubocop_todo.yml @@ -0,0 +1,156 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2020-02-01 10:51:52 -1000 using RuboCop version 0.68.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: TreatCommentsAsGroupSeparators, Include. +# Include: **/*.gemfile, **/Gemfile, **/gems.rb +Bundler/OrderedGems: + Exclude: + - 'Gemfile' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: outdent, indent +Layout/AccessModifierIndentation: + Exclude: + - 'bin/bundle' + +# Offense count: 6 +# Cop supports --auto-correct. +Layout/EmptyLineAfterGuardClause: + Exclude: + - 'bin/bundle' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/EmptyLines: + Exclude: + - 'config/environments/development.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'db/schema.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBrackets: space, no_space +Layout/SpaceInsideArrayLiteralBrackets: + Exclude: + - 'config/environments/production.rb' + +# Offense count: 1 +Metrics/AbcSize: + Max: 18 + +# Offense count: 1 +Metrics/CyclomaticComplexity: + Max: 9 + +# Offense count: 2 +# Configuration parameters: CountComments, ExcludedMethods. +Metrics/MethodLength: + Max: 13 + +# Offense count: 1 +Metrics/PerceivedComplexity: + Max: 9 + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, EnforcedStyle. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Exclude: + - 'test/channels/application_cable/connection_test.rb' + - 'test/test_helper.rb' + +# Offense count: 5 +Style/Documentation: + Exclude: + - 'spec/**/*' + - 'test/**/*' + - 'app/helpers/application_helper.rb' + - 'app/mailers/application_mailer.rb' + - 'app/models/application_record.rb' + - 'config/application.rb' + - 'db/migrate/20200201204456_create_tasks.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/ExpandPathArguments: + Exclude: + - 'bin/bundle' + +# Offense count: 37 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: when_needed, always, never +Style/FrozenStringLiteralComment: + Enabled: false + +# Offense count: 3 +# Cop supports --auto-correct. +Style/IfUnlessModifier: + Exclude: + - 'bin/bundle' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: MinDigits, Strict. +Style/NumericLiterals: + Exclude: + - 'db/schema.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/PerlBackrefs: + Exclude: + - 'bin/bundle' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: . +# SupportedStyles: use_perl_names, use_english_names +Style/SpecialGlobalVars: + EnforcedStyle: use_perl_names + +# Offense count: 43 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Exclude: + - 'bin/bundle' + - 'config/application.rb' + - 'config/environments/production.rb' + - 'config/puma.rb' + - 'db/schema.rb' + - 'test/application_system_test_case.rb' + - 'test/channels/application_cable/connection_test.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: MinSize. +# SupportedStyles: percent, brackets +Style/SymbolArray: + EnforcedStyle: brackets + +# Offense count: 40 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Metrics/LineLength: + Max: 190 diff --git a/spec/integration/rails_6.0.2.1/Gemfile b/spec/integration/rails_6.0.2.1/Gemfile new file mode 100644 index 000000000..ee1a132f3 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/Gemfile @@ -0,0 +1,45 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 6.0.2', '>= 6.0.2.1' +# Use sqlite3 as the database for Active Record +gem 'sqlite3', '~> 1.4' +# Use Puma as the app server +gem 'puma', '~> 4.1' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.7' +# Use Redis adapter to run Action Cable in production +# gem 'redis', '~> 4.0' +# Use Active Model has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use Active Storage variant +# gem 'image_processing', '~> 1.2' + +# Reduces boot times through caching; required in config/boot.rb +gem 'bootsnap', '>= 1.4.2', require: false + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] +end + +group :development do + gem 'annotate', path: '../../..' + + # Access an interactive console on exception pages or by calling 'console' anywhere in the code. + gem 'web-console', '>= 3.3.0' + gem 'listen', '>= 3.0.5', '< 3.2' +end + +group :test do + # Adds support for Capybara system testing and selenium driver + gem 'capybara', '>= 2.15' + gem 'selenium-webdriver' + # Easy installation and use of web drivers to run system tests with browsers + gem 'webdrivers' +end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/spec/integration/rails_6.0.2.1/Gemfile.lock b/spec/integration/rails_6.0.2.1/Gemfile.lock new file mode 100644 index 000000000..5f816dde4 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/Gemfile.lock @@ -0,0 +1,201 @@ +PATH + remote: ../../.. + specs: + annotate (3.0.3) + activerecord (>= 3.2, < 7.0) + rake (>= 10.4, < 14.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.2.1) + actionpack (= 6.0.2.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.2.1) + actionpack (= 6.0.2.1) + activejob (= 6.0.2.1) + activerecord (= 6.0.2.1) + activestorage (= 6.0.2.1) + activesupport (= 6.0.2.1) + mail (>= 2.7.1) + actionmailer (6.0.2.1) + actionpack (= 6.0.2.1) + actionview (= 6.0.2.1) + activejob (= 6.0.2.1) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.2.1) + actionview (= 6.0.2.1) + activesupport (= 6.0.2.1) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.2.1) + actionpack (= 6.0.2.1) + activerecord (= 6.0.2.1) + activestorage (= 6.0.2.1) + activesupport (= 6.0.2.1) + nokogiri (>= 1.8.5) + actionview (6.0.2.1) + activesupport (= 6.0.2.1) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.2.1) + activesupport (= 6.0.2.1) + globalid (>= 0.3.6) + activemodel (6.0.2.1) + activesupport (= 6.0.2.1) + activerecord (6.0.2.1) + activemodel (= 6.0.2.1) + activesupport (= 6.0.2.1) + activestorage (6.0.2.1) + actionpack (= 6.0.2.1) + activejob (= 6.0.2.1) + activerecord (= 6.0.2.1) + marcel (~> 0.3.1) + activesupport (6.0.2.1) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + bindex (0.8.1) + bootsnap (1.4.5) + msgpack (~> 1.0) + builder (3.2.4) + byebug (11.1.1) + capybara (3.31.0) + addressable + mini_mime (>= 0.1.3) + nokogiri (~> 1.8) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (~> 1.5) + xpath (~> 3.2) + childprocess (3.0.0) + concurrent-ruby (1.1.5) + crass (1.0.6) + erubi (1.9.0) + ffi (1.12.2) + globalid (0.4.2) + activesupport (>= 4.2.0) + i18n (1.8.2) + concurrent-ruby (~> 1.0) + jbuilder (2.9.1) + activesupport (>= 4.2.0) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + loofah (2.4.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (0.3.3) + mimemagic (~> 0.3.2) + method_source (0.9.2) + mimemagic (0.3.4) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.14.0) + msgpack (1.3.1) + nio4r (2.5.2) + nokogiri (1.10.7) + mini_portile2 (~> 2.4.0) + public_suffix (4.0.3) + puma (4.3.1) + nio4r (~> 2.0) + rack (2.1.2) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails (6.0.2.1) + actioncable (= 6.0.2.1) + actionmailbox (= 6.0.2.1) + actionmailer (= 6.0.2.1) + actionpack (= 6.0.2.1) + actiontext (= 6.0.2.1) + actionview (= 6.0.2.1) + activejob (= 6.0.2.1) + activemodel (= 6.0.2.1) + activerecord (= 6.0.2.1) + activestorage (= 6.0.2.1) + activesupport (= 6.0.2.1) + bundler (>= 1.3.0) + railties (= 6.0.2.1) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (6.0.2.1) + actionpack (= 6.0.2.1) + activesupport (= 6.0.2.1) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rake (13.0.1) + rb-fsevent (0.10.3) + rb-inotify (0.10.1) + ffi (~> 1.0) + regexp_parser (1.6.0) + ruby_dep (1.5.0) + rubyzip (2.2.0) + selenium-webdriver (3.142.7) + childprocess (>= 0.5, < 4.0) + rubyzip (>= 1.2.2) + sprockets (4.0.0) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.2) + thor (1.0.1) + thread_safe (0.3.6) + tzinfo (1.2.6) + thread_safe (~> 0.1) + web-console (4.0.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) + webdrivers (4.2.0) + nokogiri (~> 1.6) + rubyzip (>= 1.3.0) + selenium-webdriver (>= 3.0, < 4.0) + websocket-driver (0.7.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.2.2) + +PLATFORMS + ruby + +DEPENDENCIES + annotate! + bootsnap (>= 1.4.2) + byebug + capybara (>= 2.15) + jbuilder (~> 2.7) + listen (>= 3.0.5, < 3.2) + puma (~> 4.1) + rails (~> 6.0.2, >= 6.0.2.1) + selenium-webdriver + sqlite3 (~> 1.4) + tzinfo-data + web-console (>= 3.3.0) + webdrivers + +BUNDLED WITH + 2.1.2 diff --git a/spec/integration/rails_6.0.2.1/README.md b/spec/integration/rails_6.0.2.1/README.md new file mode 100644 index 000000000..7db80e4ca --- /dev/null +++ b/spec/integration/rails_6.0.2.1/README.md @@ -0,0 +1,24 @@ +# README + +This README would normally document whatever steps are necessary to get the +application up and running. + +Things you may want to cover: + +* Ruby version + +* System dependencies + +* Configuration + +* Database creation + +* Database initialization + +* How to run the test suite + +* Services (job queues, cache servers, search engines, etc.) + +* Deployment instructions + +* ... diff --git a/spec/integration/rails_6.0.2.1/Rakefile b/spec/integration/rails_6.0.2.1/Rakefile new file mode 100644 index 000000000..e85f91391 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/Rakefile @@ -0,0 +1,6 @@ +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. + +require_relative 'config/application' + +Rails.application.load_tasks diff --git a/spec/integration/rails_6.0.2.1/app/assets/config/manifest.js b/spec/integration/rails_6.0.2.1/app/assets/config/manifest.js new file mode 100644 index 000000000..591819335 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css diff --git a/spec/integration/rails_6.0.2.1/app/assets/images/.keep b/spec/integration/rails_6.0.2.1/app/assets/images/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/app/assets/stylesheets/application.css b/spec/integration/rails_6.0.2.1/app/assets/stylesheets/application.css new file mode 100644 index 000000000..d05ea0f51 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/assets/stylesheets/application.css @@ -0,0 +1,15 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's + * vendor/assets/stylesheets directory can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS + * files in this directory. Styles in this file should be added after the last require_* statement. + * It is generally better to create a new file per style scope. + * + *= require_tree . + *= require_self + */ diff --git a/spec/integration/rails_6.0.2.1/app/channels/application_cable/channel.rb b/spec/integration/rails_6.0.2.1/app/channels/application_cable/channel.rb new file mode 100644 index 000000000..d67269728 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/spec/integration/rails_6.0.2.1/app/channels/application_cable/connection.rb b/spec/integration/rails_6.0.2.1/app/channels/application_cable/connection.rb new file mode 100644 index 000000000..0ff5442f4 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/spec/integration/rails_6.0.2.1/app/controllers/application_controller.rb b/spec/integration/rails_6.0.2.1/app/controllers/application_controller.rb new file mode 100644 index 000000000..09705d12a --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/spec/integration/rails_6.0.2.1/app/controllers/concerns/.keep b/spec/integration/rails_6.0.2.1/app/controllers/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/app/helpers/application_helper.rb b/spec/integration/rails_6.0.2.1/app/helpers/application_helper.rb new file mode 100644 index 000000000..de6be7945 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/spec/integration/rails_6.0.2.1/app/jobs/application_job.rb b/spec/integration/rails_6.0.2.1/app/jobs/application_job.rb new file mode 100644 index 000000000..d394c3d10 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/jobs/application_job.rb @@ -0,0 +1,7 @@ +class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError +end diff --git a/spec/integration/rails_6.0.2.1/app/mailers/application_mailer.rb b/spec/integration/rails_6.0.2.1/app/mailers/application_mailer.rb new file mode 100644 index 000000000..286b2239d --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/spec/integration/rails_6.0.2.1/app/models/application_record.rb b/spec/integration/rails_6.0.2.1/app/models/application_record.rb new file mode 100644 index 000000000..10a4cba84 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/spec/integration/rails_6.0.2.1/app/models/concerns/.keep b/spec/integration/rails_6.0.2.1/app/models/concerns/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/app/models/task.rb b/spec/integration/rails_6.0.2.1/app/models/task.rb new file mode 100644 index 000000000..3c2342421 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/models/task.rb @@ -0,0 +1,2 @@ +class Task < ApplicationRecord +end diff --git a/spec/integration/rails_6.0.2.1/app/views/layouts/application.html.erb b/spec/integration/rails_6.0.2.1/app/views/layouts/application.html.erb new file mode 100644 index 000000000..ba0f86cb7 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + Rails6021 + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag 'application', media: 'all' %> + + + + <%= yield %> + + diff --git a/spec/integration/rails_6.0.2.1/app/views/layouts/mailer.html.erb b/spec/integration/rails_6.0.2.1/app/views/layouts/mailer.html.erb new file mode 100644 index 000000000..cbd34d2e9 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/spec/integration/rails_6.0.2.1/app/views/layouts/mailer.text.erb b/spec/integration/rails_6.0.2.1/app/views/layouts/mailer.text.erb new file mode 100644 index 000000000..37f0bddbd --- /dev/null +++ b/spec/integration/rails_6.0.2.1/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/spec/integration/rails_6.0.2.1/bin/bundle b/spec/integration/rails_6.0.2.1/bin/bundle new file mode 100755 index 000000000..524dfd3f2 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/bin/bundle @@ -0,0 +1,105 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ + bundler_version = $1 || ">= 0.a" + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../../Gemfile", __FILE__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, gemfile) + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/ + Regexp.last_match(1) + end + + def bundler_version + @bundler_version ||= begin + env_var_version || cli_arg_version || + lockfile_version || "#{Gem::Requirement.default}.a" + end + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + # must dup string for RG < 1.8 compatibility + activate_bundler(bundler_version.dup) + end + + def activate_bundler(bundler_version) + if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0") + bundler_version = "< 2" + end + gem_error = activation_error_handling do + gem "bundler", bundler_version + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`" + exit 42 + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/spec/integration/rails_6.0.2.1/bin/rails b/spec/integration/rails_6.0.2.1/bin/rails new file mode 100755 index 000000000..073966023 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/bin/rails @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../config/application', __dir__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/spec/integration/rails_6.0.2.1/bin/rake b/spec/integration/rails_6.0.2.1/bin/rake new file mode 100755 index 000000000..17240489f --- /dev/null +++ b/spec/integration/rails_6.0.2.1/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/spec/integration/rails_6.0.2.1/bin/setup b/spec/integration/rails_6.0.2.1/bin/setup new file mode 100755 index 000000000..0e39e8cb1 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/bin/setup @@ -0,0 +1,33 @@ +#!/usr/bin/env ruby +require 'fileutils' + +# path to your application root. +APP_ROOT = File.expand_path('..', __dir__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +FileUtils.chdir APP_ROOT do + # This script is a way to setup or update your development environment automatically. + # This script is idempotent, so that you can run it at anytime and get an expectable outcome. + # Add necessary setup steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install') + + # puts "\n== Copying sample files ==" + # unless File.exist?('config/database.yml') + # FileUtils.cp 'config/database.yml.sample', 'config/database.yml' + # end + + puts "\n== Preparing database ==" + system! 'bin/rails db:prepare' + + puts "\n== Removing old logs and tempfiles ==" + system! 'bin/rails log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'bin/rails restart' +end diff --git a/spec/integration/rails_6.0.2.1/config.ru b/spec/integration/rails_6.0.2.1/config.ru new file mode 100644 index 000000000..f7ba0b527 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config.ru @@ -0,0 +1,5 @@ +# This file is used by Rack-based servers to start the application. + +require_relative 'config/environment' + +run Rails.application diff --git a/spec/integration/rails_6.0.2.1/config/application.rb b/spec/integration/rails_6.0.2.1/config/application.rb new file mode 100644 index 000000000..30faf657c --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/application.rb @@ -0,0 +1,32 @@ +require_relative 'boot' + +require "rails" +# Pick the frameworks you want: +require "active_model/railtie" +require "active_job/railtie" +require "active_record/railtie" +require "active_storage/engine" +require "action_controller/railtie" +require "action_mailer/railtie" +require "action_mailbox/engine" +require "action_text/engine" +require "action_view/railtie" +require "action_cable/engine" +# require "sprockets/railtie" +require "rails/test_unit/railtie" + +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) + +module Rails6021 + class Application < Rails::Application + # Initialize configuration defaults for originally generated Rails version. + config.load_defaults 6.0 + + # Settings in config/environments/* take precedence over those specified here. + # Application configuration can go into files in config/initializers + # -- all .rb files in that directory are automatically loaded after loading + # the framework and any gems in your application. + end +end diff --git a/spec/integration/rails_6.0.2.1/config/boot.rb b/spec/integration/rails_6.0.2.1/config/boot.rb new file mode 100644 index 000000000..b9e460cef --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/boot.rb @@ -0,0 +1,4 @@ +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) + +require 'bundler/setup' # Set up gems listed in the Gemfile. +require 'bootsnap/setup' # Speed up boot time by caching expensive operations. diff --git a/spec/integration/rails_6.0.2.1/config/cable.yml b/spec/integration/rails_6.0.2.1/config/cable.yml new file mode 100644 index 000000000..3b0858c95 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/cable.yml @@ -0,0 +1,10 @@ +development: + adapter: async + +test: + adapter: test + +production: + adapter: redis + url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> + channel_prefix: rails_6_0_2_1_production diff --git a/spec/integration/rails_6.0.2.1/config/credentials.yml.enc b/spec/integration/rails_6.0.2.1/config/credentials.yml.enc new file mode 100644 index 000000000..51e9ebc8c --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/credentials.yml.enc @@ -0,0 +1 @@ +p9Ehs8NhqPrCcIMQWQwVqNKvXN0NnrY9Yn6zbHOJXv80LRwTVw+xrcK2pSr0Df3P42D9SQCzCkooDopjCRd3Rd2AGAj5oYybs8//J+YdDKxsEjdB8R2KG7A+fbLlztq2bHoPNvO9wU22fobO8ANxEV5JuqeLyBukcuzztNm5ZHuufp0J2ltSXJuX7rEToELKTob+g+PnecvmwGzTTQzBiZ2jMmaGqWXESXc4Y6VsnBjj1H6Xs/T4OXiq2rLBulV3NR5/orof2GJKV5ohX1U3z0jZzLPUflgDtPvJN4UieTiqpKa9Umibtdd3TOR/aj7uoXj0Tq9FYG3dIMqsWpUb1133zcYzWsyxbC2dXVvpga4/LsQE2/74I+n1WXC5zH30STOYWJpdhEn0S9I4kq+xwzMAJKALI9BzvgZL--9deAjVLbz0BaSSau--9gVti9PVO/wgBKe5nsl8Ow== \ No newline at end of file diff --git a/spec/integration/rails_6.0.2.1/config/database.yml b/spec/integration/rails_6.0.2.1/config/database.yml new file mode 100644 index 000000000..4a8a1b26f --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/database.yml @@ -0,0 +1,25 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem 'sqlite3' +# +default: &default + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 + +development: + <<: *default + database: db/development.sqlite3 + +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. +test: + <<: *default + database: db/test.sqlite3 + +production: + <<: *default + database: db/production.sqlite3 diff --git a/spec/integration/rails_6.0.2.1/config/environment.rb b/spec/integration/rails_6.0.2.1/config/environment.rb new file mode 100644 index 000000000..426333bb4 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/spec/integration/rails_6.0.2.1/config/environments/development.rb b/spec/integration/rails_6.0.2.1/config/environments/development.rb new file mode 100644 index 000000000..298f8d4b3 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/environments/development.rb @@ -0,0 +1,55 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # In the development environment your application's code is reloaded on + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. + config.cache_classes = false + + # Do not eager load code on boot. + config.eager_load = false + + # Show full error reports. + config.consider_all_requests_local = true + + # Enable/disable caching. By default caching is disabled. + # Run rails dev:cache to toggle caching. + if Rails.root.join('tmp', 'caching-dev.txt').exist? + config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true + + config.cache_store = :memory_store + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{2.days.to_i}" + } + else + config.action_controller.perform_caching = false + + config.cache_store = :null_store + end + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Don't care if the mailer can't send. + config.action_mailer.raise_delivery_errors = false + + config.action_mailer.perform_caching = false + + # Print deprecation notices to the Rails logger. + config.active_support.deprecation = :log + + # Raise an error on page load if there are pending migrations. + config.active_record.migration_error = :page_load + + # Highlight code that triggered database queries in logs. + config.active_record.verbose_query_logs = true + + + # Raises error for missing translations. + # config.action_view.raise_on_missing_translations = true + + # Use an evented file watcher to asynchronously detect changes in source code, + # routes, locales, etc. This feature depends on the listen gem. + config.file_watcher = ActiveSupport::EventedFileUpdateChecker +end diff --git a/spec/integration/rails_6.0.2.1/config/environments/production.rb b/spec/integration/rails_6.0.2.1/config/environments/production.rb new file mode 100644 index 000000000..5ce0e884d --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/environments/production.rb @@ -0,0 +1,106 @@ +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + # Code is not reloaded between requests. + config.cache_classes = true + + # Eager load code on boot. This eager loads most of Rails and + # your application in memory, allowing both threaded web servers + # and those relying on copy on write to perform better. + # Rake tasks automatically ignore this option for performance. + config.eager_load = true + + # Full error reports are disabled and caching is turned on. + config.consider_all_requests_local = false + config.action_controller.perform_caching = true + + # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"] + # or in config/master.key. This key is used to decrypt credentials (and other encrypted files). + # config.require_master_key = true + + # Disable serving static files from the `/public` folder by default since + # Apache or NGINX already handles this. + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? + + # Enable serving of images, stylesheets, and JavaScripts from an asset server. + # config.action_controller.asset_host = 'http://assets.example.com' + + # Specifies the header that your server uses for sending files. + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + + # Mount Action Cable outside main process or domain. + # config.action_cable.mount_path = nil + # config.action_cable.url = 'wss://example.com/cable' + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] + + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true + + # Use the lowest log level to ensure availability of diagnostic information + # when problems arise. + config.log_level = :debug + + # Prepend all log lines with the following tags. + config.log_tags = [ :request_id ] + + # Use a different cache store in production. + # config.cache_store = :mem_cache_store + + # Use a real queuing backend for Active Job (and separate queues per environment). + # config.active_job.queue_adapter = :resque + # config.active_job.queue_name_prefix = "rails_6_0_2_1_production" + + config.action_mailer.perform_caching = false + + # Ignore bad email addresses and do not raise email delivery errors. + # Set this to true and configure the email server for immediate delivery to raise delivery errors. + # config.action_mailer.raise_delivery_errors = false + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation cannot be found). + config.i18n.fallbacks = true + + # Send deprecation notices to registered listeners. + config.active_support.deprecation = :notify + + # Use default logging formatter so that PID and timestamp are not suppressed. + config.log_formatter = ::Logger::Formatter.new + + # Use a different logger for distributed setups. + # require 'syslog/logger' + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') + + if ENV["RAILS_LOG_TO_STDOUT"].present? + logger = ActiveSupport::Logger.new(STDOUT) + logger.formatter = config.log_formatter + config.logger = ActiveSupport::TaggedLogging.new(logger) + end + + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + + # Inserts middleware to perform automatic connection switching. + # The `database_selector` hash is used to pass options to the DatabaseSelector + # middleware. The `delay` is used to determine how long to wait after a write + # to send a subsequent read to the primary. + # + # The `database_resolver` class is used by the middleware to determine which + # database is appropriate to use based on the time delay. + # + # The `database_resolver_context` class is used by the middleware to set + # timestamps for the last write to the primary. The resolver uses the context + # class timestamps to determine how long to wait before reading from the + # replica. + # + # By default Rails will store a last write timestamp in the session. The + # DatabaseSelector middleware is designed as such you can define your own + # strategy for connection switching and pass that into the middleware through + # these configuration options. + # config.active_record.database_selector = { delay: 2.seconds } + # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver + # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session +end diff --git a/spec/integration/rails_6.0.2.1/config/environments/test.rb b/spec/integration/rails_6.0.2.1/config/environments/test.rb new file mode 100644 index 000000000..470dee4be --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/environments/test.rb @@ -0,0 +1,48 @@ +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + +Rails.application.configure do + # Settings specified here will take precedence over those in config/application.rb. + + config.cache_classes = true + + # Do not eager load code on boot. This avoids loading your whole application + # just for the purpose of running a single test. If you are using a tool that + # preloads Rails for running tests, you may have to set it to true. + config.eager_load = false + + # Configure public file server for tests with Cache-Control for performance. + config.public_file_server.enabled = true + config.public_file_server.headers = { + 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + } + + # Show full error reports and disable caching. + config.consider_all_requests_local = true + config.action_controller.perform_caching = false + config.cache_store = :null_store + + # Raise exceptions instead of rendering exception templates. + config.action_dispatch.show_exceptions = false + + # Disable request forgery protection in test environment. + config.action_controller.allow_forgery_protection = false + + # Store uploaded files on the local file system in a temporary directory. + config.active_storage.service = :test + + config.action_mailer.perform_caching = false + + # Tell Action Mailer not to deliver emails to the real world. + # The :test delivery method accumulates sent emails in the + # ActionMailer::Base.deliveries array. + config.action_mailer.delivery_method = :test + + # Print deprecation notices to the stderr. + config.active_support.deprecation = :stderr + + # Raises error for missing translations. + # config.action_view.raise_on_missing_translations = true +end diff --git a/spec/integration/rails_6.0.2.1/config/initializers/application_controller_renderer.rb b/spec/integration/rails_6.0.2.1/config/initializers/application_controller_renderer.rb new file mode 100644 index 000000000..89d2efab2 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/initializers/application_controller_renderer.rb @@ -0,0 +1,8 @@ +# Be sure to restart your server when you modify this file. + +# ActiveSupport::Reloader.to_prepare do +# ApplicationController.renderer.defaults.merge!( +# http_host: 'example.org', +# https: false +# ) +# end diff --git a/spec/integration/rails_6.0.2.1/config/initializers/backtrace_silencers.rb b/spec/integration/rails_6.0.2.1/config/initializers/backtrace_silencers.rb new file mode 100644 index 000000000..59385cdf3 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/initializers/backtrace_silencers.rb @@ -0,0 +1,7 @@ +# Be sure to restart your server when you modify this file. + +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } + +# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. +# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/integration/rails_6.0.2.1/config/initializers/content_security_policy.rb b/spec/integration/rails_6.0.2.1/config/initializers/content_security_policy.rb new file mode 100644 index 000000000..41c43016f --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/initializers/content_security_policy.rb @@ -0,0 +1,28 @@ +# Be sure to restart your server when you modify this file. + +# Define an application-wide content security policy +# For further information see the following documentation +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy + +# Rails.application.config.content_security_policy do |policy| +# policy.default_src :self, :https +# policy.font_src :self, :https, :data +# policy.img_src :self, :https, :data +# policy.object_src :none +# policy.script_src :self, :https +# policy.style_src :self, :https + +# # Specify URI for violation reports +# # policy.report_uri "/csp-violation-report-endpoint" +# end + +# If you are using UJS then enable automatic nonce generation +# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } + +# Set the nonce only to specific directives +# Rails.application.config.content_security_policy_nonce_directives = %w(script-src) + +# Report CSP violations to a specified URI +# For further information see the following documentation: +# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only +# Rails.application.config.content_security_policy_report_only = true diff --git a/spec/integration/rails_6.0.2.1/config/initializers/cookies_serializer.rb b/spec/integration/rails_6.0.2.1/config/initializers/cookies_serializer.rb new file mode 100644 index 000000000..5a6a32d37 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/initializers/cookies_serializer.rb @@ -0,0 +1,5 @@ +# Be sure to restart your server when you modify this file. + +# Specify a serializer for the signed and encrypted cookie jars. +# Valid options are :json, :marshal, and :hybrid. +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/spec/integration/rails_6.0.2.1/config/initializers/filter_parameter_logging.rb b/spec/integration/rails_6.0.2.1/config/initializers/filter_parameter_logging.rb new file mode 100644 index 000000000..4a994e1e7 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/initializers/filter_parameter_logging.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Configure sensitive parameters which will be filtered from the log file. +Rails.application.config.filter_parameters += [:password] diff --git a/spec/integration/rails_6.0.2.1/config/initializers/inflections.rb b/spec/integration/rails_6.0.2.1/config/initializers/inflections.rb new file mode 100644 index 000000000..ac033bf9d --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/initializers/inflections.rb @@ -0,0 +1,16 @@ +# Be sure to restart your server when you modify this file. + +# Add new inflection rules using the following format. Inflections +# are locale specific, and you may define rules for as many different +# locales as you wish. All of these examples are active by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.plural /^(ox)$/i, '\1en' +# inflect.singular /^(ox)en/i, '\1' +# inflect.irregular 'person', 'people' +# inflect.uncountable %w( fish sheep ) +# end + +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections(:en) do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/spec/integration/rails_6.0.2.1/config/initializers/mime_types.rb b/spec/integration/rails_6.0.2.1/config/initializers/mime_types.rb new file mode 100644 index 000000000..dc1899682 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/initializers/mime_types.rb @@ -0,0 +1,4 @@ +# Be sure to restart your server when you modify this file. + +# Add new mime types for use in respond_to blocks: +# Mime::Type.register "text/richtext", :rtf diff --git a/spec/integration/rails_6.0.2.1/config/initializers/wrap_parameters.rb b/spec/integration/rails_6.0.2.1/config/initializers/wrap_parameters.rb new file mode 100644 index 000000000..bbfc3961b --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/initializers/wrap_parameters.rb @@ -0,0 +1,14 @@ +# Be sure to restart your server when you modify this file. + +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + +# To enable root element in JSON for ActiveRecord objects. +# ActiveSupport.on_load(:active_record) do +# self.include_root_in_json = true +# end diff --git a/spec/integration/rails_6.0.2.1/config/locales/en.yml b/spec/integration/rails_6.0.2.1/config/locales/en.yml new file mode 100644 index 000000000..cf9b342d0 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/locales/en.yml @@ -0,0 +1,33 @@ +# Files in the config/locales directory are used for internationalization +# and are automatically loaded by Rails. If you want to use locales other +# than English, add the necessary files in this directory. +# +# To use the locales, use `I18n.t`: +# +# I18n.t 'hello' +# +# In views, this is aliased to just `t`: +# +# <%= t('hello') %> +# +# To use a different locale, set it with `I18n.locale`: +# +# I18n.locale = :es +# +# This would use the information in config/locales/es.yml. +# +# The following keys must be escaped otherwise they will not be retrieved by +# the default I18n backend: +# +# true, false, on, off, yes, no +# +# Instead, surround them with single quotes. +# +# en: +# 'true': 'foo' +# +# To learn more, please read the Rails Internationalization guide +# available at https://guides.rubyonrails.org/i18n.html. + +en: + hello: "Hello world" diff --git a/spec/integration/rails_6.0.2.1/config/puma.rb b/spec/integration/rails_6.0.2.1/config/puma.rb new file mode 100644 index 000000000..5ed443774 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/puma.rb @@ -0,0 +1,38 @@ +# Puma can serve each request in a thread from an internal thread pool. +# The `threads` method setting takes two numbers: a minimum and maximum. +# Any libraries that use thread pools should be configured to match +# the maximum value specified for Puma. Default is set to 5 threads for minimum +# and maximum; this matches the default thread size of Active Record. +# +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count + +# Specifies the `port` that Puma will listen on to receive requests; default is 3000. +# +port ENV.fetch("PORT") { 3000 } + +# Specifies the `environment` that Puma will run in. +# +environment ENV.fetch("RAILS_ENV") { "development" } + +# Specifies the `pidfile` that Puma will use. +pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } + +# Specifies the number of `workers` to boot in clustered mode. +# Workers are forked web server processes. If using threads and workers together +# the concurrency of the application would be max `threads` * `workers`. +# Workers do not work on JRuby or Windows (both of which do not support +# processes). +# +# workers ENV.fetch("WEB_CONCURRENCY") { 2 } + +# Use the `preload_app!` method when specifying a `workers` number. +# This directive tells Puma to first boot the application and load code +# before forking the application. This takes advantage of Copy On Write +# process behavior so workers use less memory. +# +# preload_app! + +# Allow puma to be restarted by `rails restart` command. +plugin :tmp_restart diff --git a/spec/integration/rails_6.0.2.1/config/routes.rb b/spec/integration/rails_6.0.2.1/config/routes.rb new file mode 100644 index 000000000..b735f52f4 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/routes.rb @@ -0,0 +1,4 @@ +Rails.application.routes.draw do + # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html + resources :tasks +end diff --git a/spec/integration/rails_6.0.2.1/config/storage.yml b/spec/integration/rails_6.0.2.1/config/storage.yml new file mode 100644 index 000000000..d32f76e8f --- /dev/null +++ b/spec/integration/rails_6.0.2.1/config/storage.yml @@ -0,0 +1,34 @@ +test: + service: Disk + root: <%= Rails.root.join("tmp/storage") %> + +local: + service: Disk + root: <%= Rails.root.join("storage") %> + +# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key) +# amazon: +# service: S3 +# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %> +# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %> +# region: us-east-1 +# bucket: your_own_bucket + +# Remember not to checkin your GCS keyfile to a repository +# google: +# service: GCS +# project: your_project +# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %> +# bucket: your_own_bucket + +# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key) +# microsoft: +# service: AzureStorage +# storage_account_name: your_account_name +# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %> +# container: your_container_name + +# mirror: +# service: Mirror +# primary: local +# mirrors: [ amazon, google, microsoft ] diff --git a/spec/integration/rails_6.0.2.1/db/migrate/20200201204456_create_tasks.rb b/spec/integration/rails_6.0.2.1/db/migrate/20200201204456_create_tasks.rb new file mode 100644 index 000000000..42e0141d1 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/db/migrate/20200201204456_create_tasks.rb @@ -0,0 +1,11 @@ +class CreateTasks < ActiveRecord::Migration[6.0] + def change + create_table :tasks do |t| + t.string :content + t.integer :count, default: 0 + t.boolean :status, default: false + + t.timestamps + end + end +end diff --git a/spec/integration/rails_6.0.2.1/db/schema.rb b/spec/integration/rails_6.0.2.1/db/schema.rb new file mode 100644 index 000000000..69b014dfd --- /dev/null +++ b/spec/integration/rails_6.0.2.1/db/schema.rb @@ -0,0 +1,23 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `rails +# db:schema:load`. When creating a new database, `rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 2020_02_01_204456) do + + create_table "tasks", force: :cascade do |t| + t.string "content" + t.integer "count", default: 0 + t.boolean "status", default: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + +end diff --git a/spec/integration/rails_6.0.2.1/db/seeds.rb b/spec/integration/rails_6.0.2.1/db/seeds.rb new file mode 100644 index 000000000..1beea2acc --- /dev/null +++ b/spec/integration/rails_6.0.2.1/db/seeds.rb @@ -0,0 +1,7 @@ +# This file should contain all the record creation needed to seed the database with its default values. +# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). +# +# Examples: +# +# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) +# Character.create(name: 'Luke', movie: movies.first) diff --git a/spec/integration/rails_6.0.2.1/lib/assets/.keep b/spec/integration/rails_6.0.2.1/lib/assets/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/lib/tasks/.keep b/spec/integration/rails_6.0.2.1/lib/tasks/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/log/.keep b/spec/integration/rails_6.0.2.1/log/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/public/404.html b/spec/integration/rails_6.0.2.1/public/404.html new file mode 100644 index 000000000..2be3af26f --- /dev/null +++ b/spec/integration/rails_6.0.2.1/public/404.html @@ -0,0 +1,67 @@ + + + + The page you were looking for doesn't exist (404) + + + + + + +
+
+

The page you were looking for doesn't exist.

+

You may have mistyped the address or the page may have moved.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/integration/rails_6.0.2.1/public/422.html b/spec/integration/rails_6.0.2.1/public/422.html new file mode 100644 index 000000000..c08eac0d1 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/public/422.html @@ -0,0 +1,67 @@ + + + + The change you wanted was rejected (422) + + + + + + +
+
+

The change you wanted was rejected.

+

Maybe you tried to change something you didn't have access to.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/integration/rails_6.0.2.1/public/500.html b/spec/integration/rails_6.0.2.1/public/500.html new file mode 100644 index 000000000..78a030af2 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/public/500.html @@ -0,0 +1,66 @@ + + + + We're sorry, but something went wrong (500) + + + + + + +
+
+

We're sorry, but something went wrong.

+
+

If you are the application owner check the logs for more information.

+
+ + diff --git a/spec/integration/rails_6.0.2.1/public/apple-touch-icon-precomposed.png b/spec/integration/rails_6.0.2.1/public/apple-touch-icon-precomposed.png new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/public/apple-touch-icon.png b/spec/integration/rails_6.0.2.1/public/apple-touch-icon.png new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/public/favicon.ico b/spec/integration/rails_6.0.2.1/public/favicon.ico new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/public/robots.txt b/spec/integration/rails_6.0.2.1/public/robots.txt new file mode 100644 index 000000000..c19f78ab6 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/public/robots.txt @@ -0,0 +1 @@ +# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file diff --git a/spec/integration/rails_6.0.2.1/storage/.keep b/spec/integration/rails_6.0.2.1/storage/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/test/application_system_test_case.rb b/spec/integration/rails_6.0.2.1/test/application_system_test_case.rb new file mode 100644 index 000000000..d19212abd --- /dev/null +++ b/spec/integration/rails_6.0.2.1/test/application_system_test_case.rb @@ -0,0 +1,5 @@ +require "test_helper" + +class ApplicationSystemTestCase < ActionDispatch::SystemTestCase + driven_by :selenium, using: :chrome, screen_size: [1400, 1400] +end diff --git a/spec/integration/rails_6.0.2.1/test/channels/application_cable/connection_test.rb b/spec/integration/rails_6.0.2.1/test/channels/application_cable/connection_test.rb new file mode 100644 index 000000000..800405f15 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/test/channels/application_cable/connection_test.rb @@ -0,0 +1,11 @@ +require "test_helper" + +class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase + # test "connects with cookies" do + # cookies.signed[:user_id] = 42 + # + # connect + # + # assert_equal connection.user_id, "42" + # end +end diff --git a/spec/integration/rails_6.0.2.1/test/controllers/.keep b/spec/integration/rails_6.0.2.1/test/controllers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/test/fixtures/.keep b/spec/integration/rails_6.0.2.1/test/fixtures/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/test/fixtures/files/.keep b/spec/integration/rails_6.0.2.1/test/fixtures/files/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/test/fixtures/tasks.yml b/spec/integration/rails_6.0.2.1/test/fixtures/tasks.yml new file mode 100644 index 000000000..c9b9807d6 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/test/fixtures/tasks.yml @@ -0,0 +1,11 @@ +# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + content: MyString + count: 1 + status: false + +two: + content: MyString + count: 1 + status: false diff --git a/spec/integration/rails_6.0.2.1/test/helpers/.keep b/spec/integration/rails_6.0.2.1/test/helpers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/test/integration/.keep b/spec/integration/rails_6.0.2.1/test/integration/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/test/mailers/.keep b/spec/integration/rails_6.0.2.1/test/mailers/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/test/models/.keep b/spec/integration/rails_6.0.2.1/test/models/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/test/models/task_test.rb b/spec/integration/rails_6.0.2.1/test/models/task_test.rb new file mode 100644 index 000000000..3ca215970 --- /dev/null +++ b/spec/integration/rails_6.0.2.1/test/models/task_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class TaskTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/spec/integration/rails_6.0.2.1/test/system/.keep b/spec/integration/rails_6.0.2.1/test/system/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/test/test_helper.rb b/spec/integration/rails_6.0.2.1/test/test_helper.rb new file mode 100644 index 000000000..d5300f88c --- /dev/null +++ b/spec/integration/rails_6.0.2.1/test/test_helper.rb @@ -0,0 +1,13 @@ +ENV['RAILS_ENV'] ||= 'test' +require_relative '../config/environment' +require 'rails/test_help' + +class ActiveSupport::TestCase + # Run tests in parallel with specified workers + parallelize(workers: :number_of_processors) + + # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/spec/integration/rails_6.0.2.1/tmp/.keep b/spec/integration/rails_6.0.2.1/tmp/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1/vendor/.keep b/spec/integration/rails_6.0.2.1/vendor/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/spec/integration/rails_6.0.2.1_spec.rb b/spec/integration/rails_6.0.2.1_spec.rb new file mode 100644 index 000000000..c73b04291 --- /dev/null +++ b/spec/integration/rails_6.0.2.1_spec.rb @@ -0,0 +1,170 @@ +require 'bundler' +require 'rspec' +require 'git' +require_relative 'integration_helper' + +describe 'Integration testing on Rails 6.0.2.1', if: IntegrationHelper.able_to_run?(__FILE__, RUBY_VERSION) do + ::RAILS_6_0_APP_NAME = 'rails_6.0.2.1'.freeze + ::RAILS_6_0_PROJECT_PATH = File.expand_path('../..', __dir__).freeze + ::RAILS_6_0_APP_PATH = File.expand_path(RAILS_6_0_APP_NAME, __dir__).freeze + + let!(:git) { Git.open(RAILS_6_0_PROJECT_PATH) } + + before(:all) do + Bundler.with_clean_env do + Dir.chdir RAILS_6_0_APP_PATH do + puts `bundle install` + puts `bin/rails db:migrate` + end + end + end + + after(:each) do + git.reset_hard + end + + describe 'annotate --models' do + let(:command) { 'bundle exec annotate --models' } + + let(:task_model) do + patch = <<~PATCH + +# == Schema Information + +# + +# Table name: tasks + +# + +# id :integer not null, primary key + +# content :string + +# count :integer default("0") + +# status :boolean default("0") + +# created_at :datetime not null + +# updated_at :datetime not null + +# + PATCH + + path = 'app/models/task.rb' + { + path: include(path), + patch: include(patch) + } + end + let(:task_test) do + patch = <<~PATCH + +# == Schema Information + +# + +# Table name: tasks + +# + +# id :integer not null, primary key + +# content :string + +# count :integer default("0") + +# status :boolean default("0") + +# created_at :datetime not null + +# updated_at :datetime not null + +# + PATCH + + path = 'test/models/task_test.rb' + { + path: include(path), + patch: include(patch) + } + end + let(:task_fixture) do + patch = <<~PATCH + +# == Schema Information + +# + +# Table name: tasks + +# + +# id :integer not null, primary key + +# content :string + +# count :integer default("0") + +# status :boolean default("0") + +# created_at :datetime not null + +# updated_at :datetime not null + +# + PATCH + + path = 'test/fixtures/tasks.yml' + { + path: include(path), + patch: include(patch) + } + end + + it 'annotate models' do + Bundler.with_clean_env do + Dir.chdir RAILS_6_0_APP_PATH do + expect(git.diff.any?).to be_falsy + + puts `#{command}` + + expect(git.diff.entries).to contain_exactly( + an_object_having_attributes(task_model), + an_object_having_attributes(task_test), + an_object_having_attributes(task_fixture) + ) + end + end + end + end + + describe 'annotate --routes' do + let(:command) { 'bundle exec annotate --routes' } + + let(:task_routes) do + task_routes_diff = <<-DIFF ++# == Route Map ++# ++# Prefix Verb URI Pattern Controller#Action ++# tasks GET /tasks(.:format) tasks#index ++# POST /tasks(.:format) tasks#create ++# new_task GET /tasks/new(.:format) tasks#new ++# edit_task GET /tasks/:id/edit(.:format) tasks#edit ++# task GET /tasks/:id(.:format) tasks#show ++# PATCH /tasks/:id(.:format) tasks#update ++# PUT /tasks/:id(.:format) tasks#update ++# DELETE /tasks/:id(.:format) tasks#destroy + DIFF + + default_routes_diff = <<-DIFF ++# rails_mandrill_inbound_emails POST /rails/action_mailbox/mandrill/inbound_emails(.:format) action_mailbox/ingresses/mandrill/inbound_emails#create ++# rails_postmark_inbound_emails POST /rails/action_mailbox/postmark/inbound_emails(.:format) action_mailbox/ingresses/postmark/inbound_emails#create ++# rails_relay_inbound_emails POST /rails/action_mailbox/relay/inbound_emails(.:format) action_mailbox/ingresses/relay/inbound_emails#create ++# rails_sendgrid_inbound_emails POST /rails/action_mailbox/sendgrid/inbound_emails(.:format) action_mailbox/ingresses/sendgrid/inbound_emails#create ++# rails_mailgun_inbound_emails POST /rails/action_mailbox/mailgun/inbound_emails/mime(.:format) action_mailbox/ingresses/mailgun/inbound_emails#create ++# rails_conductor_inbound_emails GET /rails/conductor/action_mailbox/inbound_emails(.:format) rails/conductor/action_mailbox/inbound_emails#index ++# POST /rails/conductor/action_mailbox/inbound_emails(.:format) rails/conductor/action_mailbox/inbound_emails#create ++# new_rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/new(.:format) rails/conductor/action_mailbox/inbound_emails#new ++# edit_rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/:id/edit(.:format) rails/conductor/action_mailbox/inbound_emails#edit ++# rails_conductor_inbound_email GET /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#show ++# PATCH /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#update ++# PUT /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#update ++# DELETE /rails/conductor/action_mailbox/inbound_emails/:id(.:format) rails/conductor/action_mailbox/inbound_emails#destroy ++# rails_conductor_inbound_email_reroute POST /rails/conductor/action_mailbox/:inbound_email_id/reroute(.:format) rails/conductor/action_mailbox/reroutes#create ++# rails_service_blob GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs#show ++# rails_blob_representation GET /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations#show ++# rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show ++# update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update ++# rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create + DIFF + + + path = 'config/routes.rb' + { + path: include(path), + patch: include(task_routes_diff, default_routes_diff) + } + end + + it 'annotate routes.rb' do + Bundler.with_clean_env do + Dir.chdir RAILS_6_0_APP_PATH do + expect(git.diff.any?).to be_falsy + + puts `#{command}` + + expect(git.diff.entries).to contain_exactly(an_object_having_attributes(task_routes)) + end + end + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 41ff7a5b7..f4d49b1c0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -32,64 +32,3 @@ require 'annotate/helpers' require 'annotate/constants' require 'byebug' - -module Annotate - module Integration - ABSOLUTE_GEM_ROOT = File.expand_path('../../', __FILE__) - - CRUFT_PATTERNS = %w( - %SCENARIO%/bin/* - %SCENARIO%/log/* - %SCENARIO%/tmp/* - %SCENARIO%/.bundle - ).freeze - - SCENARIO_HOME = File.join(File.dirname(__FILE__), 'integration') - SCENARIOS = Dir.glob("#{SCENARIO_HOME}/*").select do |candidate| - File.directory?(candidate) - end.map do |test_rig| - base_dir = File.basename(test_rig) - [test_rig, base_dir, base_dir.titlecase] - end - - def self.nuke_cruft(test_rig) - FileList[ - Annotate::Integration::CRUFT_PATTERNS.map do |pattern| - pattern.sub('%SCENARIO%', test_rig) - end - ].each do |fname| - FileUtils.rm_rf(fname) - end - end - - def self.nuke_all_cruft - SCENARIOS.each do |test_rig, _base_dir, _test_name| - nuke_cruft(test_rig) - end - end - - def self.empty_gemset(test_rig) - Dir.chdir(test_rig) do - system(' - ( - export SKIP_BUNDLER=1 - source .rvmrc && - rvm --force gemset empty - ) 2>&1 - ') - end - end - - def self.reset_dirty_files - system("git checkout HEAD -- #{SCENARIO_HOME}/*/") - end - - def self.clear_untracked_files - system("git clean -dfx #{SCENARIO_HOME}/*/") - end - - def self.clean?(test_rig) - `git status --porcelain #{test_rig}/ | wc -l`.strip.to_i.zero? - end - end -end