Skip to content

Commit

Permalink
Drop deprecated versions of Rails
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Dec 27, 2023
1 parent b850ff0 commit 8eaceb9
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 36 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
ruby:
- 2.7
rails_version:
- 5.2.8.1
- 6.0.5.1
- 6.1.6.1
- 7.0.3.1
steps:
Expand Down
10 changes: 0 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,3 @@ source 'https://rubygems.org'
gemspec

gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']

case ENV['RAILS_VERSION']
when /^6.0/
gem 'sass-rails', '>= 6'
gem 'webpacker', '~> 4.0'
when /^5.[12]/
gem 'sprockets', '< 4.0'
gem 'sass-rails', '~> 5.0'
gem 'thor', '~> 0.20'
end
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Rake tasks to generate a test application for a Rails Engine gem.
If you have a Rails Engine and want to test it, the suggested approach is a small dummy application that loads up a Rails application with your engine loaded. This dummy application is usually checked into source control and maintained with the application. This works great, until you want to test:

- different versions of Ruby (e.g. MRI and JRuby)
- different versions of Rails (Rails 5.0, 6.0)
- different versions of Rails (Rails 6.1, 7.1)
- different deployment environments (with and without devise, etc)

where each scenario may involve different configurations, Gemfiles, etc.
Expand Down
2 changes: 1 addition & 1 deletion engine_cart.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency 'rails', '>= 5.0'
spec.add_dependency 'rails', '>= 6.1'
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
end
14 changes: 2 additions & 12 deletions lib/engine_cart/gemfile_stanza.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module EngineCart
def self.gemfile_stanza_check_line
'engine_cart stanza: 2.5.0'
'engine_cart stanza: 2.6.0'
end

def self.gemfile_stanza_text
Expand All @@ -23,20 +23,10 @@ def self.gemfile_stanza_text
if ENV['RAILS_VERSION']
if ENV['RAILS_VERSION'] == 'edge'
gem 'rails', github: 'rails/rails'
ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge'
else
gem 'rails', ENV['RAILS_VERSION']
end
case ENV['RAILS_VERSION']
when /^6.0/
gem 'sass-rails', '>= 6'
gem 'webpacker', '~> 4.0'
when /^5.[12]/
gem 'sass-rails', '~> 5.0'
gem 'sprockets', '~> 3.7'
gem 'thor', '~> 0.20'
end
end
end
# END ENGINE_CART BLOCK
Expand Down
10 changes: 0 additions & 10 deletions lib/engine_cart/tasks/engine_cart.rake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace :engine_cart do
task :create_test_rails_app => [:setup] do
require 'tmpdir'
require 'fileutils'
require 'rails/version'

Dir.mktmpdir do |dir|
# Fork into a new process to avoid polluting the current one with the partial Rails environment ...
Expand Down Expand Up @@ -67,15 +66,6 @@ namespace :engine_cart do

Rake::Task['engine_cart:clean'].invoke if File.exist? EngineCart.destination
FileUtils.move "#{dir}/internal", "#{EngineCart.destination}"

if Rails.version < '5.2.3'
# Hack for https://github.com/rails/rails/issues/35153
gemfile = File.join(EngineCart.destination, 'Gemfile')
IO.write(gemfile, File.open(gemfile) do |f|
text = f.read
text.gsub(/^gem ["']sqlite3["']$/, 'gem "sqlite3", "~> 1.3.0"')
end)
end
end
end

Expand Down

0 comments on commit 8eaceb9

Please sign in to comment.