actionpack 1.12.5 → 1.13.0

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.

Files changed (179) hide show
  1. data/CHANGELOG +517 -15
  2. data/MIT-LICENSE +1 -1
  3. data/README +18 -20
  4. data/Rakefile +7 -4
  5. data/examples/address_book_controller.rb +3 -3
  6. data/examples/blog_controller.cgi +3 -3
  7. data/examples/debate_controller.cgi +5 -5
  8. data/lib/action_controller.rb +2 -2
  9. data/lib/action_controller/assertions.rb +73 -311
  10. data/lib/action_controller/{deprecated_assertions.rb → assertions/deprecated_assertions.rb} +32 -8
  11. data/lib/action_controller/assertions/dom_assertions.rb +25 -0
  12. data/lib/action_controller/assertions/model_assertions.rb +12 -0
  13. data/lib/action_controller/assertions/response_assertions.rb +140 -0
  14. data/lib/action_controller/assertions/routing_assertions.rb +82 -0
  15. data/lib/action_controller/assertions/selector_assertions.rb +571 -0
  16. data/lib/action_controller/assertions/tag_assertions.rb +117 -0
  17. data/lib/action_controller/base.rb +334 -163
  18. data/lib/action_controller/benchmarking.rb +3 -6
  19. data/lib/action_controller/caching.rb +83 -22
  20. data/lib/action_controller/cgi_ext/cgi_ext.rb +0 -7
  21. data/lib/action_controller/cgi_ext/cgi_methods.rb +167 -173
  22. data/lib/action_controller/cgi_ext/raw_post_data_fix.rb +43 -22
  23. data/lib/action_controller/cgi_process.rb +50 -27
  24. data/lib/action_controller/components.rb +21 -25
  25. data/lib/action_controller/cookies.rb +10 -9
  26. data/lib/action_controller/{dependencies.rb → deprecated_dependencies.rb} +9 -27
  27. data/lib/action_controller/filters.rb +448 -225
  28. data/lib/action_controller/flash.rb +24 -20
  29. data/lib/action_controller/helpers.rb +2 -5
  30. data/lib/action_controller/integration.rb +40 -16
  31. data/lib/action_controller/layout.rb +11 -8
  32. data/lib/action_controller/macros/auto_complete.rb +3 -2
  33. data/lib/action_controller/macros/in_place_editing.rb +3 -2
  34. data/lib/action_controller/mime_responds.rb +41 -29
  35. data/lib/action_controller/mime_type.rb +68 -10
  36. data/lib/action_controller/pagination.rb +4 -3
  37. data/lib/action_controller/request.rb +22 -14
  38. data/lib/action_controller/rescue.rb +25 -22
  39. data/lib/action_controller/resources.rb +302 -0
  40. data/lib/action_controller/response.rb +20 -2
  41. data/lib/action_controller/response.rb.rej +17 -0
  42. data/lib/action_controller/routing.rb +1165 -567
  43. data/lib/action_controller/scaffolding.rb +30 -31
  44. data/lib/action_controller/session/active_record_store.rb +2 -0
  45. data/lib/action_controller/session/drb_store.rb +4 -0
  46. data/lib/action_controller/session/mem_cache_store.rb +4 -0
  47. data/lib/action_controller/session_management.rb +6 -9
  48. data/lib/action_controller/status_codes.rb +89 -0
  49. data/lib/action_controller/streaming.rb +6 -15
  50. data/lib/action_controller/templates/rescues/_request_and_response.rhtml +5 -5
  51. data/lib/action_controller/templates/rescues/diagnostics.rhtml +2 -2
  52. data/lib/action_controller/templates/rescues/routing_error.rhtml +4 -4
  53. data/lib/action_controller/templates/rescues/template_error.rhtml +1 -1
  54. data/lib/action_controller/templates/scaffolds/list.rhtml +1 -1
  55. data/lib/action_controller/test_process.rb +52 -30
  56. data/lib/action_controller/url_rewriter.rb +63 -29
  57. data/lib/action_controller/vendor/html-scanner/html/document.rb +1 -0
  58. data/lib/action_controller/vendor/html-scanner/html/node.rb +3 -4
  59. data/lib/action_controller/vendor/html-scanner/html/selector.rb +822 -0
  60. data/lib/action_controller/verification.rb +22 -11
  61. data/lib/action_pack.rb +1 -1
  62. data/lib/action_pack/version.rb +2 -2
  63. data/lib/action_view.rb +1 -1
  64. data/lib/action_view/base.rb +46 -43
  65. data/lib/action_view/compiled_templates.rb +1 -1
  66. data/lib/action_view/helpers/active_record_helper.rb +54 -17
  67. data/lib/action_view/helpers/asset_tag_helper.rb +97 -46
  68. data/lib/action_view/helpers/capture_helper.rb +1 -1
  69. data/lib/action_view/helpers/date_helper.rb +258 -136
  70. data/lib/action_view/helpers/debug_helper.rb +1 -1
  71. data/lib/action_view/helpers/deprecated_helper.rb +34 -0
  72. data/lib/action_view/helpers/form_helper.rb +75 -35
  73. data/lib/action_view/helpers/form_options_helper.rb +7 -5
  74. data/lib/action_view/helpers/form_tag_helper.rb +44 -6
  75. data/lib/action_view/helpers/java_script_macros_helper.rb +59 -46
  76. data/lib/action_view/helpers/javascript_helper.rb +71 -10
  77. data/lib/action_view/helpers/javascripts/controls.js +41 -23
  78. data/lib/action_view/helpers/javascripts/dragdrop.js +105 -76
  79. data/lib/action_view/helpers/javascripts/effects.js +293 -163
  80. data/lib/action_view/helpers/javascripts/prototype.js +897 -389
  81. data/lib/action_view/helpers/javascripts/prototype.js.rej +561 -0
  82. data/lib/action_view/helpers/number_helper.rb +111 -65
  83. data/lib/action_view/helpers/prototype_helper.rb +84 -109
  84. data/lib/action_view/helpers/scriptaculous_helper.rb +5 -0
  85. data/lib/action_view/helpers/tag_helper.rb +69 -16
  86. data/lib/action_view/helpers/text_helper.rb +149 -112
  87. data/lib/action_view/helpers/url_helper.rb +200 -107
  88. data/lib/action_view/template_error.rb +66 -42
  89. data/test/abstract_unit.rb +4 -2
  90. data/test/active_record_unit.rb +84 -56
  91. data/test/activerecord/active_record_assertions_test.rb +26 -18
  92. data/test/activerecord/active_record_store_test.rb +4 -36
  93. data/test/activerecord/pagination_test.rb +1 -6
  94. data/test/controller/action_pack_assertions_test.rb +230 -113
  95. data/test/controller/addresses_render_test.rb +2 -6
  96. data/test/controller/assert_select_test.rb +576 -0
  97. data/test/controller/base_test.rb +73 -3
  98. data/test/controller/caching_test.rb +228 -0
  99. data/test/controller/capture_test.rb +12 -10
  100. data/test/controller/cgi_test.rb +89 -12
  101. data/test/controller/components_test.rb +24 -2
  102. data/test/controller/content_type_test.rb +139 -0
  103. data/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
  104. data/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
  105. data/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
  106. data/test/controller/cookie_test.rb +33 -25
  107. data/test/controller/deprecated_instance_variables_test.rb +48 -0
  108. data/test/controller/deprecation/deprecated_base_methods_test.rb +60 -0
  109. data/test/controller/fake_controllers.rb +0 -1
  110. data/test/controller/filters_test.rb +301 -16
  111. data/test/controller/flash_test.rb +19 -2
  112. data/test/controller/helper_test.rb +2 -2
  113. data/test/controller/integration_test.rb +154 -0
  114. data/test/controller/layout_test.rb +115 -1
  115. data/test/controller/mime_responds_test.rb +94 -0
  116. data/test/controller/mime_type_test.rb +9 -0
  117. data/test/controller/new_render_test.rb +161 -11
  118. data/test/controller/raw_post_test.rb +52 -15
  119. data/test/controller/redirect_test.rb +27 -14
  120. data/test/controller/render_test.rb +76 -29
  121. data/test/controller/request_test.rb +55 -4
  122. data/test/controller/resources_test.rb +274 -0
  123. data/test/controller/routing_test.rb +1533 -824
  124. data/test/controller/selector_test.rb +628 -0
  125. data/test/controller/send_file_test.rb +9 -1
  126. data/test/controller/session_management_test.rb +51 -0
  127. data/test/controller/test_test.rb +113 -29
  128. data/test/controller/url_rewriter_test.rb +86 -17
  129. data/test/controller/verification_test.rb +19 -17
  130. data/test/controller/webservice_test.rb +0 -7
  131. data/test/fixtures/content_type/render_default_content_types_for_respond_to.rhtml +1 -0
  132. data/test/fixtures/content_type/render_default_for_rhtml.rhtml +1 -0
  133. data/test/fixtures/content_type/render_default_for_rjs.rjs +1 -0
  134. data/test/fixtures/content_type/render_default_for_rxml.rxml +1 -0
  135. data/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml +1 -0
  136. data/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml +1 -0
  137. data/test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml +1 -0
  138. data/test/fixtures/deprecated_instance_variables/_flash_method.rhtml +1 -0
  139. data/test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml +1 -0
  140. data/test/fixtures/deprecated_instance_variables/_headers_method.rhtml +1 -0
  141. data/test/fixtures/deprecated_instance_variables/_params_ivar.rhtml +1 -0
  142. data/test/fixtures/deprecated_instance_variables/_params_method.rhtml +1 -0
  143. data/test/fixtures/deprecated_instance_variables/_request_ivar.rhtml +1 -0
  144. data/test/fixtures/deprecated_instance_variables/_request_method.rhtml +1 -0
  145. data/test/fixtures/deprecated_instance_variables/_response_ivar.rhtml +1 -0
  146. data/test/fixtures/deprecated_instance_variables/_response_method.rhtml +1 -0
  147. data/test/fixtures/deprecated_instance_variables/_session_ivar.rhtml +1 -0
  148. data/test/fixtures/deprecated_instance_variables/_session_method.rhtml +1 -0
  149. data/test/fixtures/multipart/binary_file +0 -0
  150. data/test/fixtures/public/javascripts/application.js +1 -0
  151. data/test/fixtures/test/_hello.rxml +1 -0
  152. data/test/fixtures/test/hello_world_container.rxml +3 -0
  153. data/test/fixtures/topic.rb +2 -2
  154. data/test/template/active_record_helper_test.rb +83 -12
  155. data/test/template/asset_tag_helper_test.rb +75 -95
  156. data/test/template/compiled_templates_test.rb +1 -0
  157. data/test/template/date_helper_test.rb +873 -181
  158. data/test/template/deprecated_helper_test.rb +36 -0
  159. data/test/template/deprecated_instance_variables_test.rb +43 -0
  160. data/test/template/form_helper_test.rb +77 -1
  161. data/test/template/form_options_helper_test.rb +4 -0
  162. data/test/template/form_tag_helper_test.rb +66 -2
  163. data/test/template/java_script_macros_helper_test.rb +4 -1
  164. data/test/template/javascript_helper_test.rb +29 -0
  165. data/test/template/number_helper_test.rb +63 -27
  166. data/test/template/prototype_helper_test.rb +77 -34
  167. data/test/template/tag_helper_test.rb +34 -6
  168. data/test/template/text_helper_test.rb +69 -34
  169. data/test/template/url_helper_test.rb +168 -16
  170. data/test/testing_sandbox.rb +7 -22
  171. metadata +66 -20
  172. data/filler.txt +0 -50
  173. data/lib/action_controller/code_generation.rb +0 -235
  174. data/lib/action_controller/vendor/xml_simple.rb +0 -1019
  175. data/test/controller/caching_filestore.rb +0 -74
  176. data/test/fixtures/application_root/app/controllers/a_class_that_contains_a_controller/poorly_placed_controller.rb +0 -7
  177. data/test/fixtures/application_root/app/controllers/module_that_holds_controllers/nested_controller.rb +0 -3
  178. data/test/fixtures/application_root/app/models/a_class_that_contains_a_controller.rb +0 -7
  179. data/test/fixtures/dont_load.rb +0 -3
