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:
ebb / bin / ebb_rails
100755 30 lines (26 sloc) 0.63 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
#!/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
    )
    
    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