LEFT | RIGHT |
1 #!/usr/bin/ruby1.8 -w | 1 #!/usr/bin/ruby1.8 -w |
2 # | 2 # |
3 # Copyright:: Copyright 2009 Google Inc. | 3 # Copyright:: Copyright 2009 Google Inc. |
4 # Original Author:: Ryan Brown (mailto:ribrdb@google.com) | 4 # Original Author:: Ryan Brown (mailto:ribrdb@google.com) |
5 # | 5 # |
6 # Licensed under the Apache License, Version 2.0 (the "License"); | 6 # Licensed under the Apache License, Version 2.0 (the "License"); |
7 # you may not use this file except in compliance with the License. | 7 # you may not use this file except in compliance with the License. |
8 # You may obtain a copy of the License at | 8 # You may obtain a copy of the License at |
9 # | 9 # |
10 # http://www.apache.org/licenses/LICENSE-2.0 | 10 # http://www.apache.org/licenses/LICENSE-2.0 |
(...skipping 23 matching lines...) Expand all Loading... |
34 def skip_rack_servlet | 34 def skip_rack_servlet |
35 @skip_defaults = true | 35 @skip_defaults = true |
36 end | 36 end |
37 ·· | 37 ·· |
38 def add_jruby_rack_defaults(rackup) | 38 def add_jruby_rack_defaults(rackup) |
39 use JavaContextParams, :rackup => rackup | 39 use JavaContextParams, :rackup => rackup |
40 unless @skip_defaults | 40 unless @skip_defaults |
41 use JavaServletFilter, 'org.jruby.rack.RackFilter',· | 41 use JavaServletFilter, 'org.jruby.rack.RackFilter',· |
42 { :name => 'RackFilter', :wildcard => true } | 42 { :name => 'RackFilter', :wildcard => true } |
43 end | 43 end |
44 # TODO: we need a servlet that calls LoadOnFirstRequestApplicationFactory | 44 use JavaContextListener, 'com.google.appengine.jruby.LazyContextListener' |
45 use JavaContextListener, 'org.jruby.rack.RackServletContextListener' | |
46 end | 45 end |
47 ·· | 46 ·· |
48 def use(middleware, *args, &block) | 47 def use(middleware, *args, &block) |
49 if middleware.respond_to? :append_xml | 48 if middleware.respond_to? :append_xml |
50 @paths[@path] << [middleware, args, block] | 49 @paths[@path] << [middleware, args, block] |
51 else | 50 else |
52 @paths[@path] << [middleware.new(DUMMY_APP, *args, &block)] | 51 @paths[@path] << [middleware.new(DUMMY_APP, *args, &block)] |
53 end | 52 end |
54 end | 53 end |
55 ·· | 54 ·· |
(...skipping 29 matching lines...) Expand all Loading... |
85 doc | 84 doc |
86 end | 85 end |
87 ·· | 86 ·· |
88 private | 87 private |
89 def each_path | 88 def each_path |
90 @paths.sort {|a, b| b[0].length - a[0].length}.each do |path, value| | 89 @paths.sort {|a, b| b[0].length - a[0].length}.each do |path, value| |
91 yield path, value | 90 yield path, value |
92 end | 91 end |
93 end | 92 end |
94 end | 93 end |
LEFT | RIGHT |