Class: RuhRoh::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/ruh_roh/generator.rb

Instance Method Summary collapse

Instance Method Details

#generate!Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/ruh_roh/generator.rb', line 5

def generate!
  config.handled_errors.each do |action|
    app.get "/error/#{action}"
    if app.response.code == "200"
      File.open("public/#{action}.html", "w") { |f| f.write app.response.body }
    else
      raise app.response.body
    end
  end
end