@@ -1,26 +1,11 @@
1
1
  module TestingSandbox
2
-
3
- # This whole thing *could* be much simpler, but I don't think Tempfile,
4
- # popen and others exist on all platforms (like Windows).
5
- def execute_in_sandbox(code)
6
- test_name = "#{File.dirname(__FILE__)}/test.#{$$}.rb"
7
- res_name = "#{File.dirname(__FILE__)}/test.#{$$}.out"
8
-
9
- File.open(test_name, "w+") do |file|
10
- file.write(<<-CODE)
11
- $:.unshift "../lib"
12
- block = Proc.new do
13
- #{code}
14
- end
15
- print block.call
16
- CODE
2
+ # Temporarily replaces KCODE for the block
3
+ def with_kcode(kcode)
4
+ old_kcode, $KCODE = $KCODE, kcode
5
+ begin
6
+ yield
7
+ ensure
8
+ $KCODE = old_kcode
17
9
  end
18
-
19
- system("ruby #{test_name} > #{res_name}") or raise "could not run test in sandbox"
20
- File.read(res_name)
21
- ensure
22
- File.delete(test_name) rescue nil
23
- File.delete(res_name) rescue nil
24
10
  end
25
-
26
11
  end
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: actionpack
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.12.5
7
- date: 2006-08-10 00:00:00 -05:00
6
+ version: 1.13.0
7
+ date: 2007-01-17 00:00:00 -06:00
8
8
  summary: Web-flow and rendering framework putting the VC in MVC.
