From 119616635c097e1e23c59b6a21d8d192c8516c6a Mon Sep 17 00:00:00 2001 From: Tim Fischbach Date: Mon, 6 Nov 2023 10:06:36 +0100 Subject: [PATCH] Upgrade to Rails 6.1/Shakapacker Turn experimental dependencies into defaults. REDMINE-19438 --- .github/workflows/tests.yml | 37 -------- Gemfile | 18 ++-- README.md | 7 +- .../admin/extensible_attributes_table.rb | 8 +- bin/rspec-with-experimental-rails | 5 -- .../paged/lib/pageflow_paged/engine.rb | 18 ++-- .../helpers/pageflow_scrolled/packs_helper.rb | 43 +++------ .../pageflow_scrolled/themes_helper.rb | 4 +- .../editor/entries/_head.html.erb | 7 +- .../install/install_generator.rb | 90 +++++-------------- .../scrolled/lib/pageflow_scrolled/engine.rb | 20 ++--- .../lib/tasks/pageflow_scrolled/dummy.rake | 2 +- entry_types/scrolled/spec/spec_helper.rb | 9 +- .../scrolled/spec/support/config/webpacker.rb | 10 --- lib/pageflow/engine.rb | 73 ++++----------- pageflow.gemspec | 48 ++-------- spec/spec_helper.rb | 7 +- spec/support/dominos/admin/filter_form.rb | 9 +- spec/support/pageflow-support.gemspec | 6 +- spec/support/pageflow/dummy/app.rb | 2 +- spec/support/pageflow/dummy/rails_template.rb | 6 +- 21 files changed, 92 insertions(+), 337 deletions(-) delete mode 100755 bin/rspec-with-experimental-rails delete mode 100644 entry_types/scrolled/spec/support/config/webpacker.rb diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9a6d54424d..e367e4d7a6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,72 +13,35 @@ jobs: fail-fast: false matrix: include: - - engine-name: pageflow - ruby-version: 2.6 - engine-directory: . - rspec-command: bin/rspec --tag ~js - install-audiowaveform: true - - engine-name: pageflow ruby-version: 3.2 - rails-version: "~> 6.1" engine-directory: . rspec-command: bin/rspec --tag ~js install-audiowaveform: true - - engine-name: pageflow - ruby-version: 2.6 - engine-directory: . - rspec-command: bin/rspec-with-retry --tag js - - engine-name: pageflow ruby-version: 3.2 - rails-version: "~> 6.1" engine-directory: . rspec-command: bin/rspec-with-retry --tag js - - engine-name: pageflow_paged - ruby-version: 2.6 - engine-directory: entry_types/paged - plugin-name: pageflow_paged - rspec-command: bin/rspec - - engine-name: pageflow_paged ruby-version: 3.2 - rails-version: "~> 6.1" engine-directory: entry_types/paged plugin-name: pageflow_paged rspec-command: bin/rspec - - engine-name: pageflow_scrolled - ruby-version: 2.6 - engine-directory: entry_types/scrolled - plugin-name: pageflow_scrolled - rspec-command: bin/rspec --tag ~js - - engine-name: pageflow_scrolled ruby-version: 3.2 - rails-version: "~> 6.1" engine-directory: entry_types/scrolled plugin-name: pageflow_scrolled rspec-command: bin/rspec --tag ~js - - engine-name: pageflow_scrolled - ruby-version: 2.6 - engine-directory: entry_types/scrolled - plugin-name: pageflow_scrolled - rspec-command: bin/rspec-with-retry-on-timeout --tag js - - engine-name: pageflow_scrolled ruby-version: 3.2 - rails-version: "~> 6.1" engine-directory: entry_types/scrolled plugin-name: pageflow_scrolled rspec-command: bin/rspec-with-retry-on-timeout --tag js - env: - PAGEFLOW_RAILS_VERSION: ${{ matrix.rails-version }} - services: mysql: image: mysql:5.7 diff --git a/Gemfile b/Gemfile index eebe719b16..2056fcd3e3 100644 --- a/Gemfile +++ b/Gemfile @@ -21,19 +21,11 @@ end # Required for XML serialization in Active Admin gem 'activemodel-serializers-xml' -if Pageflow::RailsVersion.experimental? - # Make shakapacker available in specs. Host applications that want to - # use shakapacker need to add it to their Gemfile themselves. Requiring - # shakapacker in an engine file (like we normally do) would force all - # host application to install shakapacker. - gem 'shakapacker', '~> 7.0' -else - # Make webpacker available in specs. Host applications that want to - # use webpacker need to add it to their Gemfile themselves. Requiring - # webpacker in an engine file (like we normally do) would force all - # host application to install webpacker. - gem 'webpacker', '~> 4.2' -end +# Make shakapacker available in specs. Host applications that want to +# use shakapacker need to add it to their Gemfile themselves. Requiring +# shakapacker in an engine file (like we normally do) would force all +# host application to install shakapacker. +gem 'shakapacker', '~> 7.0' # Make tests fail on JS errors gem 'capybara-chromedriver-logger', git: 'https://github.com/codevise/capybara-chromedriver-logger', branch: 'fix-selenium-4-deprecation', require: false diff --git a/README.md b/README.md index 89d54120cf..66f161970d 100644 --- a/README.md +++ b/README.md @@ -49,12 +49,13 @@ Pageflow assumes the following choice of libraries: Pageflow runs in environments with: -* Ruby >= 2.1 (see `.travis.yml` for supported versions) -* Node >= 10.18 -* Rails 4.2 +* Ruby >= 3.2 +* Node >= 14 +* Rails 6.1 * Redis server (for Resque) * A database server supported by Active Record (tested with MySQL) * ImageMagick +* [libvips](https://github.com/libvips/ruby-vips) * [Audio Waveform Image Generator](https://github.com/bbc/audiowaveform#installation) Accounts of the following cloud services have to be registered: diff --git a/app/views/components/pageflow/admin/extensible_attributes_table.rb b/app/views/components/pageflow/admin/extensible_attributes_table.rb index 7144cf7fbc..016f7e7578 100644 --- a/app/views/components/pageflow/admin/extensible_attributes_table.rb +++ b/app/views/components/pageflow/admin/extensible_attributes_table.rb @@ -79,13 +79,7 @@ def respond_to_missing?(name, _include_private = false) # This is also the reason we can not use SimpleDelegator here # and also delegate_missing in Rails 5 would not work. def method_missing(method, *args, **kwargs, &block) - # Required for Ruby 2.6. Remove together with - # Pageflow::RailsVersion.experimental? conditionals. - if kwargs.present? - @context.public_send(method, *args, **kwargs, &block) - else - @context.public_send(method, *args, &block) - end + @context.public_send(method, *args, **kwargs, &block) end # rubocop:enable Style/MethodMissing end diff --git a/bin/rspec-with-experimental-rails b/bin/rspec-with-experimental-rails deleted file mode 100755 index 187b964d94..0000000000 --- a/bin/rspec-with-experimental-rails +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -export PAGEFLOW_RAILS_VERSION="~> 6.1" - -bin/rspec $@; diff --git a/entry_types/paged/lib/pageflow_paged/engine.rb b/entry_types/paged/lib/pageflow_paged/engine.rb index 839b2e42a7..0e29ed3807 100644 --- a/entry_types/paged/lib/pageflow_paged/engine.rb +++ b/entry_types/paged/lib/pageflow_paged/engine.rb @@ -5,19 +5,15 @@ module PageflowPaged class Engine < ::Rails::Engine isolate_namespace PageflowPaged - if Pageflow::RailsVersion.experimental? - lib = root.join('lib') + lib = root.join('lib') - config.autoload_paths << lib - config.eager_load_paths << lib + config.autoload_paths << lib + config.eager_load_paths << lib - initializer 'pageflow_paged.autoloading' do - Rails.autoloaders.main.ignore( - lib.join('tasks') - ) - end - else - config.paths.add('lib', eager_load: true) + initializer 'pageflow_paged.autoloading' do + Rails.autoloaders.main.ignore( + lib.join('tasks') + ) end config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s] diff --git a/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb b/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb index e59ed33fe2..2ddd9d4af3 100644 --- a/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb +++ b/entry_types/scrolled/app/helpers/pageflow_scrolled/packs_helper.rb @@ -2,43 +2,24 @@ module PageflowScrolled # @api private module PacksHelper def scrolled_frontend_javascript_packs_tag(entry, options) - if defined?(Shakapacker) - javascript_pack_tag( - *scrolled_frontend_packs(entry, **options), - defer: false - ) - else - javascript_packs_with_chunks_tag( - *scrolled_frontend_packs(entry, **options) - ) - end + javascript_pack_tag( + *scrolled_frontend_packs(entry, **options), + defer: false + ) end def scrolled_frontend_stylesheet_packs_tag(entry, options) - if defined?(Shakapacker) - stylesheet_pack_tag( - *scrolled_frontend_packs(entry, **options), - media: 'all' - ) - else - stylesheet_packs_with_chunks_tag( - *scrolled_frontend_packs(entry, **options), - media: 'all' - ) - end + stylesheet_pack_tag( + *scrolled_frontend_packs(entry, **options), + media: 'all' + ) end def scrolled_editor_javascript_packs_tag(entry) - if defined?(Shakapacker) - javascript_pack_tag( - *scrolled_editor_packs(entry), - defer: false - ) - else - javascript_packs_with_chunks_tag( - *scrolled_editor_packs(entry) - ) - end + javascript_pack_tag( + *scrolled_editor_packs(entry), + defer: false + ) end def scrolled_frontend_packs(entry, widget_scope:) diff --git a/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb b/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb index 7d23245efc..e2a5668449 100644 --- a/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb +++ b/entry_types/scrolled/app/helpers/pageflow_scrolled/themes_helper.rb @@ -6,11 +6,9 @@ def scrolled_theme_asset_path(theme, theme_file_role: nil, theme_file_style: :resized, relative_url: false) - prefix = defined?(Shakapacker) ? 'static' : 'media' - path = theme.files.dig(theme_file_role, theme_file_style) || - asset_pack_path("#{prefix}/pageflow-scrolled/themes/#{theme.name}/#{path}") + asset_pack_path("static/pageflow-scrolled/themes/#{theme.name}/#{path}") if relative_url URI.parse(path).path diff --git a/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb b/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb index a3003542e9..2eb0909338 100644 --- a/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb +++ b/entry_types/scrolled/app/views/pageflow_scrolled/editor/entries/_head.html.erb @@ -1,10 +1,5 @@ <%= stylesheet_link_tag 'pageflow_paged/editor', media: 'all' %> - -<% if defined?(Shakapacker) %> - <%= stylesheet_pack_tag 'pageflow-scrolled-frontend' %> -<% else %> - <%= stylesheet_packs_with_chunks_tag 'pageflow-scrolled-frontend' %> -<% end %> +<%= stylesheet_pack_tag 'pageflow-scrolled-frontend' %> <%= scrolled_theme_properties_style_tag(entry.theme) %> <%= scrolled_theme_stylesheet_pack_tags(entry.theme) %> diff --git a/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb b/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb index 9adcde9d57..4a5bc2b2cc 100644 --- a/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +++ b/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb @@ -30,20 +30,14 @@ def theme_plugin end def install_packages - if defined?(Shakapacker) - run 'yarn add css-loader style-loader' \ - ' mini-css-extract-plugin css-minimizer-webpack-plugin' \ - ' postcss postcss-preset-env postcss-loader' \ - ' postcss-import postcss-url postcss-flexbugs-fixes' \ - ' @fontsource/source-sans-pro' - else - run 'yarn add postcss-url@^8.0.0 @fontsource/source-sans-pro' - end + run 'yarn add css-loader style-loader' \ + ' mini-css-extract-plugin css-minimizer-webpack-plugin' \ + ' postcss postcss-preset-env postcss-loader' \ + ' postcss-import postcss-url postcss-flexbugs-fixes' \ + ' @fontsource/source-sans-pro' end def webpack_config - return unless defined?(Shakapacker) - gsub_file( 'config/webpack/webpack.config.js', "const { generateWebpackConfig } = require('shakapacker')", @@ -92,65 +86,23 @@ def webpack_config ) end - def webpack_environment - return if defined?(Shakapacker) - - inject_into_file('config/webpack/environment.js', - before: "module.exports = environment\n") do - "environment.config.merge(require('pageflow/config/webpack'))\n" \ - "environment.config.merge(require('pageflow-scrolled/config/webpack'))\n\n" \ - "// Allow loading only chunks of used widgets. runtimeChunk 'single'\n" \ - "// ensures that modules are only evaluated once which is important\n" \ - "// for modules with side effects.\n" \ - "environment.splitChunks((config) =>\n" \ - " Object.assign({}, config, { optimization: { runtimeChunk: 'single' }})\n" \ - ")\n\n" \ - "// Opt into future default behavior of Webpacker [1] to work around\n" \ - "// problems with Video.js DASH service worker.\n" \ - "//\n" \ - "// [1] https://github.com/rails/webpacker/pull/2624\n" \ - "environment.loaders.delete('nodeModules')\n\n" - end - end - - def webpacker_yml - return if defined?(Shakapacker) - - gsub_file('config/webpacker.yml', - 'extract_css: false', - 'extract_css: true') - - inject_into_file('config/webpacker.yml', - after: "- .woff2\n") do - " - .mp3\n - .webmanifest\n - .xml\n" - end - end - def postcss_config - if defined?(Shakapacker) - create_file 'postcss.config.js', <<~JS - module.exports = { - plugins: [ - require('postcss-import'), - // Make relative urls in fontsource packages work - require('postcss-url')({url: 'rebase'}), - require('postcss-flexbugs-fixes'), - require('postcss-preset-env')({ - autoprefixer: { - flexbox: 'no-2009' - }, - stage: 3 - }) - ] - } - JS - else - inject_into_file('postcss.config.js', - after: "require('postcss-import'),\n") do - " // Make relative urls in fontsource packages work\n" \ - " require('postcss-url')({url: 'rebase'}),\n" - end - end + create_file 'postcss.config.js', <<~JS + module.exports = { + plugins: [ + require('postcss-import'), + // Make relative urls in fontsource packages work + require('postcss-url')({url: 'rebase'}), + require('postcss-flexbugs-fixes'), + require('postcss-preset-env')({ + autoprefixer: { + flexbox: 'no-2009' + }, + stage: 3 + }) + ] + } + JS end def editor_pack diff --git a/entry_types/scrolled/lib/pageflow_scrolled/engine.rb b/entry_types/scrolled/lib/pageflow_scrolled/engine.rb index 25f49ddad6..64be526c6e 100644 --- a/entry_types/scrolled/lib/pageflow_scrolled/engine.rb +++ b/entry_types/scrolled/lib/pageflow_scrolled/engine.rb @@ -6,20 +6,16 @@ module PageflowScrolled class Engine < ::Rails::Engine isolate_namespace PageflowScrolled - if Pageflow::RailsVersion.experimental? - lib = root.join('lib') + lib = root.join('lib') - config.autoload_paths << lib - config.eager_load_paths << lib + config.autoload_paths << lib + config.eager_load_paths << lib - initializer 'pageflow_scrolled.autoloading' do - Rails.autoloaders.main.ignore( - lib.join('generators'), - lib.join('tasks') - ) - end - else - config.paths.add('lib', eager_load: true) + initializer 'pageflow_scrolled.autoloading' do + Rails.autoloaders.main.ignore( + lib.join('generators'), + lib.join('tasks') + ) end config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s] diff --git a/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake b/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake index 96801ef6e0..22063fe0ed 100644 --- a/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake +++ b/entry_types/scrolled/lib/tasks/pageflow_scrolled/dummy.rake @@ -2,7 +2,7 @@ namespace :pageflow_scrolled do desc 'Generate dummy app for current Rails version.' task :dummy do require 'pageflow/support' - ENV['PAGEFLOW_INSTALL_WEBPACKER'] = 'true' + ENV['PAGEFLOW_INSTALL_SHAKAPACKER'] = 'true' Pageflow::Dummy.setup end end diff --git a/entry_types/scrolled/spec/spec_helper.rb b/entry_types/scrolled/spec/spec_helper.rb index 06124c18e0..5b6ae7fb4a 100644 --- a/entry_types/scrolled/spec/spec_helper.rb +++ b/entry_types/scrolled/spec/spec_helper.rb @@ -1,6 +1,6 @@ ENV['RAILS_ENV'] ||= 'test' ENV['PAGEFLOW_PLUGIN_ENGINE'] = 'pageflow_scrolled' -ENV['PAGEFLOW_INSTALL_WEBPACKER'] = 'true' +ENV['PAGEFLOW_INSTALL_SHAKAPACKER'] = 'true' require 'pageflow/support' Pageflow::Dummy.setup @@ -21,12 +21,7 @@ RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = '.rspec_status' - - if Pageflow::RailsVersion.experimental? - config.file_fixture_path = './spec/fixtures' - else - config.fixture_path = './spec/fixtures' - end + config.file_fixture_path = './spec/fixtures' # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! diff --git a/entry_types/scrolled/spec/support/config/webpacker.rb b/entry_types/scrolled/spec/support/config/webpacker.rb deleted file mode 100644 index 2c442555af..0000000000 --- a/entry_types/scrolled/spec/support/config/webpacker.rb +++ /dev/null @@ -1,10 +0,0 @@ -unless defined?(Shakapacker) - # Make sure packs are recompiled for Capybara specs when Rollup - # outputs change - - Webpacker::Compiler.watched_paths << Pageflow::Engine.root.join('package/*.js') - Webpacker::Compiler.watched_paths << PageflowScrolled::Engine.root.join('package/*.js') - - # see https://github.com/rails/webpacker/issues/2410 - Webpacker::Compiler.watched_paths << Rails.root.join('app/javascript/**/*.js') -end diff --git a/lib/pageflow/engine.rb b/lib/pageflow/engine.rb index 01dc40cbec..b4666168f4 100644 --- a/lib/pageflow/engine.rb +++ b/lib/pageflow/engine.rb @@ -43,64 +43,21 @@ module Pageflow class Engine < ::Rails::Engine isolate_namespace Pageflow - if Pageflow::RailsVersion.experimental? - config.autoload_paths << root.join('app/views/components') - config.eager_load_paths << root.join('app/views/components') - - lib = root.join('lib') - - config.autoload_paths << lib - config.eager_load_paths << lib - - initializer 'pageflow.autoloading' do - Rails.autoloaders.main.ignore( - lib.join('generators'), - lib.join('tasks'), - lib.join('pageflow/paperclip_processors'), - lib.join('pageflow/version.rb') - ) - end - else - config.paths.add('app/views/components', autoload: true) - config.paths.add('lib', autoload: true) - - def eager_load! - # Manually eager load `lib/pageflow` as the least bad option: - # - # - Autoload paths are not eager loaded in production. - # - # - `lib` cannot be an eager load path since otherwise templates - # in `lib/generators` are also executed. - # - # - `lib/pageflow` cannot be an eager load path since eager load - # paths are automatically used as autoload paths. That way - # `lib/pageflow/admin/something.rb` could be autoloaded via - # `Admin::Something`. - # - # - Using `require` in `lib/pageflow.rb` disables code - # reloading. - # - # - Using `require_dependency` in `lib/pageflow.rb` does not - # activate code reloading either since it requires the - # autoload path to be set up correctly, which only happens - # during initialization. - super - - lib_path = config.root.join('lib') - matcher = %r{\A#{Regexp.escape(lib_path.to_s)}/(.*)\.rb\Z} - - already_required_files = [ - 'pageflow/engine', - 'pageflow/global_config_api', - 'pageflow/news_item_api', - 'pageflow/version' - ] - - Dir.glob("#{lib_path}/pageflow/**/*.rb").sort.each do |file| - logical_path = file.sub(matcher, '\1') - require_dependency(logical_path) unless already_required_files.include?(logical_path) - end - end + config.autoload_paths << root.join('app/views/components') + config.eager_load_paths << root.join('app/views/components') + + lib = root.join('lib') + + config.autoload_paths << lib + config.eager_load_paths << lib + + initializer 'pageflow.autoloading' do + Rails.autoloaders.main.ignore( + lib.join('generators'), + lib.join('tasks'), + lib.join('pageflow/paperclip_processors'), + lib.join('pageflow/version.rb') + ) end config.i18n.load_path += Dir[config.root.join('config', 'locales', '**', '*.yml').to_s] diff --git a/pageflow.gemspec b/pageflow.gemspec index 4a67b1b710..12c6012f93 100644 --- a/pageflow.gemspec +++ b/pageflow.gemspec @@ -25,18 +25,10 @@ Gem::Specification.new do |s| s.require_paths = ['lib', 'entry_types/paged/lib', 'entry_types/scrolled/lib'] - if Pageflow::RailsVersion.experimental? - s.add_dependency 'rails', '~> 6.1.0' - else - s.add_dependency 'rails', '~> 5.2.0' - end + s.add_dependency 'rails', '~> 6.1.0' # Framework for admin interface - if Pageflow::RailsVersion.experimental? - s.add_dependency 'activeadmin', '~> 3.0' - else - s.add_dependency 'activeadmin', ['>= 1.3.0', '< 3'] - end + s.add_dependency 'activeadmin', '~> 3.0' # Searchable select boxes for filters and forms s.add_dependency 'activeadmin-searchable_select', '~> 1.0' @@ -51,28 +43,16 @@ Gem::Specification.new do |s| s.add_dependency 'yajl-ruby', '~> 1.2' # Authorization - if Pageflow::RailsVersion.experimental? - s.add_dependency 'cancancan', '~> 3.5' - else - s.add_dependency 'cancancan', '~> 1.10' - end + s.add_dependency 'cancancan', '~> 3.5' # State machines for active record - if Pageflow::RailsVersion.experimental? - s.add_dependency 'state_machines-activerecord', '~> 0.9.0' - else - s.add_dependency 'state_machines-activerecord', '~> 0.5.1' - end + s.add_dependency 'state_machines-activerecord', '~> 0.9.0' # Trigger resque jobs with a state machine s.add_dependency 'state_machine_job', '~> 3.0' # File attachments - if Pageflow::RailsVersion.experimental? - s.add_dependency 'kt-paperclip', '~> 7.2' - else - s.add_dependency 'paperclip', '~> 6.1' - end + s.add_dependency 'kt-paperclip', '~> 7.2' # Image processing s.add_dependency 'ruby-vips', '~> 2.2' @@ -161,11 +141,7 @@ Gem::Specification.new do |s| s.add_dependency 'symmetric-encryption', '~> 4.3.1' # Used for Webpack build in host application - if Pageflow::RailsVersion.experimental? - s.add_development_dependency 'shakapacker', '~> 7.0' - else - s.add_development_dependency 'webpacker', '~> 4.2' - end + s.add_development_dependency 'shakapacker', '~> 7.0' # Used by the dummy rails application s.add_development_dependency 'mysql2', '~> 0.5.2' @@ -174,11 +150,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'resque', '~> 1.25' s.add_development_dependency 'resque-scheduler', '~> 2.5' - if Pageflow::RailsVersion.experimental? - s.add_development_dependency 'ar_after_transaction', '~> 0.8.0' - else - s.add_development_dependency 'ar_after_transaction', '~> 0.5.0' - end + s.add_development_dependency 'ar_after_transaction', '~> 0.8.0' s.add_development_dependency 'redis', '~> 3.0' s.add_development_dependency 'redis-namespace', '~> 1.5' @@ -187,11 +159,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'sassc-rails', '~> 2.1' # Testing framework - if Pageflow::RailsVersion.experimental? - s.add_development_dependency 'rspec-rails', '~> 6.0' - else - s.add_development_dependency 'rspec-rails', '~> 3.4' - end + s.add_development_dependency 'rspec-rails', '~> 6.0' # Matchers like "to have(3).items" s.add_development_dependency 'rspec-collection_matchers', '~> 1.1' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2123e571aa..fb54514be3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -28,12 +28,7 @@ end config.example_status_persistence_file_path = './tmp/rspec_failures' - - if Pageflow::RailsVersion.experimental? - config.file_fixture_path = './spec/fixtures' - else - config.fixture_path = './spec/fixtures' - end + config.file_fixture_path = './spec/fixtures' config.order = "random" end diff --git a/spec/support/dominos/admin/filter_form.rb b/spec/support/dominos/admin/filter_form.rb index 49851fce51..16e6669bf6 100644 --- a/spec/support/dominos/admin/filter_form.rb +++ b/spec/support/dominos/admin/filter_form.rb @@ -5,13 +5,8 @@ class FilterForm < Domino def fill_in_date_range(attribute, options) within(node) do - if Pageflow::RailsVersion.experimental? - fill_in("q[#{attribute}_gteq]", with: options[:from]) - fill_in("q[#{attribute}_lteq]", with: options[:to]) - else - fill_in("q[#{attribute}_gteq_datetime]", with: options[:from]) - fill_in("q[#{attribute}_lteq_datetime]", with: options[:to]) - end + fill_in("q[#{attribute}_gteq]", with: options[:from]) + fill_in("q[#{attribute}_lteq]", with: options[:to]) end end diff --git a/spec/support/pageflow-support.gemspec b/spec/support/pageflow-support.gemspec index a1d1a0bd4c..d1ba953ebb 100644 --- a/spec/support/pageflow-support.gemspec +++ b/spec/support/pageflow-support.gemspec @@ -28,11 +28,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'resque', '~> 1.25' s.add_runtime_dependency 'resque-scheduler', '~> 2.5' - if Pageflow::RailsVersion.experimental? - s.add_runtime_dependency 'ar_after_transaction', '~> 0.8.0' - else - s.add_runtime_dependency 'ar_after_transaction', '~> 0.5.0' - end + s.add_runtime_dependency 'ar_after_transaction', '~> 0.8.0' s.add_runtime_dependency 'redis', '~> 3.0' s.add_runtime_dependency 'redis-namespace', '~> 1.5' diff --git a/spec/support/pageflow/dummy/app.rb b/spec/support/pageflow/dummy/app.rb index 91331df8ea..5cd390c5c1 100644 --- a/spec/support/pageflow/dummy/app.rb +++ b/spec/support/pageflow/dummy/app.rb @@ -31,7 +31,7 @@ def template_path def rails_new_options result = '--skip-test-unit --skip-bundle --database=mysql' - result << ' --skip-javascript' if Pageflow::RailsVersion.experimental? + result << ' --skip-javascript' result end end diff --git a/spec/support/pageflow/dummy/rails_template.rb b/spec/support/pageflow/dummy/rails_template.rb index c41586daa6..bbdcb77289 100644 --- a/spec/support/pageflow/dummy/rails_template.rb +++ b/spec/support/pageflow/dummy/rails_template.rb @@ -44,11 +44,7 @@ def source_paths # Install Webpacker -if Pageflow::RailsVersion.experimental? - rake 'shakapacker:install' if ENV['PAGEFLOW_INSTALL_WEBPACKER'] == 'true' -else - rake 'webpacker:install' if ENV['PAGEFLOW_INSTALL_WEBPACKER'] == 'true' -end +rake 'shakapacker:install' if ENV['PAGEFLOW_INSTALL_SHAKAPACKER'] == 'true' # Install pageflow and the tested engine via their generators.