public
Description: Rack for JRuby and Java appservers
Homepage: http://wiki.jruby.org/wiki/JRuby_Rack
Clone URL: git://github.com/nicksieger/jruby-rack.git
Search Repo:
Update JRuby-Rack to use JRuby 1.1.3

- fix some broken specs and stub some action_controller code
  so that we can build w/o rails installed

git-svn-id: https://svn.codehaus.org/jruby-contrib/trunk/rack@196 
97a6c6ee-731e-0410-87e5-e5612b5efbfe
nsieger (author)
Tue Jul 22 11:41:32 -0700 2008
commit  df680ffab209ecf7ace3b369f4c3ff207fcd4092
tree    2036404a9ffad0083957b7938e3ecba626d8e4bb
parent  3ac1b841cfdf23dd791d00d153b4605bba25705b
...
6
7
8
9
10
11
 
12
13
14
...
6
7
8
 
 
 
9
10
11
12
0
@@ -6,9 +6,7 @@
0
 
0
 repositories.remote << "http://repo1.maven.org/maven2" << "http://snapshots.repository.codehaus.org"
0
 
0
-JRUBY = 'org.jruby:jruby-complete:jar:1.1.1'
0
-
0
-require './src/jruby-trunk-fix.rb'
0
+JRUBY = 'org.jruby:jruby-complete:jar:1.1.3'
0
 
0
 desc 'JRuby Rack adapter'
0
 define 'jruby-rack' do
...
94
95
96
97
 
 
98
99
100
...
94
95
96
 
97
98
99
100
101
0
@@ -94,7 +94,8 @@ module Rack
0
       end
0
 
0
       def load__CONTENT_TYPE(env)
0
- env["CONTENT_TYPE"] = @servlet_env.getContentType
0
+ content_type = @servlet_env.getContentType
0
+ env["CONTENT_TYPE"] = content_type if content_type
0
       end
0
 
0
       def load__CONTENT_LENGTH(env)
...
193
194
195
196
 
197
198
 
199
200
201
...
206
207
208
209
 
210
211
 
212
213
214
...
193
194
195
 
196
197
 
198
199
200
201
...
206
207
208
 
209
210
 
211
212
213
214
0
@@ -193,9 +193,9 @@ describe Rack::Handler::Servlet do
0
       env["CONTENT_TYPE"].should == "text/html"
0
       env["CONTENT_LENGTH"].should == "10"
0
       env["HTTP_CONTENT_TYPE"].should == nil
0
- env.should_not have_key?("HTTP_CONTENT_TYPE")
0
+ env.should_not have_key("HTTP_CONTENT_TYPE")
0
       env["HTTP_CONTENT_LENGTH"].should == nil
0
- env.should_not have_key?("HTTP_CONTENT_LENGTH")
0
+ env.should_not have_key("HTTP_CONTENT_LENGTH")
0
     end
0
 
0
     it "should put the other headers in the hash upcased and underscored and prefixed with HTTP_" do
0
@@ -206,9 +206,9 @@ describe Rack::Handler::Servlet do
0
 
0
       env = @servlet.create_env @servlet_env
0
       env["CONTENT_TYPE"].should == nil
0
- env.should_not have_key?("CONTENT_TYPE")
0
+ env.should_not have_key("CONTENT_TYPE")
0
       env["CONTENT_LENGTH"].should == nil
0
- env.should_not have_key?("CONTENT_LENGTH")
0
+ env.should_not have_key("CONTENT_LENGTH")
0
       env["HTTP_HOST"].should == "localhost"
0
       env["HTTP_ACCEPT"].should == "text/*"
0
       env["HTTP_ACCEPT_ENCODING"].should == "gzip"
...
9
10
11
 
 
 
 
12
13
14
 
 
 
 
 
 
 
 
 
 
15
16
17
18
19
20
21
22
23
...
9
10
11
12
13
14
15
16
17
 
18
19
20
21
22
23
24
25
26
27
28
29
 
 
 
 
30
31
32
0
@@ -9,15 +9,24 @@
0
 #++
0
 
0
 module ActionController
0
+ class CgiRequest
0
+ DEFAULT_SESSION_OPTIONS = {}
0
+ end
0
+
0
   class Base
0
     class << self
0
- attr_accessor :page_cache_directory, :session_store
0
+ attr_accessor :page_cache_directory
0
+ def session_store
0
+ ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager]
0
+ end
0
+ def session_store=(store)
0
+ # Faking camelize so we don't have to have active_support installed
0
+ camelized_store = store.to_s.gsub(/(?:^|_)([a-z])/) {|match| match[-1,1].upcase}
0
+ ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] =
0
+ store.is_a?(Symbol) ? CGI::Session.const_get(store == :drb_store ? "DRbStore" : camelized_store) : store
0
+ end
0
     end
0
   end
0
-
0
- class CgiRequest
0
- DEFAULT_SESSION_OPTIONS = {}
0
- end
0
 end
0
 
0
 module ActionView
...
8
9
10
 
 
11
12
13
...
8
9
10
11
12
13
14
15
0
@@ -8,6 +8,8 @@ require 'java'
0
 require 'rubygems'
0
 gem 'rspec'
0
 require 'spec'
0
+# add to load path for stubbed out action_controller
0
+$LOAD_PATH << File.dirname(__FILE__) + '/rails'
0
 
0
 Spec::Runner.configure do |config|
0
   def mock_servlet_context

Comments

    No one has commented yet.