9
9
  require_paths:
10
10
  - lib
@@ -25,12 +25,12 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
25
  platform: ruby
26
26
  signing_key:
27
27
  cert_chain:
28
+ post_install_message:
28
29
  authors:
29
30
  - David Heinemeier Hansson
30
31
  files:
31
32
  - Rakefile
32
33
  - install.rb
33
- - filler.txt
34
34
  - README
35
35
  - RUNNING_UNIT_TESTS
36
36
  - CHANGELOG
@@ -42,17 +42,16 @@ files:
42
42
  - lib/action_pack.rb
43
43
  - lib/action_view
44
44
  - lib/action_view.rb
45
+ - lib/action_controller/assertions
45
46
  - lib/action_controller/assertions.rb
46
47
  - lib/action_controller/base.rb
47
48
  - lib/action_controller/benchmarking.rb
48
49
  - lib/action_controller/caching.rb
49
50
  - lib/action_controller/cgi_ext
50
51
  - lib/action_controller/cgi_process.rb
51
- - lib/action_controller/code_generation.rb
52
52
  - lib/action_controller/components.rb
53
53
  - lib/action_controller/cookies.rb
54
- - lib/action_controller/dependencies.rb
55
- - lib/action_controller/deprecated_assertions.rb
54
+ - lib/action_controller/deprecated_dependencies.rb
56
55
  - lib/action_controller/deprecated_redirects.rb
