mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #39708 from jonathanhefner/finish_template-goes-last
Ensure principle tasks go before finish_template
This commit is contained in:
commit
c418fb9fe9
2 changed files with 12 additions and 6 deletions
|
@ -491,6 +491,12 @@ module Rails
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def delete_active_job_folder_if_skipping_active_job
|
||||||
|
if options[:skip_active_job]
|
||||||
|
remove_dir "app/jobs"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def delete_action_mailer_files_skipping_action_mailer
|
def delete_action_mailer_files_skipping_action_mailer
|
||||||
if options[:skip_action_mailer]
|
if options[:skip_action_mailer]
|
||||||
remove_file "app/views/layouts/mailer.html.erb"
|
remove_file "app/views/layouts/mailer.html.erb"
|
||||||
|
@ -536,12 +542,6 @@ module Rails
|
||||||
build(:leftovers)
|
build(:leftovers)
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_active_job_folder_if_skipping_active_job
|
|
||||||
if options[:skip_active_job]
|
|
||||||
remove_dir "app/jobs"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
public_task :apply_rails_template, :run_bundle
|
public_task :apply_rails_template, :run_bundle
|
||||||
public_task :generate_bundler_binstub, :generate_spring_binstub
|
public_task :generate_bundler_binstub, :generate_spring_binstub
|
||||||
public_task :run_webpack
|
public_task :run_webpack
|
||||||
|
|
|
@ -1078,6 +1078,12 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_principle_tasks_go_before_finish_template
|
||||||
|
tasks = generator.class.tasks.keys
|
||||||
|
|
||||||
|
assert_equal tasks.index("apply_rails_template") - 1, tasks.index("finish_template")
|
||||||
|
end
|
||||||
|
|
||||||
def test_after_bundle_callback
|
def test_after_bundle_callback
|
||||||
path = "http://example.org/rails_template"
|
path = "http://example.org/rails_template"
|
||||||
template = +%{ after_bundle { run 'echo ran after_bundle' } }
|
template = +%{ after_bundle { run 'echo ran after_bundle' } }
|
||||||
|
|
Loading…
Reference in a new issue