Sha256: 1856d785fc82f65ab6516b05a5b664fbd3d8afad98755efc9d505120dbd5ce87

Contents?: true

Size: 499 Bytes

Versions: 1

Compression:

Stored size: 499 Bytes

Contents

namespace :gen do

  desc "Generate static error pages"
  task :static_pages => :environment do
    app = ActionDispatch::Integration::Session.new Rails.application
    ExceptionsApp.config.errors_path.each do |path|
      app.get path
      response = app.response
      unless response.body.empty?
        File.open("#{ExceptionsApp.config.statics_path}/#{response.status}.html", "w") { |file| file.write(response.body) }
      end
    end
    puts "Static pages generated successfully"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
exceptions_app-0.0.1 lib/tasks/exceptions_app.rake