Skip to content

Instantly share code, notes, and snippets.

@dyoder
Created November 6, 2008 23:02
Show Gist options
  • Save dyoder/22732 to your computer and use it in GitHub Desktop.
Save dyoder/22732 to your computer and use it in GitHub Desktop.
module Waves
module Foundations
module Compact
app.module_eval <<-_CODE
module Resources
class Map
include Waves::Resources::Mixin
handler( Exception ) do
Waves::Views::Errors.new( request ).server_error_500
end
handler( Waves::Dispatchers::NotFoundError ) do
Waves::Views::Errors.new( request ).not_found_404
end
end
end
module Configurations
class Development < Waves::Configurations::Default
log :level => :debug
host '127.0.0.1'
port 3000
server Waves::Servers::Mongrel
resource app::Resources::Map
end
class Production < Waves::Configurations::Default
log :level => :error, :output => ( "log.#{$$}" ), :rotation => :weekly
port 80
host '0.0.0.0'
server Waves::Servers::Mongrel
application do
use Rack::Session::Cookie, :key => 'rack.session',
# :domain => 'foo.com',
:path => '/',
:expire_after => 2592000,
:secret => 'Change it'
run ::Waves::Dispatchers::Default.new
end
end
end
_CODE
end
Waves << app
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment