ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Ryan Dahl (author)
Fri Mar 14 17:51:28 -0700 2008
commit  b128ee31d3751baae5229187a8f6ad865dba63d1
tree    188fbde21cd4b1b860eb691df212bf3d981f380f
parent  26e7c927f672e4a589e50387ec846c4d89a6b81e
ebb / bin / ebb_rails
100755 33 lines (29 sloc) 0.783 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
31
32
33
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../ruby_lib/ebb'
require 'optparse'
require 'rubygems'
require 'rack'
 
module Rack
  module Adapter
    autoload :Rails, Ebb::LIBDIR + '/rack/adapter/rails'
  end
end
 
Ebb::Runner.new('ebb_rails') do
  def add_extra_options(parser, options)
    # defaults for ebb_rails
    options.update(
      :environment => 'development',
      :port => 3000,
      # rails has a massive mutex lock around each request - threaded processing
      # will only slow things down
      :threaded_processing => false
    )
    
    parser.on("-e", "--env ENV",
            "Rails environment (default: development)") do |env|
      options[:environment] = env
    end
  end
  
  def app(options)
    Rack::Adapter::Rails.new(options)
  end
end