57
56
  - lib/action_controller/deprecated_request_methods.rb
58
57
  - lib/action_controller/filters.rb
@@ -66,17 +65,27 @@ files:
66
65
  - lib/action_controller/pagination.rb
67
66
  - lib/action_controller/request.rb
68
67
  - lib/action_controller/rescue.rb
68
+ - lib/action_controller/resources.rb
69
69
  - lib/action_controller/response.rb
70
+ - lib/action_controller/response.rb.rej
70
71
  - lib/action_controller/routing.rb
71
72
  - lib/action_controller/scaffolding.rb
72
73
  - lib/action_controller/session
73
74
  - lib/action_controller/session_management.rb
75
+ - lib/action_controller/status_codes.rb
74
76
  - lib/action_controller/streaming.rb
75
77
  - lib/action_controller/templates
76
78
  - lib/action_controller/test_process.rb
77
79
  - lib/action_controller/url_rewriter.rb
78
80
  - lib/action_controller/vendor
79
81
  - lib/action_controller/verification.rb
82
+ - lib/action_controller/assertions/deprecated_assertions.rb
83
+ - lib/action_controller/assertions/dom_assertions.rb
84
+ - lib/action_controller/assertions/model_assertions.rb
85
+ - lib/action_controller/assertions/response_assertions.rb
86
+ - lib/action_controller/assertions/routing_assertions.rb
87
+ - lib/action_controller/assertions/selector_assertions.rb
88
+ - lib/action_controller/assertions/tag_assertions.rb
80
89
  - lib/action_controller/cgi_ext/cgi_ext.rb
81
90
  - lib/action_controller/cgi_ext/cgi_methods.rb
82
91
  - lib/action_controller/cgi_ext/cookie_performance_fix.rb
@@ -104,10 +113,10 @@ files:
104
113
  - lib/action_controller/templates/scaffolds/show.rhtml
105
114
  - lib/action_controller/vendor/html-scanner
106
115
  - lib/action_controller/vendor/xml_node.rb
107
- - lib/action_controller/vendor/xml_simple.rb
108
116
  - lib/action_controller/vendor/html-scanner/html
109
117
  - lib/action_controller/vendor/html-scanner/html/document.rb
110
118
  - lib/action_controller/vendor/html-scanner/html/node.rb
119
+ - lib/action_controller/vendor/html-scanner/html/selector.rb
111
120
  - lib/action_controller/vendor/html-scanner/html/tokenizer.rb
112
121
  - lib/action_controller/vendor/html-scanner/html/version.rb
113
122
  - lib/action_pack/version.rb
@@ -123,6 +132,7 @@ files:
123
132
  - lib/action_view/helpers/capture_helper.rb
124
133
  - lib/action_view/helpers/date_helper.rb
125
134
  - lib/action_view/helpers/debug_helper.rb
135
+ - lib/action_view/helpers/deprecated_helper.rb
126
136
  - lib/action_view/helpers/form_helper.rb
127
137
  - lib/action_view/helpers/form_options_helper.rb
128
138
  - lib/action_view/helpers/form_tag_helper.rb
@@ -140,6 +150,7 @@ files:
140
150
  - lib/action_view/helpers/javascripts/dragdrop.js
141
151
  - lib/action_view/helpers/javascripts/effects.js
142
152
  - lib/action_view/helpers/javascripts/prototype.js
153
+ - lib/action_view/helpers/javascripts/prototype.js.rej
143
154
  - test/abstract_unit.rb
144
155
  - test/active_record_unit.rb
145
156
  - test/activerecord
@@ -152,20 +163,26 @@ files:
152
163
  - test/activerecord/pagination_test.rb
