Oshuma / corrupt.rack

Bare-bones Rack based MVC framework.

Dale Campbell (author)
Sat Apr 18 22:03:27 -0700 2009
commit  0310468f158e7b4122ca695345b42b2e5845e30e
tree    4db38c4350433448a116b6dce768414e94d4380e
parent  cd4e5c42b5f51402354460cc9fcc040fc1dba53a
corrupt.rack / config.ru
100644 30 lines (25 sloc) 0.524 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'rack'
 
# Setup some Rack middleware.
static_paths = [
  '/favicon.ico',
  '/images',
  '/javascripts',
  '/stylesheets'
]
use Rack::Static, :urls => static_paths, :root => 'public'
 
# Corrupt this motherfucker.
ENV['CORRUPT_ENV'] ||= 'production'
 
begin
  # Try to load from ./vendor first.
  require File.join(Dir.pwd, 'vendor', 'corrupt')
rescue LoadError
  # Now try the gem.
  begin
    require 'corrupt'
  rescue LoadError
    require 'rubygems'
    require 'corrupt'
  end
end
 
Corrupt.boot!
run Corrupt::App