From 074841a3dbd371b059f690f16f25030f06ca8364 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sat, 7 Sep 2019 23:48:55 +0200 Subject: [PATCH 01/27] Fix test expectations in accordance with new babel output (Specifically, new versions of babel are now generating `["default"]` rather than `.default` for the transpiled default export) --- test/sprockets/bumble_d/transformer_test.rb | 12 ++++++------ .../5.0_amd/test/asset_compilation_test.rb | 16 ++++++++-------- .../shared/test/asset_compilation_test.rb | 16 ++++++++-------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/test/sprockets/bumble_d/transformer_test.rb b/test/sprockets/bumble_d/transformer_test.rb index 9f81393..95e7a0b 100644 --- a/test/sprockets/bumble_d/transformer_test.rb +++ b/test/sprockets/bumble_d/transformer_test.rb @@ -74,11 +74,11 @@ def test_it_compiles_to_umd_modules Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; + _exports["default"] = void 0; _module = babelHelpers.interopRequireDefault(_module); _module2 = babelHelpers.interopRequireDefault(_module2); var _default = 42; - _exports.default = _default; + _exports["default"] = _default; }); JS @@ -136,10 +136,10 @@ def test_it_compiles_to_umd_modules__works_with_namespaces Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; + _exports["default"] = void 0; _module = babelHelpers.interopRequireDefault(_module); var _default = 42; - _exports.default = _default; + _exports["default"] = _default; }); JS @@ -178,11 +178,11 @@ def test_it_can_compile_to_another_module_format Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; + _exports["default"] = void 0; _module = babelHelpers.interopRequireDefault(_module); _module2 = babelHelpers.interopRequireDefault(_module2); var _default = 42; - _exports.default = _default; + _exports["default"] = _default; }); JS diff --git a/test/test_apps/5.0_amd/test/asset_compilation_test.rb b/test/test_apps/5.0_amd/test/asset_compilation_test.rb index a3310b5..6b2cf33 100644 --- a/test/test_apps/5.0_amd/test/asset_compilation_test.rb +++ b/test/test_apps/5.0_amd/test/asset_compilation_test.rb @@ -7,7 +7,7 @@ def test_compiled_assets_are_correct assert_equal EXPECTED_OUTPUT, File.read(compiled_main_js_file) end - MAIN_JS_DIGEST = '28d1277a0eefc149dba33a55c8c8c507d808a1a7cd7efc30d49c56a891b66cf1' + MAIN_JS_DIGEST = 'f4b4c2aa0b687f7aa0fb7e430800b58a3b646bf1301763fd9b1116deb0c7e278' EXPECTED_OUTPUT = <<-JS define("test_engine/qux", ["exports"], function (_exports) { "use strict"; @@ -15,14 +15,14 @@ def test_compiled_assets_are_correct Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; + _exports["default"] = void 0; function Qux(config) { this.config = config; } var _default = Qux; - _exports.default = _default; + _exports["default"] = _default; }); define("foo", ["exports"], function (_exports) { "use strict"; @@ -30,14 +30,14 @@ def test_compiled_assets_are_correct Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; + _exports["default"] = void 0; function Foo() { this.number = 42; } var _default = Foo; - _exports.default = _default; + _exports["default"] = _default; }); define("bar", ["exports", "foo"], function (_exports, _foo) { "use strict"; @@ -45,15 +45,15 @@ def test_compiled_assets_are_correct Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; + _exports["default"] = void 0; _foo = babelHelpers.interopRequireDefault(_foo); function Bar() { - this.foo = new _foo.default(); + this.foo = new _foo["default"](); } var _default = Bar; - _exports.default = _default; + _exports["default"] = _default; }); diff --git a/test/test_apps/shared/test/asset_compilation_test.rb b/test/test_apps/shared/test/asset_compilation_test.rb index 7380d3d..115091f 100644 --- a/test/test_apps/shared/test/asset_compilation_test.rb +++ b/test/test_apps/shared/test/asset_compilation_test.rb @@ -7,7 +7,7 @@ def test_compiled_assets_are_correct assert_equal EXPECTED_OUTPUT, File.read(compiled_main_js_file) end - MAIN_JS_DIGEST = 'e4c5718ffe99c510d5bafab365ef312e5e65617f0317d2e62507e3420eebecfa' + MAIN_JS_DIGEST = 'ee34d61b788e9ba78a3b2e2747d24fe2e20b0e189442559b75cb2b496cccd16d' EXPECTED_OUTPUT = <<-JS (function (global, factory) { if (typeof define === "function" && define.amd) { @@ -28,14 +28,14 @@ def test_compiled_assets_are_correct Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; + _exports["default"] = void 0; function Qux(config) { this.config = config; } var _default = Qux; - _exports.default = _default; + _exports["default"] = _default; }); (function (global, factory) { if (typeof define === "function" && define.amd) { @@ -55,14 +55,14 @@ def test_compiled_assets_are_correct Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; + _exports["default"] = void 0; function Foo() { this.number = 42; } var _default = Foo; - _exports.default = _default; + _exports["default"] = _default; }); (function (global, factory) { if (typeof define === "function" && define.amd) { @@ -82,15 +82,15 @@ def test_compiled_assets_are_correct Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; + _exports["default"] = void 0; _foo = babelHelpers.interopRequireDefault(_foo); function Bar() { - this.foo = new _foo.default(); + this.foo = new _foo["default"](); } var _default = Bar; - _exports.default = _default; + _exports["default"] = _default; }); From b7a96cabe0f46df8e4edd49e919a52020ff92c68 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:13:53 +0200 Subject: [PATCH 02/27] Remove test directory symlink from test apps Instead, we're just going to symlink asset_compilation_test.rb Otherwise, the integration tests would fail on newer ruby versions because ``` require File.expand_path('../../config/environment', __FILE__) ``` from shared/test/test_helper.rb does not work for symlinked files in newer ruby versions (it tries to resolve `../config/environment` from inside the `shared` folder instead of the test app folder containing the symlink). --- test/test_apps/4.2/test | 1 - test/test_apps/5.0/test | 1 - 2 files changed, 2 deletions(-) delete mode 120000 test/test_apps/4.2/test delete mode 120000 test/test_apps/5.0/test diff --git a/test/test_apps/4.2/test b/test/test_apps/4.2/test deleted file mode 120000 index 99b2d18..0000000 --- a/test/test_apps/4.2/test +++ /dev/null @@ -1 +0,0 @@ -../shared/test \ No newline at end of file diff --git a/test/test_apps/5.0/test b/test/test_apps/5.0/test deleted file mode 120000 index 99b2d18..0000000 --- a/test/test_apps/5.0/test +++ /dev/null @@ -1 +0,0 @@ -../shared/test \ No newline at end of file From 34f15200deaeef14ad31358b53f0202d39a14049 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:17:52 +0200 Subject: [PATCH 03/27] Symlink the asset_compilation_test.rb in the test apps (but not test_helper.rb, to fix the behavior on newer rubies described in the previous commit) --- test/test_apps/4.2/test/asset_compilation_test.rb | 1 + test/test_apps/{shared => 4.2}/test/test_helper.rb | 0 test/test_apps/5.0/test/asset_compilation_test.rb | 1 + test/test_apps/5.0/test/test_helper.rb | 7 +++++++ test/test_apps/5.0_amd/test/test_helper.rb | 8 +++++++- 5 files changed, 16 insertions(+), 1 deletion(-) create mode 120000 test/test_apps/4.2/test/asset_compilation_test.rb rename test/test_apps/{shared => 4.2}/test/test_helper.rb (100%) create mode 120000 test/test_apps/5.0/test/asset_compilation_test.rb create mode 100644 test/test_apps/5.0/test/test_helper.rb mode change 120000 => 100644 test/test_apps/5.0_amd/test/test_helper.rb diff --git a/test/test_apps/4.2/test/asset_compilation_test.rb b/test/test_apps/4.2/test/asset_compilation_test.rb new file mode 120000 index 0000000..90c20d6 --- /dev/null +++ b/test/test_apps/4.2/test/asset_compilation_test.rb @@ -0,0 +1 @@ +../../shared/test/asset_compilation_test.rb \ No newline at end of file diff --git a/test/test_apps/shared/test/test_helper.rb b/test/test_apps/4.2/test/test_helper.rb similarity index 100% rename from test/test_apps/shared/test/test_helper.rb rename to test/test_apps/4.2/test/test_helper.rb diff --git a/test/test_apps/5.0/test/asset_compilation_test.rb b/test/test_apps/5.0/test/asset_compilation_test.rb new file mode 120000 index 0000000..90c20d6 --- /dev/null +++ b/test/test_apps/5.0/test/asset_compilation_test.rb @@ -0,0 +1 @@ +../../shared/test/asset_compilation_test.rb \ No newline at end of file diff --git a/test/test_apps/5.0/test/test_helper.rb b/test/test_apps/5.0/test/test_helper.rb new file mode 100644 index 0000000..3acf9ae --- /dev/null +++ b/test/test_apps/5.0/test/test_helper.rb @@ -0,0 +1,7 @@ +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Add more helper methods to be used by all tests here... +end diff --git a/test/test_apps/5.0_amd/test/test_helper.rb b/test/test_apps/5.0_amd/test/test_helper.rb deleted file mode 120000 index 02c3328..0000000 --- a/test/test_apps/5.0_amd/test/test_helper.rb +++ /dev/null @@ -1 +0,0 @@ -../../shared/test/test_helper.rb \ No newline at end of file diff --git a/test/test_apps/5.0_amd/test/test_helper.rb b/test/test_apps/5.0_amd/test/test_helper.rb new file mode 100644 index 0000000..3acf9ae --- /dev/null +++ b/test/test_apps/5.0_amd/test/test_helper.rb @@ -0,0 +1,7 @@ +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' + +class ActiveSupport::TestCase + # Add more helper methods to be used by all tests here... +end From 3cae908942c384831270c0b4d31204f4e0487549 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:21:25 +0200 Subject: [PATCH 04/27] Test against newer ruby versions Ruby 2.2 and 2.3 are no longer supported by ruby core, so all users should upgrade - thus, we're not going to test against these versions anymore. We're also going to test against ruby 2.5 and 2.6 instead of ruby 2.4 since Rails 6 doesn't support ruby 2.4 (it will be EOL in 6 months). Ref: https://www.ruby-lang.org/en/downloads/branches/ --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f9fd51e..1607cde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,8 @@ language: ruby rvm: - - 2.2.4 - - 2.3.3 - - 2.4.0 + - 2.5.6 + - 2.6.4 before_install: - nvm install 6 From a2f01eec7d39e3295f37c2cddb34805de6cb9b26 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:29:31 +0200 Subject: [PATCH 05/27] Support Rails 6 --- sprockets-bumble_d.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sprockets-bumble_d.gemspec b/sprockets-bumble_d.gemspec index 3351df7..a0b2622 100644 --- a/sprockets-bumble_d.gemspec +++ b/sprockets-bumble_d.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.files = Dir['{lib}/**/*'] spec.require_paths = ['lib'] - spec.add_dependency 'railties', ['>= 4.2.0', '< 6.0'] + spec.add_dependency 'railties', ['>= 4.2.0', '< 7.0'] spec.add_dependency 'schmooze', '0.1.6' spec.add_dependency 'sprockets', '~> 3.5' end From 5e6ba72f4ca90bc4ab5db7728be317c8643c73bb Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:36:51 +0200 Subject: [PATCH 06/27] Add generated rails 6.0 test app This was created via: ``` rails new test_app --skip-active-record --skip-keeps --skip-spring --skip-turbolinks --skip-javascript mv test_app 6.0 ``` --- test/test_apps/6.0/.gitignore | 19 ++++ test/test_apps/6.0/.ruby-version | 1 + test/test_apps/6.0/Gemfile | 42 +++++++ test/test_apps/6.0/README.md | 24 ++++ test/test_apps/6.0/Rakefile | 6 + .../6.0/app/assets/config/manifest.js | 2 + .../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 + .../6.0/app/helpers/application_helper.rb | 2 + .../test_apps/6.0/app/jobs/application_job.rb | 7 ++ .../6.0/app/mailers/application_mailer.rb | 4 + .../app/views/layouts/application.html.erb | 14 +++ .../6.0/app/views/layouts/mailer.html.erb | 13 +++ .../6.0/app/views/layouts/mailer.text.erb | 1 + test/test_apps/6.0/bin/bundle | 105 +++++++++++++++++ test/test_apps/6.0/bin/rails | 4 + test/test_apps/6.0/bin/rake | 4 + test/test_apps/6.0/bin/setup | 25 +++++ test/test_apps/6.0/config.ru | 5 + test/test_apps/6.0/config/application.rb | 32 ++++++ test/test_apps/6.0/config/boot.rb | 4 + test/test_apps/6.0/config/cable.yml | 10 ++ test/test_apps/6.0/config/credentials.yml.enc | 1 + test/test_apps/6.0/config/environment.rb | 5 + .../6.0/config/environments/development.rb | 53 +++++++++ .../6.0/config/environments/production.rb | 106 ++++++++++++++++++ .../test_apps/6.0/config/environments/test.rb | 45 ++++++++ .../application_controller_renderer.rb | 8 ++ .../6.0/config/initializers/assets.rb | 12 ++ .../initializers/backtrace_silencers.rb | 7 ++ .../initializers/content_security_policy.rb | 28 +++++ .../config/initializers/cookies_serializer.rb | 5 + .../initializers/filter_parameter_logging.rb | 4 + .../6.0/config/initializers/inflections.rb | 16 +++ .../6.0/config/initializers/mime_types.rb | 4 + .../config/initializers/wrap_parameters.rb | 9 ++ test/test_apps/6.0/config/locales/en.yml | 33 ++++++ test/test_apps/6.0/config/puma.rb | 38 +++++++ test/test_apps/6.0/config/routes.rb | 3 + test/test_apps/6.0/public/404.html | 67 +++++++++++ test/test_apps/6.0/public/422.html | 67 +++++++++++ test/test_apps/6.0/public/500.html | 66 +++++++++++ .../public/apple-touch-icon-precomposed.png | 0 .../test_apps/6.0/public/apple-touch-icon.png | 0 test/test_apps/6.0/public/favicon.ico | 0 test/test_apps/6.0/public/robots.txt | 1 + .../6.0/test/application_system_test_case.rb | 5 + .../application_cable/connection_test.rb | 11 ++ test/test_apps/6.0/test/test_helper.rb | 10 ++ 51 files changed, 953 insertions(+) create mode 100644 test/test_apps/6.0/.gitignore create mode 100644 test/test_apps/6.0/.ruby-version create mode 100644 test/test_apps/6.0/Gemfile create mode 100644 test/test_apps/6.0/README.md create mode 100644 test/test_apps/6.0/Rakefile create mode 100644 test/test_apps/6.0/app/assets/config/manifest.js create mode 100644 test/test_apps/6.0/app/assets/stylesheets/application.css create mode 100644 test/test_apps/6.0/app/channels/application_cable/channel.rb create mode 100644 test/test_apps/6.0/app/channels/application_cable/connection.rb create mode 100644 test/test_apps/6.0/app/controllers/application_controller.rb create mode 100644 test/test_apps/6.0/app/helpers/application_helper.rb create mode 100644 test/test_apps/6.0/app/jobs/application_job.rb create mode 100644 test/test_apps/6.0/app/mailers/application_mailer.rb create mode 100644 test/test_apps/6.0/app/views/layouts/application.html.erb create mode 100644 test/test_apps/6.0/app/views/layouts/mailer.html.erb create mode 100644 test/test_apps/6.0/app/views/layouts/mailer.text.erb create mode 100755 test/test_apps/6.0/bin/bundle create mode 100755 test/test_apps/6.0/bin/rails create mode 100755 test/test_apps/6.0/bin/rake create mode 100755 test/test_apps/6.0/bin/setup create mode 100644 test/test_apps/6.0/config.ru create mode 100644 test/test_apps/6.0/config/application.rb create mode 100644 test/test_apps/6.0/config/boot.rb create mode 100644 test/test_apps/6.0/config/cable.yml create mode 100644 test/test_apps/6.0/config/credentials.yml.enc create mode 100644 test/test_apps/6.0/config/environment.rb create mode 100644 test/test_apps/6.0/config/environments/development.rb create mode 100644 test/test_apps/6.0/config/environments/production.rb create mode 100644 test/test_apps/6.0/config/environments/test.rb create mode 100644 test/test_apps/6.0/config/initializers/application_controller_renderer.rb create mode 100644 test/test_apps/6.0/config/initializers/assets.rb create mode 100644 test/test_apps/6.0/config/initializers/backtrace_silencers.rb create mode 100644 test/test_apps/6.0/config/initializers/content_security_policy.rb create mode 100644 test/test_apps/6.0/config/initializers/cookies_serializer.rb create mode 100644 test/test_apps/6.0/config/initializers/filter_parameter_logging.rb create mode 100644 test/test_apps/6.0/config/initializers/inflections.rb create mode 100644 test/test_apps/6.0/config/initializers/mime_types.rb create mode 100644 test/test_apps/6.0/config/initializers/wrap_parameters.rb create mode 100644 test/test_apps/6.0/config/locales/en.yml create mode 100644 test/test_apps/6.0/config/puma.rb create mode 100644 test/test_apps/6.0/config/routes.rb create mode 100644 test/test_apps/6.0/public/404.html create mode 100644 test/test_apps/6.0/public/422.html create mode 100644 test/test_apps/6.0/public/500.html create mode 100644 test/test_apps/6.0/public/apple-touch-icon-precomposed.png create mode 100644 test/test_apps/6.0/public/apple-touch-icon.png create mode 100644 test/test_apps/6.0/public/favicon.ico create mode 100644 test/test_apps/6.0/public/robots.txt create mode 100644 test/test_apps/6.0/test/application_system_test_case.rb create mode 100644 test/test_apps/6.0/test/channels/application_cable/connection_test.rb create mode 100644 test/test_apps/6.0/test/test_helper.rb diff --git a/test/test_apps/6.0/.gitignore b/test/test_apps/6.0/.gitignore new file mode 100644 index 0000000..4027b32 --- /dev/null +++ b/test/test_apps/6.0/.gitignore @@ -0,0 +1,19 @@ +# 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 all logfiles and tempfiles. +/log/* +/tmp/* + + +/public/assets +.byebug_history + +# Ignore master key for decrypting credentials and more. +/config/master.key diff --git a/test/test_apps/6.0/.ruby-version b/test/test_apps/6.0/.ruby-version new file mode 100644 index 0000000..12d9bd0 --- /dev/null +++ b/test/test_apps/6.0/.ruby-version @@ -0,0 +1 @@ +ruby-2.6.1 diff --git a/test/test_apps/6.0/Gemfile b/test/test_apps/6.0/Gemfile new file mode 100644 index 0000000..f42053d --- /dev/null +++ b/test/test_apps/6.0/Gemfile @@ -0,0 +1,42 @@ +source 'https://rubygems.org' +git_source(:github) { |repo| "https://github.com/#{repo}.git" } + +ruby '2.6.1' + +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 6.0.0' +# Use Puma as the app server +gem 'puma', '~> 3.11' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5' +# 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' + +# 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 + # 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/test/test_apps/6.0/README.md b/test/test_apps/6.0/README.md new file mode 100644 index 0000000..7db80e4 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/Rakefile b/test/test_apps/6.0/Rakefile new file mode 100644 index 0000000..e85f913 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/app/assets/config/manifest.js b/test/test_apps/6.0/app/assets/config/manifest.js new file mode 100644 index 0000000..5918193 --- /dev/null +++ b/test/test_apps/6.0/app/assets/config/manifest.js @@ -0,0 +1,2 @@ +//= link_tree ../images +//= link_directory ../stylesheets .css diff --git a/test/test_apps/6.0/app/assets/stylesheets/application.css b/test/test_apps/6.0/app/assets/stylesheets/application.css new file mode 100644 index 0000000..d05ea0f --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/app/channels/application_cable/channel.rb b/test/test_apps/6.0/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/test/test_apps/6.0/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/test/test_apps/6.0/app/channels/application_cable/connection.rb b/test/test_apps/6.0/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/test/test_apps/6.0/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/test/test_apps/6.0/app/controllers/application_controller.rb b/test/test_apps/6.0/app/controllers/application_controller.rb new file mode 100644 index 0000000..09705d1 --- /dev/null +++ b/test/test_apps/6.0/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::Base +end diff --git a/test/test_apps/6.0/app/helpers/application_helper.rb b/test/test_apps/6.0/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/test/test_apps/6.0/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/test/test_apps/6.0/app/jobs/application_job.rb b/test/test_apps/6.0/app/jobs/application_job.rb new file mode 100644 index 0000000..d394c3d --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/app/mailers/application_mailer.rb b/test/test_apps/6.0/app/mailers/application_mailer.rb new file mode 100644 index 0000000..286b223 --- /dev/null +++ b/test/test_apps/6.0/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/test/test_apps/6.0/app/views/layouts/application.html.erb b/test/test_apps/6.0/app/views/layouts/application.html.erb new file mode 100644 index 0000000..3d6760d --- /dev/null +++ b/test/test_apps/6.0/app/views/layouts/application.html.erb @@ -0,0 +1,14 @@ + + + + TestApp + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + + <%= stylesheet_link_tag 'application', media: 'all' %> + + + + <%= yield %> + + diff --git a/test/test_apps/6.0/app/views/layouts/mailer.html.erb b/test/test_apps/6.0/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..cbd34d2 --- /dev/null +++ b/test/test_apps/6.0/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/test/test_apps/6.0/app/views/layouts/mailer.text.erb b/test/test_apps/6.0/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/test/test_apps/6.0/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/test/test_apps/6.0/bin/bundle b/test/test_apps/6.0/bin/bundle new file mode 100755 index 0000000..524dfd3 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/bin/rails b/test/test_apps/6.0/bin/rails new file mode 100755 index 0000000..0739660 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/bin/rake b/test/test_apps/6.0/bin/rake new file mode 100755 index 0000000..1724048 --- /dev/null +++ b/test/test_apps/6.0/bin/rake @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/test/test_apps/6.0/bin/setup b/test/test_apps/6.0/bin/setup new file mode 100755 index 0000000..2e29ac1 --- /dev/null +++ b/test/test_apps/6.0/bin/setup @@ -0,0 +1,25 @@ +#!/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== 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/test/test_apps/6.0/config.ru b/test/test_apps/6.0/config.ru new file mode 100644 index 0000000..f7ba0b5 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/application.rb b/test/test_apps/6.0/config/application.rb new file mode 100644 index 0000000..8a59037 --- /dev/null +++ b/test/test_apps/6.0/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 TestApp + 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/test/test_apps/6.0/config/boot.rb b/test/test_apps/6.0/config/boot.rb new file mode 100644 index 0000000..b9e460c --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/cable.yml b/test/test_apps/6.0/config/cable.yml new file mode 100644 index 0000000..5b27dd9 --- /dev/null +++ b/test/test_apps/6.0/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: test_app_production diff --git a/test/test_apps/6.0/config/credentials.yml.enc b/test/test_apps/6.0/config/credentials.yml.enc new file mode 100644 index 0000000..2a81f6d --- /dev/null +++ b/test/test_apps/6.0/config/credentials.yml.enc @@ -0,0 +1 @@ +HqUsNSN9SrRxYJgTz6utUmxEKxpGgFG79/7ACWBRd0E1BT/inAH/48tzyfh41ctpHUiweYKj6ieGI6F7/fLaa3LBJhHe8UmoCRt2i9UjT9nD1L0mDXK01+OpfsWMzDOS4cDhYNL8QryrMKvvJMYHOrQ0LDKYRMcoXOMb7ElKwZepKcPInWN7S5F7BeMu3O15j96xjdM/PssAi+2mzGlY3/8LrAtyoND9fWzZ2+74no3fxNYmOB6oTBoNfuLF7B3vZnGJPEC+TAlWVnvHMbrJMyEHJ44FJOtT5S8Gh9i04qOmlojMoFJwen77YxHuP9Gelji1PH43sm8qN/4mUmwQlo7i1fX5Amx7N9eurk4a3n58mgSwt4Q4rCU+yl6TAQkwq+v2XvSFs/+cSqkvttthCZEMK05x5ZM6463L--EKZ6ZACuO95nYy7V--aVf13AuQL9tazW0bvYDg1A== \ No newline at end of file diff --git a/test/test_apps/6.0/config/environment.rb b/test/test_apps/6.0/config/environment.rb new file mode 100644 index 0000000..426333b --- /dev/null +++ b/test/test_apps/6.0/config/environment.rb @@ -0,0 +1,5 @@ +# Load the Rails application. +require_relative 'application' + +# Initialize the Rails application. +Rails.application.initialize! diff --git a/test/test_apps/6.0/config/environments/development.rb b/test/test_apps/6.0/config/environments/development.rb new file mode 100644 index 0000000..9767b8c --- /dev/null +++ b/test/test_apps/6.0/config/environments/development.rb @@ -0,0 +1,53 @@ +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 + + # 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 + + # 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/test/test_apps/6.0/config/environments/production.rb b/test/test_apps/6.0/config/environments/production.rb new file mode 100644 index 0000000..7f96e3d --- /dev/null +++ b/test/test_apps/6.0/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? + + # Compress CSS using a preprocessor. + # config.assets.css_compressor = :sass + + # Do not fallback to assets pipeline if a precompiled asset is missed. + config.assets.compile = false + + # 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 + + # 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 = "test_app_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 + + # 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/test/test_apps/6.0/config/environments/test.rb b/test/test_apps/6.0/config/environments/test.rb new file mode 100644 index 0000000..c3cb971 --- /dev/null +++ b/test/test_apps/6.0/config/environments/test.rb @@ -0,0 +1,45 @@ +# 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 + + 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/test/test_apps/6.0/config/initializers/application_controller_renderer.rb b/test/test_apps/6.0/config/initializers/application_controller_renderer.rb new file mode 100644 index 0000000..89d2efa --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/initializers/assets.rb b/test/test_apps/6.0/config/initializers/assets.rb new file mode 100644 index 0000000..fe48fc3 --- /dev/null +++ b/test/test_apps/6.0/config/initializers/assets.rb @@ -0,0 +1,12 @@ +# 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 + +# 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/test/test_apps/6.0/config/initializers/backtrace_silencers.rb b/test/test_apps/6.0/config/initializers/backtrace_silencers.rb new file mode 100644 index 0000000..59385cd --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/initializers/content_security_policy.rb b/test/test_apps/6.0/config/initializers/content_security_policy.rb new file mode 100644 index 0000000..41c4301 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/initializers/cookies_serializer.rb b/test/test_apps/6.0/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..5a6a32d --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/initializers/filter_parameter_logging.rb b/test/test_apps/6.0/config/initializers/filter_parameter_logging.rb new file mode 100644 index 0000000..4a994e1 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/initializers/inflections.rb b/test/test_apps/6.0/config/initializers/inflections.rb new file mode 100644 index 0000000..ac033bf --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/initializers/mime_types.rb b/test/test_apps/6.0/config/initializers/mime_types.rb new file mode 100644 index 0000000..dc18996 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/initializers/wrap_parameters.rb b/test/test_apps/6.0/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..633c1c8 --- /dev/null +++ b/test/test_apps/6.0/config/initializers/wrap_parameters.rb @@ -0,0 +1,9 @@ +# 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 diff --git a/test/test_apps/6.0/config/locales/en.yml b/test/test_apps/6.0/config/locales/en.yml new file mode 100644 index 0000000..cf9b342 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/puma.rb b/test/test_apps/6.0/config/puma.rb new file mode 100644 index 0000000..5ed4437 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/config/routes.rb b/test/test_apps/6.0/config/routes.rb new file mode 100644 index 0000000..c06383a --- /dev/null +++ b/test/test_apps/6.0/config/routes.rb @@ -0,0 +1,3 @@ +Rails.application.routes.draw do + # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html +end diff --git a/test/test_apps/6.0/public/404.html b/test/test_apps/6.0/public/404.html new file mode 100644 index 0000000..2be3af2 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/public/422.html b/test/test_apps/6.0/public/422.html new file mode 100644 index 0000000..c08eac0 --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/public/500.html b/test/test_apps/6.0/public/500.html new file mode 100644 index 0000000..78a030a --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/public/apple-touch-icon-precomposed.png b/test/test_apps/6.0/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..e69de29 diff --git a/test/test_apps/6.0/public/apple-touch-icon.png b/test/test_apps/6.0/public/apple-touch-icon.png new file mode 100644 index 0000000..e69de29 diff --git a/test/test_apps/6.0/public/favicon.ico b/test/test_apps/6.0/public/favicon.ico new file mode 100644 index 0000000..e69de29 diff --git a/test/test_apps/6.0/public/robots.txt b/test/test_apps/6.0/public/robots.txt new file mode 100644 index 0000000..c19f78a --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/test/application_system_test_case.rb b/test/test_apps/6.0/test/application_system_test_case.rb new file mode 100644 index 0000000..d19212a --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/test/channels/application_cable/connection_test.rb b/test/test_apps/6.0/test/channels/application_cable/connection_test.rb new file mode 100644 index 0000000..800405f --- /dev/null +++ b/test/test_apps/6.0/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/test/test_apps/6.0/test/test_helper.rb b/test/test_apps/6.0/test/test_helper.rb new file mode 100644 index 0000000..5b4817f --- /dev/null +++ b/test/test_apps/6.0/test/test_helper.rb @@ -0,0 +1,10 @@ +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) + + # Add more helper methods to be used by all tests here... +end From ebae40c6bf395f92ec5ce4ba42e52c85ef623768 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:36:52 +0200 Subject: [PATCH 07/27] Remove ruby version from Rails 6.0 test app Gemfile This will allow us to test the app against multiple ruby versions --- test/test_apps/6.0/Gemfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test_apps/6.0/Gemfile b/test/test_apps/6.0/Gemfile index f42053d..5de522e 100644 --- a/test/test_apps/6.0/Gemfile +++ b/test/test_apps/6.0/Gemfile @@ -1,8 +1,6 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '2.6.1' - # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.0.0' # Use Puma as the app server From f74eac40a3af5a4a9c9cd2acafb386886eacf82e Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:36:54 +0200 Subject: [PATCH 08/27] Disable bootsnap in generated Rails 6 test app Because it isn't necessary to verify our gem against rails 6 --- test/test_apps/6.0/config/boot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_apps/6.0/config/boot.rb b/test/test_apps/6.0/config/boot.rb index b9e460c..4423c97 100644 --- a/test/test_apps/6.0/config/boot.rb +++ b/test/test_apps/6.0/config/boot.rb @@ -1,4 +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. +# require 'bootsnap/setup' # Speed up boot time by caching expensive operations. From 1b1b4186264fb50592cb6c70f6dc3c99a800c382 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:36:57 +0200 Subject: [PATCH 09/27] Disable ActiveSupport::EventedFileUpdateChecker in Rails 6 test app Because it isn't necessary to verify our gem against rails 6 --- test/test_apps/6.0/config/environments/development.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_apps/6.0/config/environments/development.rb b/test/test_apps/6.0/config/environments/development.rb index 9767b8c..587fcc1 100644 --- a/test/test_apps/6.0/config/environments/development.rb +++ b/test/test_apps/6.0/config/environments/development.rb @@ -49,5 +49,5 @@ # 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 + # config.file_watcher = ActiveSupport::EventedFileUpdateChecker end From 8de92ce6326a6f6e1c1b928700a594dd3eda6c39 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:37:00 +0200 Subject: [PATCH 10/27] Remove unnecessary gems from generated Rails 6 test app --- test/test_apps/6.0/Gemfile | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/test/test_apps/6.0/Gemfile b/test/test_apps/6.0/Gemfile index 5de522e..8c95519 100644 --- a/test/test_apps/6.0/Gemfile +++ b/test/test_apps/6.0/Gemfile @@ -5,36 +5,3 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'rails', '~> 6.0.0' # Use Puma as the app server gem 'puma', '~> 3.11' -# Use SCSS for stylesheets -gem 'sass-rails', '~> 5' -# 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' - -# 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 - # 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] From 6aa09fe16d40953eebaf4ecb1859963882185798 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:37:04 +0200 Subject: [PATCH 11/27] Disable action_mailer settings in generated Rails 6 test app Because we don't need action mailer in the test app --- test/test_apps/6.0/config/environments/development.rb | 4 ++-- test/test_apps/6.0/config/environments/production.rb | 2 +- test/test_apps/6.0/config/environments/test.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_apps/6.0/config/environments/development.rb b/test/test_apps/6.0/config/environments/development.rb index 587fcc1..df83529 100644 --- a/test/test_apps/6.0/config/environments/development.rb +++ b/test/test_apps/6.0/config/environments/development.rb @@ -29,9 +29,9 @@ end # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = false + # config.action_mailer.raise_delivery_errors = false - config.action_mailer.perform_caching = false + # config.action_mailer.perform_caching = false # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log diff --git a/test/test_apps/6.0/config/environments/production.rb b/test/test_apps/6.0/config/environments/production.rb index 7f96e3d..7a9a7eb 100644 --- a/test/test_apps/6.0/config/environments/production.rb +++ b/test/test_apps/6.0/config/environments/production.rb @@ -57,7 +57,7 @@ # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "test_app_production" - config.action_mailer.perform_caching = false + # 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. diff --git a/test/test_apps/6.0/config/environments/test.rb b/test/test_apps/6.0/config/environments/test.rb index c3cb971..2dcc449 100644 --- a/test/test_apps/6.0/config/environments/test.rb +++ b/test/test_apps/6.0/config/environments/test.rb @@ -30,12 +30,12 @@ # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - config.action_mailer.perform_caching = false + # 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 + # config.action_mailer.delivery_method = :test # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr From 8d6ce11fe351427fc6b4e00b31a6b78da4067481 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:37:07 +0200 Subject: [PATCH 12/27] Remove ApplicationMailer and mailer layouts from Rails 6 test app Because we don't need action mailer in the test app --- .../test_apps/6.0/app/mailers/application_mailer.rb | 4 ---- .../test_apps/6.0/app/views/layouts/mailer.html.erb | 13 ------------- .../test_apps/6.0/app/views/layouts/mailer.text.erb | 1 - 3 files changed, 18 deletions(-) delete mode 100644 test/test_apps/6.0/app/mailers/application_mailer.rb delete mode 100644 test/test_apps/6.0/app/views/layouts/mailer.html.erb delete mode 100644 test/test_apps/6.0/app/views/layouts/mailer.text.erb diff --git a/test/test_apps/6.0/app/mailers/application_mailer.rb b/test/test_apps/6.0/app/mailers/application_mailer.rb deleted file mode 100644 index 286b223..0000000 --- a/test/test_apps/6.0/app/mailers/application_mailer.rb +++ /dev/null @@ -1,4 +0,0 @@ -class ApplicationMailer < ActionMailer::Base - default from: 'from@example.com' - layout 'mailer' -end diff --git a/test/test_apps/6.0/app/views/layouts/mailer.html.erb b/test/test_apps/6.0/app/views/layouts/mailer.html.erb deleted file mode 100644 index cbd34d2..0000000 --- a/test/test_apps/6.0/app/views/layouts/mailer.html.erb +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - <%= yield %> - - diff --git a/test/test_apps/6.0/app/views/layouts/mailer.text.erb b/test/test_apps/6.0/app/views/layouts/mailer.text.erb deleted file mode 100644 index 37f0bdd..0000000 --- a/test/test_apps/6.0/app/views/layouts/mailer.text.erb +++ /dev/null @@ -1 +0,0 @@ -<%= yield %> From e344a7d1b50d9f9a1ad27d0a01b057bffe1bac67 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:37:11 +0200 Subject: [PATCH 13/27] Remove ApplicationJob from generated Rails 6 test app Because we don't need active job in the test app --- test/test_apps/6.0/app/jobs/application_job.rb | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 test/test_apps/6.0/app/jobs/application_job.rb diff --git a/test/test_apps/6.0/app/jobs/application_job.rb b/test/test_apps/6.0/app/jobs/application_job.rb deleted file mode 100644 index d394c3d..0000000 --- a/test/test_apps/6.0/app/jobs/application_job.rb +++ /dev/null @@ -1,7 +0,0 @@ -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 From 9308a05af1056a73eb19f9a77765390f01c020f0 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:37:14 +0200 Subject: [PATCH 14/27] Remove ApplicationCable files from generated Rails 6 test app Because we don't need action cable in the test app --- .../6.0/app/channels/application_cable/channel.rb | 4 ---- .../6.0/app/channels/application_cable/connection.rb | 4 ---- .../channels/application_cable/connection_test.rb | 11 ----------- 3 files changed, 19 deletions(-) delete mode 100644 test/test_apps/6.0/app/channels/application_cable/channel.rb delete mode 100644 test/test_apps/6.0/app/channels/application_cable/connection.rb delete mode 100644 test/test_apps/6.0/test/channels/application_cable/connection_test.rb diff --git a/test/test_apps/6.0/app/channels/application_cable/channel.rb b/test/test_apps/6.0/app/channels/application_cable/channel.rb deleted file mode 100644 index d672697..0000000 --- a/test/test_apps/6.0/app/channels/application_cable/channel.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Channel < ActionCable::Channel::Base - end -end diff --git a/test/test_apps/6.0/app/channels/application_cable/connection.rb b/test/test_apps/6.0/app/channels/application_cable/connection.rb deleted file mode 100644 index 0ff5442..0000000 --- a/test/test_apps/6.0/app/channels/application_cable/connection.rb +++ /dev/null @@ -1,4 +0,0 @@ -module ApplicationCable - class Connection < ActionCable::Connection::Base - end -end diff --git a/test/test_apps/6.0/test/channels/application_cable/connection_test.rb b/test/test_apps/6.0/test/channels/application_cable/connection_test.rb deleted file mode 100644 index 800405f..0000000 --- a/test/test_apps/6.0/test/channels/application_cable/connection_test.rb +++ /dev/null @@ -1,11 +0,0 @@ -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 From 62b85e57ff4e89ac1992b65914408e744192fe5a Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:37:17 +0200 Subject: [PATCH 15/27] Remove unused railties in Rails 6 test app --- test/test_apps/6.0/config/application.rb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/test_apps/6.0/config/application.rb b/test/test_apps/6.0/config/application.rb index 8a59037..1a84ce6 100644 --- a/test/test_apps/6.0/config/application.rb +++ b/test/test_apps/6.0/config/application.rb @@ -1,17 +1,8 @@ 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" From d0aa054af010c9badfb5adbd7b27e3f00f796994 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:37:20 +0200 Subject: [PATCH 16/27] Add symlink to shared/package.json in Rails 6.0 test app --- test/test_apps/6.0/package.json | 1 + 1 file changed, 1 insertion(+) create mode 120000 test/test_apps/6.0/package.json diff --git a/test/test_apps/6.0/package.json b/test/test_apps/6.0/package.json new file mode 120000 index 0000000..77f52a7 --- /dev/null +++ b/test/test_apps/6.0/package.json @@ -0,0 +1 @@ +../shared/package.json \ No newline at end of file From f56f673961754d95854effa0bc193a9c56948d03 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:37:24 +0200 Subject: [PATCH 17/27] Remove 6.0/config/routes.rb because we're going to symlink it --- test/test_apps/6.0/config/routes.rb | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 test/test_apps/6.0/config/routes.rb diff --git a/test/test_apps/6.0/config/routes.rb b/test/test_apps/6.0/config/routes.rb deleted file mode 100644 index c06383a..0000000 --- a/test/test_apps/6.0/config/routes.rb +++ /dev/null @@ -1,3 +0,0 @@ -Rails.application.routes.draw do - # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html -end From 6490255c1fba5814d37cb3022f523f28bc44d0a3 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:46:36 +0200 Subject: [PATCH 18/27] Add symlink to shared/config/routes.rb in Rails 6.0 test app --- test/test_apps/6.0/config/routes.rb | 1 + 1 file changed, 1 insertion(+) create mode 120000 test/test_apps/6.0/config/routes.rb diff --git a/test/test_apps/6.0/config/routes.rb b/test/test_apps/6.0/config/routes.rb new file mode 120000 index 0000000..7b2e2a4 --- /dev/null +++ b/test/test_apps/6.0/config/routes.rb @@ -0,0 +1 @@ +../../shared/config/routes.rb \ No newline at end of file From f531d3a4d8bdda60f8ce7d5d76e24ec2a74cf20c Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:57:32 +0200 Subject: [PATCH 19/27] Remove 6.0/config/initializers/assets.rb because we'll symlink it --- test/test_apps/6.0/config/initializers/assets.rb | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 test/test_apps/6.0/config/initializers/assets.rb diff --git a/test/test_apps/6.0/config/initializers/assets.rb b/test/test_apps/6.0/config/initializers/assets.rb deleted file mode 100644 index fe48fc3..0000000 --- a/test/test_apps/6.0/config/initializers/assets.rb +++ /dev/null @@ -1,12 +0,0 @@ -# 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 - -# 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 ) From 6958f122cc3a9eb62267c95aa2039c4bcc2e623e Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 00:58:51 +0200 Subject: [PATCH 20/27] Add symlink to shared/config/initializers/assets.rb in Rails 6 test app --- test/test_apps/6.0/config/initializers/assets.rb | 1 + 1 file changed, 1 insertion(+) create mode 120000 test/test_apps/6.0/config/initializers/assets.rb diff --git a/test/test_apps/6.0/config/initializers/assets.rb b/test/test_apps/6.0/config/initializers/assets.rb new file mode 120000 index 0000000..5a7a040 --- /dev/null +++ b/test/test_apps/6.0/config/initializers/assets.rb @@ -0,0 +1 @@ +../../../shared/config/initializers/assets.rb \ No newline at end of file From f4c452a584364d10a3e469fff33aa0deb3c6e626 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 01:00:34 +0200 Subject: [PATCH 21/27] Add symlink to shared/vendor in Rails 6.0 test app --- test/test_apps/6.0/vendor | 1 + 1 file changed, 1 insertion(+) create mode 120000 test/test_apps/6.0/vendor diff --git a/test/test_apps/6.0/vendor b/test/test_apps/6.0/vendor new file mode 120000 index 0000000..4a8c503 --- /dev/null +++ b/test/test_apps/6.0/vendor @@ -0,0 +1 @@ +../shared/vendor \ No newline at end of file From 7120b7f7c111bc1c180a502eb1434e9eec1c9d8a Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 01:01:50 +0200 Subject: [PATCH 22/27] Remove 6.0/app and replace it with symlink to shared/app --- test/test_apps/6.0/app | 1 + test/test_apps/6.0/app/assets/config/manifest.js | 2 -- .../6.0/app/assets/stylesheets/application.css | 15 --------------- .../6.0/app/controllers/application_controller.rb | 2 -- .../6.0/app/helpers/application_helper.rb | 2 -- .../6.0/app/views/layouts/application.html.erb | 14 -------------- 6 files changed, 1 insertion(+), 35 deletions(-) create mode 120000 test/test_apps/6.0/app delete mode 100644 test/test_apps/6.0/app/assets/config/manifest.js delete mode 100644 test/test_apps/6.0/app/assets/stylesheets/application.css delete mode 100644 test/test_apps/6.0/app/controllers/application_controller.rb delete mode 100644 test/test_apps/6.0/app/helpers/application_helper.rb delete mode 100644 test/test_apps/6.0/app/views/layouts/application.html.erb diff --git a/test/test_apps/6.0/app b/test/test_apps/6.0/app new file mode 120000 index 0000000..abbdfa6 --- /dev/null +++ b/test/test_apps/6.0/app @@ -0,0 +1 @@ +../shared/app \ No newline at end of file diff --git a/test/test_apps/6.0/app/assets/config/manifest.js b/test/test_apps/6.0/app/assets/config/manifest.js deleted file mode 100644 index 5918193..0000000 --- a/test/test_apps/6.0/app/assets/config/manifest.js +++ /dev/null @@ -1,2 +0,0 @@ -//= link_tree ../images -//= link_directory ../stylesheets .css diff --git a/test/test_apps/6.0/app/assets/stylesheets/application.css b/test/test_apps/6.0/app/assets/stylesheets/application.css deleted file mode 100644 index d05ea0f..0000000 --- a/test/test_apps/6.0/app/assets/stylesheets/application.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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/test/test_apps/6.0/app/controllers/application_controller.rb b/test/test_apps/6.0/app/controllers/application_controller.rb deleted file mode 100644 index 09705d1..0000000 --- a/test/test_apps/6.0/app/controllers/application_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ApplicationController < ActionController::Base -end diff --git a/test/test_apps/6.0/app/helpers/application_helper.rb b/test/test_apps/6.0/app/helpers/application_helper.rb deleted file mode 100644 index de6be79..0000000 --- a/test/test_apps/6.0/app/helpers/application_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ApplicationHelper -end diff --git a/test/test_apps/6.0/app/views/layouts/application.html.erb b/test/test_apps/6.0/app/views/layouts/application.html.erb deleted file mode 100644 index 3d6760d..0000000 --- a/test/test_apps/6.0/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - TestApp - <%= csrf_meta_tags %> - <%= csp_meta_tag %> - - <%= stylesheet_link_tag 'application', media: 'all' %> - - - - <%= yield %> - - From c0da89bcef9dc4c1fa27183cc5a2d85f1e66488f Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 01:04:32 +0200 Subject: [PATCH 23/27] Add sprockets-bumble_d to Rails 6.0 test app --- test/test_apps/6.0/Gemfile | 2 ++ test/test_apps/6.0/config/application.rb | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/test/test_apps/6.0/Gemfile b/test/test_apps/6.0/Gemfile index 8c95519..296a535 100644 --- a/test/test_apps/6.0/Gemfile +++ b/test/test_apps/6.0/Gemfile @@ -5,3 +5,5 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } gem 'rails', '~> 6.0.0' # Use Puma as the app server gem 'puma', '~> 3.11' + +gem 'sprockets-bumble_d', :path => '../../..' diff --git a/test/test_apps/6.0/config/application.rb b/test/test_apps/6.0/config/application.rb index 1a84ce6..f5ede1a 100644 --- a/test/test_apps/6.0/config/application.rb +++ b/test/test_apps/6.0/config/application.rb @@ -12,6 +12,8 @@ module TestApp class Application < Rails::Application + extend Sprockets::BumbleD::DSL + # Initialize configuration defaults for originally generated Rails version. config.load_defaults 6.0 @@ -19,5 +21,9 @@ class Application < Rails::Application # 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. + + configure_sprockets_bumble_d do |config| + config.babel_config_version = 1 + end end end From fec1a162c721d9c0e894c948f490d8cba282fbea Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 01:06:05 +0200 Subject: [PATCH 24/27] Register globals for sample ES6 modules in Rails 6.0 test app --- test/test_apps/6.0/config/application.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test_apps/6.0/config/application.rb b/test/test_apps/6.0/config/application.rb index f5ede1a..e8bfd3e 100644 --- a/test/test_apps/6.0/config/application.rb +++ b/test/test_apps/6.0/config/application.rb @@ -25,5 +25,9 @@ class Application < Rails::Application configure_sprockets_bumble_d do |config| config.babel_config_version = 1 end + + register_umd_globals :test_app, + 'bar' => 'Bar', + 'foo' => 'Foo' end end From 782439e7d5bb0c956f020fb58386e06f6b941c0e Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 01:13:48 +0200 Subject: [PATCH 25/27] Make test_engine support Rails 6 --- test/test_apps/test_engine/test_engine.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_apps/test_engine/test_engine.gemspec b/test/test_apps/test_engine/test_engine.gemspec index d481521..fe8e81f 100644 --- a/test/test_apps/test_engine/test_engine.gemspec +++ b/test/test_apps/test_engine/test_engine.gemspec @@ -12,6 +12,6 @@ Gem::Specification.new do |s| s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"] - s.add_dependency "rails", ['>= 4.2.0', '< 6.0'] + s.add_dependency "rails", ['>= 4.2.0', '< 7.0'] s.add_dependency "sprockets-bumble_d" end From 3dd73a7202cec2c789aaa55ac5bcb934aa880240 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 01:14:54 +0200 Subject: [PATCH 26/27] Add test_engine to Rails 6.0 test app --- test/test_apps/6.0/Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_apps/6.0/Gemfile b/test/test_apps/6.0/Gemfile index 296a535..4da0300 100644 --- a/test/test_apps/6.0/Gemfile +++ b/test/test_apps/6.0/Gemfile @@ -7,3 +7,5 @@ gem 'rails', '~> 6.0.0' gem 'puma', '~> 3.11' gem 'sprockets-bumble_d', :path => '../../..' + +gem 'test_engine', path: '../test_engine' From bccf4fe0ba23e1f02c5b333be5705ddc53f73a16 Mon Sep 17 00:00:00 2001 From: Richard Macklin Date: Sun, 8 Sep 2019 01:14:59 +0200 Subject: [PATCH 27/27] Symlink asset_compilation_test.rb in Rails 6.0 test app --- test/test_apps/6.0/test/asset_compilation_test.rb | 1 + 1 file changed, 1 insertion(+) create mode 120000 test/test_apps/6.0/test/asset_compilation_test.rb diff --git a/test/test_apps/6.0/test/asset_compilation_test.rb b/test/test_apps/6.0/test/asset_compilation_test.rb new file mode 120000 index 0000000..90c20d6 --- /dev/null +++ b/test/test_apps/6.0/test/asset_compilation_test.rb @@ -0,0 +1 @@ +../../shared/test/asset_compilation_test.rb \ No newline at end of file