actionpack 2.3.2 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- data/CHANGELOG +5 -0
- data/Rakefile +10 -9
- data/lib/action_controller.rb +2 -7
- data/lib/action_controller/assertions/response_assertions.rb +11 -3
- data/lib/action_controller/base.rb +7 -2
- data/lib/action_controller/caching.rb +1 -1
- data/lib/action_controller/caching/actions.rb +9 -1
- data/lib/action_controller/caching/sweeper.rb +45 -0
- data/lib/action_controller/caching/sweeping.rb +0 -42
- data/lib/action_controller/failsafe.rb +40 -6
- data/lib/action_controller/flash.rb +11 -3
- data/lib/action_controller/http_authentication.rb +5 -2
- data/lib/action_controller/integration.rb +5 -12
- data/lib/action_controller/middlewares.rb +0 -1
- data/lib/action_controller/reloader.rb +34 -3
- data/lib/action_controller/request.rb +6 -2
- data/lib/action_controller/response.rb +2 -2
- data/lib/action_controller/routing/route_set.rb +2 -1
- data/lib/action_controller/streaming.rb +1 -1
- data/lib/action_controller/test_process.rb +9 -1
- data/lib/action_pack/version.rb +1 -1
- data/lib/action_view/helpers.rb +1 -1
- data/lib/action_view/helpers/asset_tag_helper.rb +21 -9
- data/lib/action_view/helpers/date_helper.rb +2 -2
- data/lib/action_view/helpers/form_helper.rb +25 -12
- data/lib/action_view/helpers/form_options_helper.rb +2 -0
- data/lib/action_view/helpers/form_tag_helper.rb +10 -4
- data/lib/action_view/helpers/number_helper.rb +1 -1
- data/lib/action_view/helpers/prototype_helper.rb +7 -7
- data/lib/action_view/helpers/scriptaculous_helper.rb +5 -5
- data/lib/action_view/helpers/text_helper.rb +3 -3
- data/lib/action_view/helpers/url_helper.rb +1 -1
- data/lib/action_view/paths.rb +1 -1
- data/lib/action_view/template.rb +22 -33
- data/test/abstract_unit.rb +1 -1
- data/test/activerecord/active_record_store_test.rb +3 -3
- data/test/controller/action_pack_assertions_test.rb +27 -0
- data/test/controller/caching_test.rb +39 -0
- data/test/controller/cookie_test.rb +10 -0
- data/test/controller/dispatcher_test.rb +9 -7
- data/test/controller/failsafe_test.rb +60 -0
- data/test/controller/filter_params_test.rb +2 -1
- data/test/controller/flash_test.rb +6 -1
- data/test/controller/http_digest_authentication_test.rb +34 -3
- data/test/controller/integration_test.rb +31 -3
- data/test/controller/redirect_test.rb +4 -1
- data/test/controller/reloader_test.rb +97 -0
- data/test/controller/render_test.rb +19 -9
- data/test/controller/request/multipart_params_parsing_test.rb +1 -62
- data/test/controller/request/test_request_test.rb +35 -0
- data/test/controller/request/url_encoded_params_parsing_test.rb +0 -38
- data/test/controller/request_test.rb +218 -230
- data/test/controller/resources_test.rb +8 -0
- data/test/controller/routing_test.rb +21 -0
- data/test/controller/send_file_test.rb +1 -1
- data/test/controller/session/cookie_store_test.rb +9 -32
- data/test/controller/test_test.rb +8 -0
- data/test/fixtures/failsafe/500.html +1 -0
- data/test/template/active_record_helper_test.rb +1 -1
- data/test/template/asset_tag_helper_test.rb +46 -0
- data/test/template/form_helper_test.rb +117 -6
- data/test/template/form_options_helper_test.rb +22 -0
- data/test/template/form_tag_helper_test.rb +23 -6
- data/test/template/prototype_helper_test.rb +11 -11
- data/test/template/template_test.rb +32 -0
- metadata +20 -63
- data/lib/action_controller/rewindable_input.rb +0 -28
- data/lib/action_controller/vendor/rack-1.0/rack.rb +0 -89
- data/lib/action_controller/vendor/rack-1.0/rack/adapter/camping.rb +0 -22
- data/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb +0 -37
- data/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/request.rb +0 -37
- data/lib/action_controller/vendor/rack-1.0/rack/auth/basic.rb +0 -58
- data/lib/action_controller/vendor/rack-1.0/rack/auth/digest/md5.rb +0 -124
- data/lib/action_controller/vendor/rack-1.0/rack/auth/digest/nonce.rb +0 -51
- data/lib/action_controller/vendor/rack-1.0/rack/auth/digest/params.rb +0 -55
- data/lib/action_controller/vendor/rack-1.0/rack/auth/digest/request.rb +0 -40
- data/lib/action_controller/vendor/rack-1.0/rack/auth/openid.rb +0 -480
- data/lib/action_controller/vendor/rack-1.0/rack/builder.rb +0 -63
- data/lib/action_controller/vendor/rack-1.0/rack/cascade.rb +0 -36
- data/lib/action_controller/vendor/rack-1.0/rack/chunked.rb +0 -49
- data/lib/action_controller/vendor/rack-1.0/rack/commonlogger.rb +0 -61
- data/lib/action_controller/vendor/rack-1.0/rack/conditionalget.rb +0 -45
- data/lib/action_controller/vendor/rack-1.0/rack/content_length.rb +0 -29
- data/lib/action_controller/vendor/rack-1.0/rack/content_type.rb +0 -23
- data/lib/action_controller/vendor/rack-1.0/rack/deflater.rb +0 -85
- data/lib/action_controller/vendor/rack-1.0/rack/directory.rb +0 -153
- data/lib/action_controller/vendor/rack-1.0/rack/file.rb +0 -88
- data/lib/action_controller/vendor/rack-1.0/rack/handler.rb +0 -48
- data/lib/action_controller/vendor/rack-1.0/rack/handler/cgi.rb +0 -61
- data/lib/action_controller/vendor/rack-1.0/rack/handler/evented_mongrel.rb +0 -8
- data/lib/action_controller/vendor/rack-1.0/rack/handler/fastcgi.rb +0 -89
- data/lib/action_controller/vendor/rack-1.0/rack/handler/lsws.rb +0 -55
- data/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb +0 -84
- data/lib/action_controller/vendor/rack-1.0/rack/handler/scgi.rb +0 -59
- data/lib/action_controller/vendor/rack-1.0/rack/handler/swiftiplied_mongrel.rb +0 -8
- data/lib/action_controller/vendor/rack-1.0/rack/handler/thin.rb +0 -18
- data/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb +0 -67
- data/lib/action_controller/vendor/rack-1.0/rack/head.rb +0 -19
- data/lib/action_controller/vendor/rack-1.0/rack/lint.rb +0 -462
- data/lib/action_controller/vendor/rack-1.0/rack/lobster.rb +0 -65
- data/lib/action_controller/vendor/rack-1.0/rack/lock.rb +0 -16
- data/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb +0 -27
- data/lib/action_controller/vendor/rack-1.0/rack/mime.rb +0 -204
- data/lib/action_controller/vendor/rack-1.0/rack/mock.rb +0 -160
- data/lib/action_controller/vendor/rack-1.0/rack/recursive.rb +0 -57
- data/lib/action_controller/vendor/rack-1.0/rack/reloader.rb +0 -64
- data/lib/action_controller/vendor/rack-1.0/rack/request.rb +0 -241
- data/lib/action_controller/vendor/rack-1.0/rack/response.rb +0 -179
- data/lib/action_controller/vendor/rack-1.0/rack/session/abstract/id.rb +0 -142
- data/lib/action_controller/vendor/rack-1.0/rack/session/cookie.rb +0 -91
- data/lib/action_controller/vendor/rack-1.0/rack/session/memcache.rb +0 -109
- data/lib/action_controller/vendor/rack-1.0/rack/session/pool.rb +0 -100
- data/lib/action_controller/vendor/rack-1.0/rack/showexceptions.rb +0 -349
- data/lib/action_controller/vendor/rack-1.0/rack/showstatus.rb +0 -106
- data/lib/action_controller/vendor/rack-1.0/rack/static.rb +0 -38
- data/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb +0 -55
- data/lib/action_controller/vendor/rack-1.0/rack/utils.rb +0 -392
@@ -130,7 +130,7 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def test_form_remote_tag_with_method
|
133
|
-
assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\"><div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div>),
|
133
|
+
assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\"><div style='margin:0;padding:0;display:inline'><input name='_method' type='hidden' value='put' /></div>),
|
134
134
|
form_remote_tag(:update => "glass_of_beer", :url => { :action => :fast }, :html => { :method => :put })
|
135
135
|
end
|
136
136
|
|
@@ -158,7 +158,7 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
|
|
158
158
|
@record.save
|
159
159
|
remote_form_for(@record) {}
|
160
160
|
|
161
|
-
expected = %(<form action='#{author_path(@record)}' id='edit_author_1' method='post' onsubmit="new Ajax.Request('#{author_path(@record)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_author'><div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div></form>)
|
161
|
+
expected = %(<form action='#{author_path(@record)}' id='edit_author_1' method='post' onsubmit="new Ajax.Request('#{author_path(@record)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_author'><div style='margin:0;padding:0;display:inline'><input name='_method' type='hidden' value='put' /></div></form>)
|
162
162
|
assert_dom_equal expected, output_buffer
|
163
163
|
end
|
164
164
|
|
@@ -174,7 +174,7 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
|
|
174
174
|
@article.save
|
175
175
|
remote_form_for([@author, @article]) {}
|
176
176
|
|
177
|
-
expected = %(<form action='#{author_article_path(@author, @article)}' id='edit_article_1' method='post' onsubmit="new Ajax.Request('#{author_article_path(@author, @article)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_article'><div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div></form>)
|
177
|
+
expected = %(<form action='#{author_article_path(@author, @article)}' id='edit_article_1' method='post' onsubmit="new Ajax.Request('#{author_article_path(@author, @article)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_article'><div style='margin:0;padding:0;display:inline'><input name='_method' type='hidden' value='put' /></div></form>)
|
178
178
|
assert_dom_equal expected, output_buffer
|
179
179
|
end
|
180
180
|
|
@@ -327,28 +327,28 @@ class JavaScriptGeneratorTest < PrototypeHelperBaseTest
|
|
327
327
|
def test_remove
|
328
328
|
assert_equal 'Element.remove("foo");',
|
329
329
|
@generator.remove('foo')
|
330
|
-
assert_equal '["foo",
|
330
|
+
assert_equal '["foo","bar","baz"].each(Element.remove);',
|
331
331
|
@generator.remove('foo', 'bar', 'baz')
|
332
332
|
end
|
333
333
|
|
334
334
|
def test_show
|
335
335
|
assert_equal 'Element.show("foo");',
|
336
336
|
@generator.show('foo')
|
337
|
-
assert_equal '["foo",
|
337
|
+
assert_equal '["foo","bar","baz"].each(Element.show);',
|
338
338
|
@generator.show('foo', 'bar', 'baz')
|
339
339
|
end
|
340
340
|
|
341
341
|
def test_hide
|
342
342
|
assert_equal 'Element.hide("foo");',
|
343
343
|
@generator.hide('foo')
|
344
|
-
assert_equal '["foo",
|
344
|
+
assert_equal '["foo","bar","baz"].each(Element.hide);',
|
345
345
|
@generator.hide('foo', 'bar', 'baz')
|
346
346
|
end
|
347
347
|
|
348
348
|
def test_toggle
|
349
349
|
assert_equal 'Element.toggle("foo");',
|
350
350
|
@generator.toggle('foo')
|
351
|
-
assert_equal '["foo",
|
351
|
+
assert_equal '["foo","bar","baz"].each(Element.toggle);',
|
352
352
|
@generator.toggle('foo', 'bar', 'baz')
|
353
353
|
end
|
354
354
|
|
@@ -385,7 +385,7 @@ class JavaScriptGeneratorTest < PrototypeHelperBaseTest
|
|
385
385
|
assert_equal <<-EOS.chomp, @generator.to_s
|
386
386
|
Element.insert("element", { top: "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E" });
|
387
387
|
Element.insert("element", { bottom: "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E" });
|
388
|
-
["foo",
|
388
|
+
["foo","bar"].each(Element.remove);
|
389
389
|
Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E");
|
390
390
|
EOS
|
391
391
|
end
|
@@ -554,8 +554,8 @@ return (value.className == "welcome");
|
|
554
554
|
end
|
555
555
|
|
556
556
|
assert_equal <<-EOS.strip, @generator.to_s
|
557
|
-
var a = [1, 2, 3].zip([4,
|
558
|
-
var b = [1, 2, 3].zip([4,
|
557
|
+
var a = [1, 2, 3].zip([4,5,6], [7,8,9]);
|
558
|
+
var b = [1, 2, 3].zip([4,5,6], [7,8,9], function(array) {
|
559
559
|
return array.reverse();
|
560
560
|
});
|
561
561
|
EOS
|
@@ -606,7 +606,7 @@ return value.reverse();
|
|
606
606
|
|
607
607
|
def test_literal
|
608
608
|
literal = @generator.literal("function() {}")
|
609
|
-
assert_equal "function() {}", literal
|
609
|
+
assert_equal "function() {}", ActiveSupport::JSON.encode(literal)
|
610
610
|
assert_equal "", @generator.to_s
|
611
611
|
end
|
612
612
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class TemplateTest < Test::Unit::TestCase
|
4
|
+
def test_template_path_parsing
|
5
|
+
with_options :base_path => nil, :name => 'abc', :locale => nil, :format => 'html', :extension => 'erb' do |t|
|
6
|
+
t.assert_parses_template_path 'abc.en.html.erb', :locale => 'en'
|
7
|
+
t.assert_parses_template_path 'abc.en.plain.html.erb', :locale => 'en', :format => 'plain.html'
|
8
|
+
t.assert_parses_template_path 'abc.html.erb'
|
9
|
+
t.assert_parses_template_path 'abc.plain.html.erb', :format => 'plain.html'
|
10
|
+
t.assert_parses_template_path 'abc.erb', :format => nil
|
11
|
+
t.assert_parses_template_path 'abc.html', :extension => nil
|
12
|
+
|
13
|
+
t.assert_parses_template_path '_abc.html.erb', :name => '_abc'
|
14
|
+
|
15
|
+
t.assert_parses_template_path 'test/abc.html.erb', :base_path => 'test'
|
16
|
+
t.assert_parses_template_path './test/abc.html.erb', :base_path => './test'
|
17
|
+
t.assert_parses_template_path '../test/abc.html.erb', :base_path => '../test'
|
18
|
+
|
19
|
+
t.assert_parses_template_path 'abc', :extension => nil, :format => nil, :name => nil
|
20
|
+
t.assert_parses_template_path 'abc.xxx', :extension => nil, :format => 'xxx', :name => 'abc'
|
21
|
+
t.assert_parses_template_path 'abc.html.xxx', :extension => nil, :format => 'xxx', :name => 'abc'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
def assert_parses_template_path(path, parse_results)
|
27
|
+
template = ActionView::Template.new(path, '')
|
28
|
+
parse_results.each_pair do |k, v|
|
29
|
+
assert_block(%Q{Expected template to parse #{k.inspect} from "#{path}" as #{v.inspect}, but got #{template.send(k).inspect}}) { v == template.send(k) }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ autorequire: action_controller
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-20 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,17 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - "="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 2.3.
|
23
|
+
version: 2.3.3
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rack
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.0
|
24
34
|
version:
|
25
35
|
description: Eases web-request routing, handling, and response as a half-way front, half-way page controller. Implemented with specific emphasis on enabling easy unit/integration testing that doesn't require a browser.
|
26
36
|
email: david@loudthinking.com
|
@@ -51,6 +61,7 @@ files:
|
|
51
61
|
- lib/action_controller/caching/actions.rb
|
52
62
|
- lib/action_controller/caching/fragments.rb
|
53
63
|
- lib/action_controller/caching/pages.rb
|
64
|
+
- lib/action_controller/caching/sweeper.rb
|
54
65
|
- lib/action_controller/caching/sweeping.rb
|
55
66
|
- lib/action_controller/caching.rb
|
56
67
|
- lib/action_controller/cgi_ext
|
@@ -84,7 +95,6 @@ files:
|
|
84
95
|
- lib/action_controller/rescue.rb
|
85
96
|
- lib/action_controller/resources.rb
|
86
97
|
- lib/action_controller/response.rb
|
87
|
-
- lib/action_controller/rewindable_input.rb
|
88
98
|
- lib/action_controller/routing
|
89
99
|
- lib/action_controller/routing/builder.rb
|
90
100
|
- lib/action_controller/routing/optimisations.rb
|
@@ -126,65 +136,6 @@ files:
|
|
126
136
|
- lib/action_controller/vendor/html-scanner/html/tokenizer.rb
|
127
137
|
- lib/action_controller/vendor/html-scanner/html/version.rb
|
128
138
|
- lib/action_controller/vendor/html-scanner.rb
|
129
|
-
- lib/action_controller/vendor/rack-1.0
|
130
|
-
- lib/action_controller/vendor/rack-1.0/rack
|
131
|
-
- lib/action_controller/vendor/rack-1.0/rack/adapter
|
132
|
-
- lib/action_controller/vendor/rack-1.0/rack/adapter/camping.rb
|
133
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth
|
134
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/abstract
|
135
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb
|
136
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/abstract/request.rb
|
137
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/basic.rb
|
138
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/digest
|
139
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/digest/md5.rb
|
140
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/digest/nonce.rb
|
141
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/digest/params.rb
|
142
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/digest/request.rb
|
143
|
-
- lib/action_controller/vendor/rack-1.0/rack/auth/openid.rb
|
144
|
-
- lib/action_controller/vendor/rack-1.0/rack/builder.rb
|
145
|
-
- lib/action_controller/vendor/rack-1.0/rack/cascade.rb
|
146
|
-
- lib/action_controller/vendor/rack-1.0/rack/chunked.rb
|
147
|
-
- lib/action_controller/vendor/rack-1.0/rack/commonlogger.rb
|
148
|
-
- lib/action_controller/vendor/rack-1.0/rack/conditionalget.rb
|
149
|
-
- lib/action_controller/vendor/rack-1.0/rack/content_length.rb
|
150
|
-
- lib/action_controller/vendor/rack-1.0/rack/content_type.rb
|
151
|
-
- lib/action_controller/vendor/rack-1.0/rack/deflater.rb
|
152
|
-
- lib/action_controller/vendor/rack-1.0/rack/directory.rb
|
153
|
-
- lib/action_controller/vendor/rack-1.0/rack/file.rb
|
154
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler
|
155
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler/cgi.rb
|
156
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler/evented_mongrel.rb
|
157
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler/fastcgi.rb
|
158
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler/lsws.rb
|
159
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb
|
160
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler/scgi.rb
|
161
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler/swiftiplied_mongrel.rb
|
162
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler/thin.rb
|
163
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb
|
164
|
-
- lib/action_controller/vendor/rack-1.0/rack/handler.rb
|
165
|
-
- lib/action_controller/vendor/rack-1.0/rack/head.rb
|
166
|
-
- lib/action_controller/vendor/rack-1.0/rack/lint.rb
|
167
|
-
- lib/action_controller/vendor/rack-1.0/rack/lobster.rb
|
168
|
-
- lib/action_controller/vendor/rack-1.0/rack/lock.rb
|
169
|
-
- lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb
|
170
|
-
- lib/action_controller/vendor/rack-1.0/rack/mime.rb
|
171
|
-
- lib/action_controller/vendor/rack-1.0/rack/mock.rb
|
172
|
-
- lib/action_controller/vendor/rack-1.0/rack/recursive.rb
|
173
|
-
- lib/action_controller/vendor/rack-1.0/rack/reloader.rb
|
174
|
-
- lib/action_controller/vendor/rack-1.0/rack/request.rb
|
175
|
-
- lib/action_controller/vendor/rack-1.0/rack/response.rb
|
176
|
-
- lib/action_controller/vendor/rack-1.0/rack/session
|
177
|
-
- lib/action_controller/vendor/rack-1.0/rack/session/abstract
|
178
|
-
- lib/action_controller/vendor/rack-1.0/rack/session/abstract/id.rb
|
179
|
-
- lib/action_controller/vendor/rack-1.0/rack/session/cookie.rb
|
180
|
-
- lib/action_controller/vendor/rack-1.0/rack/session/memcache.rb
|
181
|
-
- lib/action_controller/vendor/rack-1.0/rack/session/pool.rb
|
182
|
-
- lib/action_controller/vendor/rack-1.0/rack/showexceptions.rb
|
183
|
-
- lib/action_controller/vendor/rack-1.0/rack/showstatus.rb
|
184
|
-
- lib/action_controller/vendor/rack-1.0/rack/static.rb
|
185
|
-
- lib/action_controller/vendor/rack-1.0/rack/urlmap.rb
|
186
|
-
- lib/action_controller/vendor/rack-1.0/rack/utils.rb
|
187
|
-
- lib/action_controller/vendor/rack-1.0/rack.rb
|
188
139
|
- lib/action_controller/verification.rb
|
189
140
|
- lib/action_controller.rb
|
190
141
|
- lib/action_pack
|
@@ -267,6 +218,7 @@ files:
|
|
267
218
|
- test/controller/deprecation
|
268
219
|
- test/controller/deprecation/deprecated_base_methods_test.rb
|
269
220
|
- test/controller/dispatcher_test.rb
|
221
|
+
- test/controller/failsafe_test.rb
|
270
222
|
- test/controller/fake_controllers.rb
|
271
223
|
- test/controller/fake_models.rb
|
272
224
|
- test/controller/filter_params_test.rb
|
@@ -294,11 +246,13 @@ files:
|
|
294
246
|
- test/controller/rack_test.rb
|
295
247
|
- test/controller/record_identifier_test.rb
|
296
248
|
- test/controller/redirect_test.rb
|
249
|
+
- test/controller/reloader_test.rb
|
297
250
|
- test/controller/render_test.rb
|
298
251
|
- test/controller/request
|
299
252
|
- test/controller/request/json_params_parsing_test.rb
|
300
253
|
- test/controller/request/multipart_params_parsing_test.rb
|
301
254
|
- test/controller/request/query_string_parsing_test.rb
|
255
|
+
- test/controller/request/test_request_test.rb
|
302
256
|
- test/controller/request/url_encoded_params_parsing_test.rb
|
303
257
|
- test/controller/request/xml_params_parsing_test.rb
|
304
258
|
- test/controller/request_forgery_protection_test.rb
|
@@ -343,6 +297,8 @@ files:
|
|
343
297
|
- test/fixtures/developers/_developer.erb
|
344
298
|
- test/fixtures/developers.yml
|
345
299
|
- test/fixtures/developers_projects.yml
|
300
|
+
- test/fixtures/failsafe
|
301
|
+
- test/fixtures/failsafe/500.html
|
346
302
|
- test/fixtures/fun
|
347
303
|
- test/fixtures/fun/games
|
348
304
|
- test/fixtures/fun/games/_game.erb
|
@@ -582,6 +538,7 @@ files:
|
|
582
538
|
- test/template/sanitize_helper_test.rb
|
583
539
|
- test/template/scriptaculous_helper_test.rb
|
584
540
|
- test/template/tag_helper_test.rb
|
541
|
+
- test/template/template_test.rb
|
585
542
|
- test/template/test_test.rb
|
586
543
|
- test/template/text_helper_test.rb
|
587
544
|
- test/template/translation_helper_test.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module ActionController
|
2
|
-
class RewindableInput
|
3
|
-
class RewindableIO < ActiveSupport::BasicObject
|
4
|
-
def initialize(io)
|
5
|
-
@io = io
|
6
|
-
@rewindable = io.is_a?(::StringIO)
|
7
|
-
end
|
8
|
-
|
9
|
-
def method_missing(method, *args, &block)
|
10
|
-
unless @rewindable
|
11
|
-
@io = ::StringIO.new(@io.read)
|
12
|
-
@rewindable = true
|
13
|
-
end
|
14
|
-
|
15
|
-
@io.__send__(method, *args, &block)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def initialize(app)
|
20
|
-
@app = app
|
21
|
-
end
|
22
|
-
|
23
|
-
def call(env)
|
24
|
-
env['rack.input'] = RewindableIO.new(env['rack.input'])
|
25
|
-
@app.call(env)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,89 +0,0 @@
|
|
1
|
-
# Copyright (C) 2007, 2008, 2009 Christian Neukirchen <purl.org/net/chneukirchen>
|
2
|
-
#
|
3
|
-
# Rack is freely distributable under the terms of an MIT-style license.
|
4
|
-
# See COPYING or http://www.opensource.org/licenses/mit-license.php.
|
5
|
-
|
6
|
-
$:.unshift(File.expand_path(File.dirname(__FILE__)))
|
7
|
-
|
8
|
-
|
9
|
-
# The Rack main module, serving as a namespace for all core Rack
|
10
|
-
# modules and classes.
|
11
|
-
#
|
12
|
-
# All modules meant for use in your application are <tt>autoload</tt>ed here,
|
13
|
-
# so it should be enough just to <tt>require rack.rb</tt> in your code.
|
14
|
-
|
15
|
-
module Rack
|
16
|
-
# The Rack protocol version number implemented.
|
17
|
-
VERSION = [0,1]
|
18
|
-
|
19
|
-
# Return the Rack protocol version as a dotted string.
|
20
|
-
def self.version
|
21
|
-
VERSION.join(".")
|
22
|
-
end
|
23
|
-
|
24
|
-
# Return the Rack release as a dotted string.
|
25
|
-
def self.release
|
26
|
-
"1.0 bundled"
|
27
|
-
end
|
28
|
-
|
29
|
-
autoload :Builder, "rack/builder"
|
30
|
-
autoload :Cascade, "rack/cascade"
|
31
|
-
autoload :Chunked, "rack/chunked"
|
32
|
-
autoload :CommonLogger, "rack/commonlogger"
|
33
|
-
autoload :ConditionalGet, "rack/conditionalget"
|
34
|
-
autoload :ContentLength, "rack/content_length"
|
35
|
-
autoload :ContentType, "rack/content_type"
|
36
|
-
autoload :File, "rack/file"
|
37
|
-
autoload :Deflater, "rack/deflater"
|
38
|
-
autoload :Directory, "rack/directory"
|
39
|
-
autoload :ForwardRequest, "rack/recursive"
|
40
|
-
autoload :Handler, "rack/handler"
|
41
|
-
autoload :Head, "rack/head"
|
42
|
-
autoload :Lint, "rack/lint"
|
43
|
-
autoload :Lock, "rack/lock"
|
44
|
-
autoload :MethodOverride, "rack/methodoverride"
|
45
|
-
autoload :Mime, "rack/mime"
|
46
|
-
autoload :Recursive, "rack/recursive"
|
47
|
-
autoload :Reloader, "rack/reloader"
|
48
|
-
autoload :ShowExceptions, "rack/showexceptions"
|
49
|
-
autoload :ShowStatus, "rack/showstatus"
|
50
|
-
autoload :Static, "rack/static"
|
51
|
-
autoload :URLMap, "rack/urlmap"
|
52
|
-
autoload :Utils, "rack/utils"
|
53
|
-
|
54
|
-
autoload :MockRequest, "rack/mock"
|
55
|
-
autoload :MockResponse, "rack/mock"
|
56
|
-
|
57
|
-
autoload :Request, "rack/request"
|
58
|
-
autoload :Response, "rack/response"
|
59
|
-
|
60
|
-
module Auth
|
61
|
-
autoload :Basic, "rack/auth/basic"
|
62
|
-
autoload :AbstractRequest, "rack/auth/abstract/request"
|
63
|
-
autoload :AbstractHandler, "rack/auth/abstract/handler"
|
64
|
-
autoload :OpenID, "rack/auth/openid"
|
65
|
-
module Digest
|
66
|
-
autoload :MD5, "rack/auth/digest/md5"
|
67
|
-
autoload :Nonce, "rack/auth/digest/nonce"
|
68
|
-
autoload :Params, "rack/auth/digest/params"
|
69
|
-
autoload :Request, "rack/auth/digest/request"
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
module Session
|
74
|
-
autoload :Cookie, "rack/session/cookie"
|
75
|
-
autoload :Pool, "rack/session/pool"
|
76
|
-
autoload :Memcache, "rack/session/memcache"
|
77
|
-
end
|
78
|
-
|
79
|
-
# *Adapters* connect Rack with third party web frameworks.
|
80
|
-
#
|
81
|
-
# Rack includes an adapter for Camping, see README for other
|
82
|
-
# frameworks supporting Rack in their code bases.
|
83
|
-
#
|
84
|
-
# Refer to the submodules for framework-specific calling details.
|
85
|
-
|
86
|
-
module Adapter
|
87
|
-
autoload :Camping, "rack/adapter/camping"
|
88
|
-
end
|
89
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module Rack
|
2
|
-
module Adapter
|
3
|
-
class Camping
|
4
|
-
def initialize(app)
|
5
|
-
@app = app
|
6
|
-
end
|
7
|
-
|
8
|
-
def call(env)
|
9
|
-
env["PATH_INFO"] ||= ""
|
10
|
-
env["SCRIPT_NAME"] ||= ""
|
11
|
-
controller = @app.run(env['rack.input'], env)
|
12
|
-
h = controller.headers
|
13
|
-
h.each_pair do |k,v|
|
14
|
-
if v.kind_of? URI
|
15
|
-
h[k] = v.to_s
|
16
|
-
end
|
17
|
-
end
|
18
|
-
[controller.status, controller.headers, [controller.body.to_s]]
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
module Rack
|
2
|
-
module Auth
|
3
|
-
# Rack::Auth::AbstractHandler implements common authentication functionality.
|
4
|
-
#
|
5
|
-
# +realm+ should be set for all handlers.
|
6
|
-
|
7
|
-
class AbstractHandler
|
8
|
-
|
9
|
-
attr_accessor :realm
|
10
|
-
|
11
|
-
def initialize(app, realm=nil, &authenticator)
|
12
|
-
@app, @realm, @authenticator = app, realm, authenticator
|
13
|
-
end
|
14
|
-
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def unauthorized(www_authenticate = challenge)
|
19
|
-
return [ 401,
|
20
|
-
{ 'Content-Type' => 'text/plain',
|
21
|
-
'Content-Length' => '0',
|
22
|
-
'WWW-Authenticate' => www_authenticate.to_s },
|
23
|
-
[]
|
24
|
-
]
|
25
|
-
end
|
26
|
-
|
27
|
-
def bad_request
|
28
|
-
return [ 400,
|
29
|
-
{ 'Content-Type' => 'text/plain',
|
30
|
-
'Content-Length' => '0' },
|
31
|
-
[]
|
32
|
-
]
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|