153
164
  - test/controller/action_pack_assertions_test.rb
154
165
  - test/controller/addresses_render_test.rb
166
+ - test/controller/assert_select_test.rb
155
167
  - test/controller/base_test.rb
156
168
  - test/controller/benchmark_test.rb
157
- - test/controller/caching_filestore.rb
169
+ - test/controller/caching_test.rb
158
170
  - test/controller/capture_test.rb
159
171
  - test/controller/cgi_test.rb
160
172
  - test/controller/components_test.rb
173
+ - test/controller/content_type_test.rb
174
+ - test/controller/controller_fixtures
161
175
  - test/controller/cookie_test.rb
162
176
  - test/controller/custom_handler_test.rb
177
+ - test/controller/deprecated_instance_variables_test.rb
178
+ - test/controller/deprecation
163
179
  - test/controller/fake_controllers.rb
164
180
  - test/controller/filter_params_test.rb
165
181
  - test/controller/filters_test.rb
166
182
  - test/controller/flash_test.rb
167
183
  - test/controller/fragment_store_setting_test.rb
168
184
  - test/controller/helper_test.rb
185
+ - test/controller/integration_test.rb
169
186
  - test/controller/layout_test.rb
170
187
  - test/controller/mime_responds_test.rb
171
188
  - test/controller/mime_type_test.rb
@@ -174,22 +191,35 @@ files:
174
191
  - test/controller/redirect_test.rb
175
192
  - test/controller/render_test.rb
176
193
  - test/controller/request_test.rb
194
+ - test/controller/resources_test.rb
177
195
  - test/controller/routing_test.rb
196
+ - test/controller/selector_test.rb
178
197
  - test/controller/send_file_test.rb
179
198
  - test/controller/session_management_test.rb
180
199
  - test/controller/test_test.rb
181
200
  - test/controller/url_rewriter_test.rb
182
201
  - test/controller/verification_test.rb
183
202
  - test/controller/webservice_test.rb
203
+ - test/controller/controller_fixtures/app
204
+ - test/controller/controller_fixtures/vendor
205
+ - test/controller/controller_fixtures/app/controllers
206
+ - test/controller/controller_fixtures/app/controllers/admin
207
+ - test/controller/controller_fixtures/app/controllers/user_controller.rb
208
+ - test/controller/controller_fixtures/app/controllers/admin/user_controller.rb
209
+ - test/controller/controller_fixtures/vendor/plugins
210
+ - test/controller/controller_fixtures/vendor/plugins/bad_plugin
211
+ - test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib
212
+ - test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb
213
+ - test/controller/deprecation/deprecated_base_methods_test.rb
184
214
  - test/fixtures/addresses
185
- - test/fixtures/application_root
186
215
  - test/fixtures/companies.yml
187
216
  - test/fixtures/company.rb
217
+ - test/fixtures/content_type
188
218
  - test/fixtures/db_definitions
219
+ - test/fixtures/deprecated_instance_variables
189
220
  - test/fixtures/developer.rb
190
221
  - test/fixtures/developers.yml
191
222
  - test/fixtures/developers_projects.yml
192
- - test/fixtures/dont_load.rb
193
223
  - test/fixtures/fun
194
224
  - test/fixtures/helpers
195
225
  - test/fixtures/layout_tests
@@ -206,15 +236,25 @@ files:
206
236
  - test/fixtures/topic.rb
207
237
  - test/fixtures/topics.yml
208
238
  - test/fixtures/addresses/list.rhtml
209
- - test/fixtures/application_root/app
210
- - test/fixtures/application_root/app/controllers
211
- - test/fixtures/application_root/app/models
212
- - test/fixtures/application_root/app/controllers/a_class_that_contains_a_controller
213
- - test/fixtures/application_root/app/controllers/module_that_holds_controllers
214
- - test/fixtures/application_root/app/controllers/a_class_that_contains_a_controller/poorly_placed_controller.rb
215
- - test/fixtures/application_root/app/controllers/module_that_holds_controllers/nested_controller.rb
216
- - test/fixtures/application_root/app/models/a_class_that_contains_a_controller.rb
239
+ - test/fixtures/content_type/render_default_content_types_for_respond_to.rhtml
240
+ - test/fixtures/content_type/render_default_for_rhtml.rhtml
241
+ - test/fixtures/content_type/render_default_for_rjs.rjs
242
+ - test/fixtures/content_type/render_default_for_rxml.rxml
217
243
  - test/fixtures/db_definitions/sqlite.sql
