Skip to content

Commit

Permalink
Use Rails.version to get actual rails version
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Feb 14, 2022
1 parent 9c89098 commit e149611
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/engine_cart/tasks/engine_cart.rake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ 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 ...
pid = fork do
Expand Down Expand Up @@ -66,7 +68,7 @@ namespace :engine_cart do
Rake::Task['engine_cart:clean'].invoke if File.exist? EngineCart.destination
FileUtils.move "#{dir}/internal", "#{EngineCart.destination}"

if Gem.loaded_specs['rails'].version.to_s < '5.2.3'
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|
Expand Down

0 comments on commit e149611

Please sign in to comment.