Fix up tests and runner
[ebb.git] / ruby_lib / ebb / runner / rails.rb
blob7709354d04e082cb5a4e1ce5aca69b52d881983d
1 module Rack
2   module Adapter
3     autoload :Rails, Ebb::LIBDIR + '/rack/adapter/rails'
4   end
5 end
7 module Ebb
8   class Runner  
9     class Rails < Runner
10       def extra_options
11         # defaults for ebb_rails
12         @options.update(
13           :environment => 'development',
14           :port => 3000,
15           # rails has a mutex lock around each request - threaded processing
16           # will only slow things down
17           :threaded_processing => false
18         )
20         @parser.on("-e", "--env ENV", 
21                 "Rails environment (default: development)") do |env| 
22           @options[:environment] = env
23         end
24         @parser.on("-c", "--chdir DIR", "RAILS_ROOT directory") do |c| 
25           @options[:root] = c
26         end
27       end
29       def app(options)
30         Rack::Adapter::Rails.new(options)
31       end
32     end
33   end
34 end