::CGI
Used to wrap the normal args variable used inside CGI.
# File lib/rack/adapter/rails.rb, line 162
162: def args
163: @args
164: end
Used to wrap the normal env_table variable used inside CGI.
# File lib/rack/adapter/rails.rb, line 167
167: def env_table
168: @request.env
169: end
# File lib/rack/adapter/rails.rb, line 105
105: def header(options = "text/html")
106: if options.is_a?(String)
107: @response['Content-Type'] = options unless @response['Content-Type']
108: else
109: @response['Content-Length'] = options.delete('Content-Length').to_s if options['Content-Length']
110:
111: @response['Content-Type'] = options.delete('type') || "text/html"
112: @response['Content-Type'] += "; charset=" + options.delete('charset') if options['charset']
113:
114: @response['Content-Language'] = options.delete('language') if options['language']
115: @response['Expires'] = options.delete('expires') if options['expires']
116:
117: @response.status = options.delete('Status') if options['Status']
118:
119: # Convert 'cookie' header to 'Set-Cookie' headers.
120: # Because Set-Cookie header can appear more the once in the response body,
121: # we store it in a line break seperated string that will be translated to
122: # multiple Set-Cookie header by the handler.
123: if cookie = options.delete('cookie')
124: cookies = []
125:
126: case cookie
127: when Array then cookie.each { |c| cookies << c.to_s }
128: when Hash then cookie.each { |_, c| cookies << c.to_s }
129: else cookies << cookie.to_s
130: end
131:
132: @output_cookies.each { |c| cookies << c.to_s } if @output_cookies
133:
134: @response['Set-Cookie'] = [@response['Set-Cookie'], cookies].compact
135: # See http://groups.google.com/group/rack-devel/browse_thread/thread/e8759b91a82c5a10/a8dbd4574fe97d69?#a8dbd4574fe97d69
136: if Thin.ruby_18?
137: @response['Set-Cookie'].flatten!
138: else
139: @response['Set-Cookie'] = @response['Set-Cookie'].join("\n")
140: end
141: end
142:
143: options.each { |k,v| @response[k] = v }
144: end
145:
146: ""
147: end
# File lib/rack/adapter/rails.rb, line 149
149: def params
150: @params ||= @request.params
151: end
# File lib/rack/adapter/rails.rb, line 157
157: def query_string
158: @request.query_string
159: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.