lib/appengine-tools/web-xml.rb in appengine-tools-0.0.4 vs lib/appengine-tools/web-xml.rb in appengine-tools-0.0.5
- old
+ new
@@ -25,17 +25,24 @@
DUMMY_APP = Proc.new{|env|}
def initialize(&block)
@path = "/"
@paths = Hash.new {|h, k| h[k] = []}
+ @skip_defaults = false
instance_eval(&block) if block_given?
end
+ def skip_rack_servlet
+ @skip_defaults = true
+ end
+
def add_jruby_rack_defaults(rackup)
use JavaContextParams, :rackup => rackup
- use JavaServletFilter, 'org.jruby.rack.RackFilter',
- { :name => 'RackFilter', :wildcard => true }
- use JavaContextListener, 'org.jruby.rack.RackServletContextListener'
+ unless @skip_defaults
+ use JavaServletFilter, 'org.jruby.rack.RackFilter',
+ { :name => 'RackFilter', :wildcard => true }
+ end
+ use JavaContextListener, 'com.google.appengine.jruby.LazyContextListener'
end
def use(middleware, *args, &block)
if middleware.respond_to? :append_xml
@paths[@path] << [middleware, args, block]