2017-09-25 12:04:04 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-26 00:58:12 +10:00
|
|
|
namespace :assets do
|
|
|
|
desc 'Generate 500.html'
|
|
|
|
task :generate_500 do
|
2017-09-26 07:05:54 +10:00
|
|
|
I18n.with_locale(ENV['DEFAULT_LOCALE'] || I18n.default_locale) do
|
|
|
|
html = ApplicationController.render('errors/500', layout: 'error')
|
|
|
|
File.write(Rails.root.join('public', '500.html'), html)
|
|
|
|
end
|
2017-09-25 12:04:04 +10:00
|
|
|
end
|
|
|
|
end
|
2017-09-26 00:58:12 +10:00
|
|
|
|
|
|
|
if Rake::Task.task_defined?('assets:precompile')
|
|
|
|
Rake::Task['assets:precompile'].enhance do
|
|
|
|
Webpacker::Manifest.load
|
|
|
|
Rake::Task['assets:generate_500'].invoke
|
|
|
|
end
|
|
|
|
end
|