rewrite app.rb