ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Search Repo:
Ryan Dahl (author)
Mon Mar 17 06:14:55 -0700 2008
commit  7dcfc536c96e944907396069075db87ee422b206
tree    eb97b2560590a6cf80ca0143074eb32ac2efb548
parent  eb55b568610bf4d33ebc59ef7ff79838544617aa
ebb / bin / ebb_rails
100755 38 lines (33 sloc) 0.881 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
34
35
36
37
38
#!/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
 
class EbbRails < Ebb::Runner
  def extra_options
    # defaults for ebb_rails
    @options.update(
      :environment => 'development',
      :port => 3000,
      # rails has a 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
    @parser.on("-c", "--chdir DIR", "RAILS_ROOT directory") do |c|
      @options[:root] = c
    end
  end
  
  def app(options)
    Rack::Adapter::Rails.new(options)
  end
end
 
EbbRails.new(ARGV).run