244
+ - test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml
245
+ - test/fixtures/deprecated_instance_variables/_cookies_method.rhtml
246
+ - test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml
247
+ - test/fixtures/deprecated_instance_variables/_flash_method.rhtml
248
+ - test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml
249
+ - test/fixtures/deprecated_instance_variables/_headers_method.rhtml
250
+ - test/fixtures/deprecated_instance_variables/_params_ivar.rhtml
251
+ - test/fixtures/deprecated_instance_variables/_params_method.rhtml
252
+ - test/fixtures/deprecated_instance_variables/_request_ivar.rhtml
253
+ - test/fixtures/deprecated_instance_variables/_request_method.rhtml
254
+ - test/fixtures/deprecated_instance_variables/_response_ivar.rhtml
255
+ - test/fixtures/deprecated_instance_variables/_response_method.rhtml
256
+ - test/fixtures/deprecated_instance_variables/_session_ivar.rhtml
257
+ - test/fixtures/deprecated_instance_variables/_session_method.rhtml
218
258
  - test/fixtures/fun/games
219
259
  - test/fixtures/fun/games/hello_world.rhtml
220
260
  - test/fixtures/helpers/abc_helper.rb
@@ -240,7 +280,9 @@ files:
240
280
  - test/fixtures/multipart/single_parameter
241
281
  - test/fixtures/multipart/text_file
242
282
  - test/fixtures/public/images
283
+ - test/fixtures/public/javascripts
243
284
  - test/fixtures/public/images/rails.png
285
+ - test/fixtures/public/javascripts/application.js
244
286
  - test/fixtures/respond_to/all_types_with_layout.rhtml
245
287
  - test/fixtures/respond_to/all_types_with_layout.rjs
246
288
  - test/fixtures/respond_to/layouts
@@ -256,6 +298,7 @@ files:
256
298
  - test/fixtures/test/_customer.rhtml
257
299
  - test/fixtures/test/_customer_greeting.rhtml
258
300
  - test/fixtures/test/_hash_object.rhtml
301
+ - test/fixtures/test/_hello.rxml
259
302
  - test/fixtures/test/_partial_only.rhtml
260
303
  - test/fixtures/test/_person.rhtml
261
304
  - test/fixtures/test/action_talk_to_layout.rhtml
@@ -270,6 +313,7 @@ files:
270
313
  - test/fixtures/test/hello.rxml
271
314
  - test/fixtures/test/hello_world.rhtml
272
315
  - test/fixtures/test/hello_world.rxml
316
+ - test/fixtures/test/hello_world_container.rxml
273
317
  - test/fixtures/test/hello_world_with_layout_false.rhtml
274
318
  - test/fixtures/test/hello_xml_world.rxml
275
319
  - test/fixtures/test/list.rhtml
@@ -285,6 +329,8 @@ files:
285
329
  - test/template/benchmark_helper_test.rb
286
330
  - test/template/compiled_templates_test.rb
287
331
  - test/template/date_helper_test.rb
332
+ - test/template/deprecated_helper_test.rb
333
+ - test/template/deprecated_instance_variables_test.rb
288
334
  - test/template/form_helper_test.rb
289
335
  - test/template/form_options_helper_test.rb
290
336
  - test/template/form_tag_helper_test.rb
@@ -331,5 +377,5 @@ dependencies:
331
377
  requirements:
332
378
  - - "="
333
379
  - !ruby/object:Gem::Version
334
- version: 1.3.1
380
+ version: 1.4.0
335
381
  version:
data/filler.txt DELETED
@@ -1,50 +0,0 @@
1
- abCdefGhIjklmNopQrstuVWxyz
2
- abcdeFGHIjklmnOpqrstuvwXyz
3
- abcdeFghijKlmNopqrStUVWxYz
4
- AbCdefghIJklmNopQRsTUvwXyz
5
- abCdefgHijkLmnopqrstuVWxyZ
6
- abCDEfgHijklMNOpQrStUVWXyZ
7
- AbCdefGhiJklmNOpQRsTuvwxyz
8
- abcdefGhijKlMnopQrsTUVwxyz
9
- abcdEfgHiJkLmnopQrStUVwXyz
10
- abcdefghijklMNopqRStuvWxyz
11
- AbcDeFghIJkLmnopQrsTuvwXyZ
12
- abcdefGhiJKLmNOpQRSTuvwXYz
13
- AbcdefghijKlmnOpqrStuvWXyZ
14
- abcDEfghIJklMnOpqrstuvWxyz
15
- abcdefGhijklMnopqrstuvwxYz
16
- abcDeFGhijKlmnoPqRstuVwXyz
17
- AbcDefghijklmnopQrsTUvWXYz
18
- abcdefGhijKlmnOpqrstUvWxyz
19
- aBCdEfGhiJklmnOpqrstuvwXYZ
20
- aBcdefGhijklMnOpQrStuvwxYZ
21
- abcdeFghijklMnopqrStuvwxYZ
22
- aBcdefghiJklmnOPqrstuvwxyz
23
- abcDEFghijKLmNoPqrsTUvwxYz
24
- aBCdEfghijKlmNOpqrstUvwxyz
25
- abCDEfghijklMnopqrstuvwXYz
26
- aBcDeFghijklmnopqRstuvwxyz
27
- abcdEfghIjkLMNOpqRstuvwxYz
28
- ABcDefGHijKlmNopQrstUvwxYz
29
- abcDefGhijklMnOPQrstuVwXyZ
30
- AbcdefghijKlmNoPqrsTuvwXYZ
31
- AbcdeFGhiJklmnopQrsTuvWxYz
32
- AbCdEfgHiJKlMNoPQrsTUVwXyz
33
- aBcDefGhijkLMnOpqrsTuVwxyz
34
- abcdeFGhijKlmNOPqrStuVWxyz
35
- AbCdEfghijKlmnopqrstuvwxyz
36
- AbcdefGHijkLmnOPQRSTuVwXyZ
37
- aBcdeFghiJkLMnoPqrSTuvwxyZ
38
- abCDeFghijKlmnOpqRstUvwxyz
39
- aBcDefghIjKLMnoPQrStuVwXyz
40
- abcDEfgHijkLmNopqrstUVwXyz
41
- AbCDeFghijKLmnopQrStuvwxyz
42
- abcDefGhIjKlmnOPQrsTuvWxyz
43
- ABCdEfghijklmnopqrSTuVwxYz
44
- ABcdEfGhijKlmnOpqRsTUVWxyZ
45
- ABCdeFgHIjklMNOpqrstUvwxYz
46
- aBcdefghiJkLMNopqrstuVWxYz
47
- abCdEFgHIjKlmnopqrsTUVwXYZ
48
- AbcdefGhijklmnopQRsTuVwxYZ
49
- abcdeFgHijklMNopQrstuvWxyz
50
- abCdeFgHijKlmnOpqrsTuvwXyz
@@ -1,235 +0,0 @@
1
- module ActionController
2
- module CodeGeneration #:nodoc:
3
- class GenerationError < StandardError #:nodoc:
4
- end
5
-
6
- class Source #:nodoc:
7
- attr_reader :lines, :indentation_level
8
- IndentationString = ' '
9
- def initialize
10
- @lines, @indentation_level = [], 0
11
- end
12
- def line(line)
13
- @lines << (IndentationString * @indentation_level + line)
14
- end
15
- alias :<< :line
16
-
17
- def indent
18
- @indentation_level += 1
19
- yield
20
- ensure
21
- @indentation_level -= 1
22
- end
23
-
24
- def to_s() lines.join("\n") end
25
- end
26
-
27
- class CodeGenerator #:nodoc:
28
- attr_accessor :source, :locals
29
- def initialize(source = nil)
30
- @locals = []
31
- @source = source || Source.new
32
- end
33
-
34
- BeginKeywords = %w(if unless begin until while def).collect {|kw| kw.to_sym}
35
- ResumeKeywords = %w(elsif else rescue).collect {|kw| kw.to_sym}
36
- Keywords = BeginKeywords + ResumeKeywords
37
-
38
- def method_missing(keyword, *text)
39
- if Keywords.include? keyword
40
- if ResumeKeywords.include? keyword
41
- raise GenerationError, "Can only resume with #{keyword} immediately after an end" unless source.lines.last =~ /^\s*end\s*$/
42
- source.lines.pop # Remove the 'end'
43
- end
44
-
45
- line "#{keyword} #{text.join ' '}"
46
- begin source.indent { yield(self.dup) }
47
- ensure line 'end'
48
- end
49
- else
50
- super(keyword, *text)
51
- end
52
- end
53
-
54
- def line(*args) self.source.line(*args) end
55
- alias :<< :line
56
- def indent(*args, &block) source(*args, &block) end
57
- def to_s() source.to_s end
58
-
59
- def share_locals_with(other)
60
- other.locals = self.locals = (other.locals | locals)
61
- end
62
-
63
- FieldsToDuplicate = [:locals]
64
- def dup
65
- copy = self.class.new(source)
66
- self.class::FieldsToDuplicate.each do |sym|
67
- value = self.send(sym)
68
- value = value.dup unless value.nil? || value.is_a?(Numeric)
69
- copy.send("#{sym}=", value)
70
- end
71
- return copy
72
- end
73
- end
74
-
75
- class RecognitionGenerator < CodeGenerator #:nodoc:
76
- Attributes = [:after, :before, :current, :results, :constants, :depth, :move_ahead, :finish_statement]
77
- attr_accessor(*Attributes)
78
- FieldsToDuplicate = CodeGenerator::FieldsToDuplicate + Attributes
79
-
80
- def initialize(*args)
81
- super(*args)
82
- @after, @before = [], []
83
- @current = nil
84
- @results, @constants = {}, {}
85
- @depth = 0
86
- @move_ahead = nil
87
- @finish_statement = Proc.new {|hash_expr| hash_expr}
88
- end
89
-
90
- def if_next_matches(string, &block)
91
- test = Routing.test_condition(next_segment(true), string)
92
- self.if(test, &block)
93
- end
94
-
95
- def move_forward(places = 1)
96
- dup = self.dup
97
- dup.depth += 1
98
- dup.move_ahead = places
99
- yield dup
100
- end
101
-
102
- def next_segment(assign_inline = false, default = nil)
103
- if locals.include?(segment_name)
104
- code = segment_name
105
- else
106
- code = "#{segment_name} = #{path_name}[#{index_name}]"
107
- if assign_inline
108
- code = "(#{code})"
109
- else
110
- line(code)
111
- code = segment_name
112
- end
113
-
114
- locals << segment_name
115
- end
116
- code = "(#{code} || #{default.inspect})" if default
117
-
118
- return code.to_s
119
- end
120
-
121
- def segment_name() "segment#{depth}".to_sym end
122
- def path_name() :path end
123
- def index_name
124
- move_ahead, @move_ahead = @move_ahead, nil
125
- move_ahead ? "index += #{move_ahead}" : 'index'
126
- end
127
-
128
- def continue
129
- dup = self.dup
130
- dup.before << dup.current
131
- dup.current = dup.after.shift
132
- dup.go
133
- end
134
-
135
- def go
136
- if current then current.write_recognition(self)
137
- else self.finish
138
- end
139
- end
140
-
141
- def result(key, expression, delay = false)
142
- unless delay
143
- line "#{key}_value = #{expression}"
144
- expression = "#{key}_value"
145
- end
146
- results[key] = expression
147
- end
148
- def constant_result(key, object)
149
- constants[key] = object
150
- end
151
-
152
- def finish(ensure_traversal_finished = true)
153
- pairs = []
154
- (results.keys + constants.keys).uniq.each do |key|
155
- pairs << "#{key.to_s.inspect} => #{results[key] ? results[key] : constants[key].inspect}"
156
- end
157
- hash_expr = "{#{pairs.join(', ')}}"
158
-
159
- statement = finish_statement.call(hash_expr)
160
- if ensure_traversal_finished then self.if("! #{next_segment(true)}") {|gp| gp << statement}
161
- else self << statement
162
- end
163
- end
164
- end
165
-
166
- class GenerationGenerator < CodeGenerator #:nodoc:
167
- Attributes = [:after, :before, :current, :segments]
168
- attr_accessor(*Attributes)
169
- FieldsToDuplicate = CodeGenerator::FieldsToDuplicate + Attributes
170
-
171
- def initialize(*args)
172
- super(*args)
173
- @after, @before = [], []
174
- @current = nil
175
- @segments = []
176
- end
177
-
178
- def hash_name() 'hash' end
179
- def local_name(key) "#{key}_value" end
180
-
181
- def hash_value(key, assign = true, default = nil)
182
- if locals.include?(local_name(key)) then code = local_name(key)
183
- else
184
- code = "hash[#{key.to_sym.inspect}]"
185
- if assign
186
- code = "(#{local_name(key)} = #{code})"
187
- locals << local_name(key)
188
- end
189
- end
190
- code = "(#{code} || (#{default.inspect}))" if default
191
- return code
192
- end
193
-
194
- def expire_for_keys(*keys)
195
- return if keys.empty?
196
- conds = keys.collect {|key| "expire_on[#{key.to_sym.inspect}]"}
197
- line "not_expired, #{hash_name} = false, options if not_expired && #{conds.join(' && ')}"
198
- end
199
-
200
- def add_segment(*segments)
201
- d = dup
202
- d.segments.concat segments
203
- yield d
204
- end
205
-
206
- def go
207
- if current then current.write_generation(self)
208
- else self.finish
209
- end
210
- end
211
-
212
- def continue
213
- d = dup
214
- d.before << d.current
215
- d.current = d.after.shift
216
- d.go
217
- end
218
-
219
- def finish
220
- line %("/#{segments.join('/')}")
221
- end
222
-
223
- def check_conditions(conditions)
224
- tests = []
225
- generator = nil
226
- conditions.each do |key, condition|
227
- tests << (generator || self).hash_value(key, true) if condition.is_a? Regexp
228
- tests << Routing.test_condition((generator || self).hash_value(key, false), condition)
229
- generator = self.dup unless generator
230
- end
231
- return tests.join(' && ')
232
- end
233
- end
234
- end
235
- end