radiant 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of radiant might be problematic. Click here for more details.

Files changed (1961) hide show
  1. data/CHANGELOG +188 -35
  2. data/CONTRIBUTORS +25 -2
  3. data/INSTALL +1 -1
  4. data/app/controllers/admin/abstract_model_controller.rb +13 -13
  5. data/app/controllers/admin/export_controller.rb +1 -2
  6. data/app/controllers/admin/extension_controller.rb +0 -5
  7. data/app/controllers/admin/page_controller.rb +2 -0
  8. data/app/controllers/application.rb +1 -1
  9. data/app/controllers/site_controller.rb +8 -1
  10. data/app/helpers/admin/node_helper.rb +21 -18
  11. data/app/helpers/application_helper.rb +4 -13
  12. data/app/models/layout.rb +2 -2
  13. data/app/models/page.rb +25 -21
  14. data/app/models/page_context.rb +3 -5
  15. data/app/models/response_cache.rb +19 -27
  16. data/app/models/snippet.rb +2 -2
  17. data/app/models/standard_tags.rb +148 -26
  18. data/app/models/user.rb +2 -2
  19. data/app/views/admin/extension/index.html.erb +40 -0
  20. data/app/views/admin/layout/edit.html.erb +39 -0
  21. data/app/views/admin/layout/{index.rhtml → index.html.erb} +0 -0
  22. data/app/views/admin/layout/{remove.rhtml → remove.html.erb} +0 -0
  23. data/app/views/admin/page/_meta_row.html.erb +4 -0
  24. data/app/views/admin/page/{_node.rhtml → _node.html.erb} +0 -0
  25. data/app/views/admin/page/{_part.rhtml → _part.html.erb} +0 -0
  26. data/app/views/admin/page/_tag_reference.html.erb +4 -0
  27. data/app/views/admin/page/{children.rhtml → children.html.erb} +0 -0
  28. data/app/views/admin/page/edit.html.erb +140 -0
  29. data/app/views/admin/page/index.html.erb +31 -0
  30. data/app/views/admin/page/{remove.rhtml → remove.html.erb} +0 -0
  31. data/app/views/admin/snippet/{edit.rhtml → edit.html.erb} +0 -0
  32. data/app/views/admin/snippet/{index.rhtml → index.html.erb} +0 -0
  33. data/app/views/admin/snippet/{remove.rhtml → remove.html.erb} +0 -0
  34. data/app/views/admin/user/edit.html.erb +54 -0
  35. data/app/views/admin/user/{index.rhtml → index.html.erb} +0 -0
  36. data/app/views/admin/user/preferences.html.erb +29 -0
  37. data/app/views/admin/user/{remove.rhtml → remove.html.erb} +0 -0
  38. data/app/views/admin/welcome/{login.rhtml → login.html.erb} +0 -0
  39. data/app/views/layouts/{application.rhtml → application.html.erb} +0 -0
  40. data/app/views/site/{not_found.rhtml → not_found.html.erb} +0 -0
  41. data/bin/radiant +0 -0
  42. data/config/boot.rb +136 -26
  43. data/config/environment.rb +61 -53
  44. data/config/environments/development.rb +2 -3
  45. data/config/environments/test.rb +14 -7
  46. data/db/migrate/015_add_optimistic_locking.rb +6 -6
  47. data/db/migrate/017_rename_created_by_updated_by_columns.rb +15 -0
  48. data/db/migrate/018_add_description_and_keywords_to_pages.rb +11 -0
  49. data/db/schema.rb +66 -59
  50. data/db/templates/styled-blog.yml +3 -3
  51. data/lib/annotatable.rb +16 -0
  52. data/lib/autotest/discover.rb +3 -0
  53. data/lib/autotest/radiant_rails_rspec.rb +111 -0
  54. data/lib/generators/extension/USAGE +16 -14
  55. data/lib/generators/extension/extension_generator.rb +29 -7
  56. data/lib/generators/extension/templates/RSpecRakefile +120 -0
  57. data/lib/generators/extension/templates/Rakefile +0 -0
  58. data/lib/generators/extension/templates/spec.opts +6 -0
  59. data/lib/generators/extension/templates/spec_helper.rb +37 -0
  60. data/lib/generators/extension/templates/test_helper.rb +9 -2
  61. data/lib/generators/extension_controller/USAGE +4 -2
  62. data/lib/generators/extension_controller/extension_controller_generator.rb +50 -0
  63. data/lib/generators/extension_controller/templates/controller_spec.rb +23 -0
  64. data/lib/generators/extension_controller/templates/helper_spec.rb +11 -0
  65. data/lib/generators/extension_controller/templates/view_spec.rb +12 -0
  66. data/lib/generators/extension_model/USAGE +3 -2
  67. data/lib/generators/extension_model/extension_model_generator.rb +34 -0
  68. data/lib/generators/extension_model/templates/model_spec.rb +11 -0
  69. data/lib/generators/instance/templates/instance_boot.rb +136 -33
  70. data/lib/generators/instance/templates/instance_environment.rb +85 -4
  71. data/lib/login_system.rb +16 -0
  72. data/lib/plugins/dependencies_fix/init.rb +5 -5
  73. data/lib/plugins/extension_patches/init.rb +0 -1
  74. data/lib/plugins/extension_patches/lib/fixture_loading_extension.rb +76 -75
  75. data/lib/plugins/extension_patches/lib/mailer_view_paths_extension.rb +19 -14
  76. data/lib/plugins/string_extensions/lib/string_extensions.rb +4 -0
  77. data/lib/plugins/symbol_extensions/init.rb +1 -0
  78. data/lib/plugins/symbol_extensions/lib/symbol_extensions.rb +7 -0
  79. data/lib/radiant.rb +2 -8
  80. data/lib/radiant/extension.rb +11 -43
  81. data/lib/radiant/extension_loader.rb +144 -135
  82. data/lib/radiant/initializer.rb +126 -33
  83. data/lib/radiant/setup.rb +1 -0
  84. data/lib/tasks/database.rake +44 -3
  85. data/lib/tasks/extensions.rake +29 -11
  86. data/lib/tasks/framework.rake +20 -6
  87. data/lib/tasks/instance.rake +5 -2
  88. data/lib/tasks/release.rake +1 -0
  89. data/public/dispatch.cgi +0 -0
  90. data/public/dispatch.fcgi +0 -0
  91. data/public/dispatch.rb +0 -0
  92. data/public/images/admin/brown-bottom-line.gif +0 -0
  93. data/public/images/admin/view-site.gif +0 -0
  94. data/public/javascripts/admin/admin.js +142 -0
  95. data/public/javascripts/{ruledtable.js → admin/ruledtable.js} +0 -0
  96. data/public/javascripts/admin/sitemap.js +131 -0
  97. data/public/javascripts/admin/tabcontrol.js +127 -0
  98. data/public/javascripts/pngfix.js +1 -1
  99. data/public/stylesheets/admin/main.css +11 -6
  100. data/script/about +0 -0
  101. data/script/breakpointer +0 -0
  102. data/script/console +0 -0
  103. data/script/destroy +0 -0
  104. data/script/generate +0 -0
  105. data/script/performance/benchmarker +0 -0
  106. data/script/performance/profiler +0 -0
  107. data/script/plugin +0 -0
  108. data/script/process/inspector +0 -0
  109. data/script/process/reaper +0 -0
  110. data/script/process/spawner +0 -0
  111. data/script/process/spinner +0 -0
  112. data/script/runner +0 -0
  113. data/script/server +0 -0
  114. data/script/spec +12 -0
  115. data/script/spec_server +99 -0
  116. data/script/version +0 -0
  117. data/spec/controllers/admin/abstract_model_controller_spec.rb +263 -0
  118. data/spec/controllers/admin/export_controller_spec.rb +16 -0
  119. data/spec/controllers/admin/extension_controller_spec.rb +21 -0
  120. data/spec/controllers/admin/layout_controller_spec.rb +42 -0
  121. data/spec/controllers/admin/page_controller_spec.rb +312 -0
  122. data/spec/controllers/admin/snippet_controller_spec.rb +27 -0
  123. data/spec/controllers/admin/user_controller_spec.rb +72 -0
  124. data/spec/controllers/admin/welcome_controller_spec.rb +37 -0
  125. data/spec/controllers/application_controller_spec.rb +41 -0
  126. data/spec/controllers/site_controller_spec.rb +109 -0
  127. data/spec/fixtures/sample.txt +1 -0
  128. data/spec/helpers/admin/abstract_model_helper_spec.rb +4 -0
  129. data/spec/helpers/admin/export_helper_spec.rb +4 -0
  130. data/spec/helpers/admin/extension_helper_spec.rb +4 -0
  131. data/spec/helpers/admin/layout_helper_spec.rb +4 -0
  132. data/spec/helpers/admin/node_helper_spec.rb +97 -0
  133. data/spec/helpers/admin/page_helper_spec.rb +41 -0
  134. data/spec/helpers/admin/snippet_helper_spec.rb +4 -0
  135. data/spec/helpers/admin/user_helper_spec.rb +4 -0
  136. data/spec/helpers/admin/welcome_helper_spec.rb +4 -0
  137. data/spec/helpers/application_helper_spec.rb +166 -0
  138. data/spec/helpers/site_helper_spec.rb +4 -0
  139. data/spec/lib/annotatable_spec.rb +86 -0
  140. data/spec/lib/autotest_spec.rb +81 -0
  141. data/spec/lib/inheritable_class_attributes_spec.rb +90 -0
  142. data/spec/lib/local_time_spec.rb +40 -0
  143. data/spec/lib/login_system_spec.rb +142 -0
  144. data/spec/lib/method_observer_spec.rb +48 -0
  145. data/spec/lib/radiant/admin_ui_spec.rb +133 -0
  146. data/spec/lib/radiant/extension_loader_spec.rb +179 -0
  147. data/spec/lib/radiant/extension_migrator_spec.rb +17 -0
  148. data/spec/lib/radiant/extension_spec.rb +69 -0
  149. data/spec/lib/radiant/initializer_spec.rb +80 -0
  150. data/spec/lib/radiant/taggable_spec.rb +150 -0
  151. data/spec/lib/radiant_spec.rb +26 -0
  152. data/spec/lib/simpleton_spec.rb +45 -0
  153. data/spec/matchers/login_system_matcher.rb +79 -0
  154. data/spec/matchers/render_matcher.rb +115 -0
  155. data/spec/models/env_dump_page_spec.rb +18 -0
  156. data/spec/models/file_not_found_page_spec.rb +31 -0
  157. data/spec/models/layout_spec.rb +29 -0
  158. data/spec/models/page_context_spec.rb +68 -0
  159. data/spec/models/page_part_spec.rb +47 -0
  160. data/spec/models/page_spec.rb +500 -0
  161. data/spec/models/radiant/config_spec.rb +57 -0
  162. data/spec/models/radiant/exporter_spec.rb +25 -0
  163. data/spec/models/response_cache_spec.rb +259 -0
  164. data/spec/models/snippet_spec.rb +41 -0
  165. data/spec/models/standard_tags_spec.rb +774 -0
  166. data/spec/models/status_spec.rb +53 -0
  167. data/spec/models/text_filter_spec.rb +40 -0
  168. data/spec/models/user_action_observer_spec.rb +34 -0
  169. data/spec/models/user_spec.rb +135 -0
  170. data/spec/rcov.opts +2 -0
  171. data/spec/scenarios/file_not_found_scenario.rb +13 -0
  172. data/spec/scenarios/home_page_scenario.rb +64 -0
  173. data/spec/scenarios/layouts_scenario.rb +58 -0
  174. data/spec/scenarios/markup_pages_scenario.rb +13 -0
  175. data/spec/scenarios/pages_scenario.rb +50 -0
  176. data/spec/scenarios/pages_with_layouts_scenario.rb +10 -0
  177. data/spec/scenarios/snippets_scenario.rb +34 -0
  178. data/spec/scenarios/users_and_pages_scenario.rb +9 -0
  179. data/spec/scenarios/users_scenario.rb +43 -0
  180. data/spec/spec.opts +3 -0
  181. data/spec/spec_helper.rb +64 -0
  182. data/stories/all.rb +4 -0
  183. data/stories/helper.rb +3 -0
  184. data/test/fixtures/extensions/01_basic/app/views/basic_extension/{index.rhtml → index.html.erb} +0 -0
  185. data/test/fixtures/extensions/01_basic/app/views/basic_extension/{override.rhtml → override.html.erb} +0 -0
  186. data/test/fixtures/extensions/01_basic/app/views/basic_extension_mailer/{message.rhtml → message.text.html.erb} +0 -0
  187. data/test/fixtures/extensions/02_overriding/app/views/basic_extension/{override.rhtml → override.html.erb} +0 -0
  188. data/test/fixtures/page_parts.yml +6 -1
  189. data/test/fixtures/pages.yml +33 -19
  190. data/test/helpers/caching_test_helper.rb +39 -38
  191. data/test/helpers/extension_fixture_test_helper.rb +39 -39
  192. data/test/helpers/extension_tag_test_helper.rb +16 -16
  193. data/test/helpers/logging_test_helper.rb +10 -0
  194. data/test/helpers/render_test_helper.rb +3 -3
  195. data/test/helpers/validation_test_helper.rb +42 -42
  196. data/test/test_helper.rb +6 -4
  197. data/vendor/extensions/archive/Rakefile +105 -10
  198. data/vendor/extensions/archive/app/models/archive_day_index_page.rb +0 -0
  199. data/vendor/extensions/archive/app/models/archive_month_index_page.rb +0 -0
  200. data/vendor/extensions/archive/app/models/archive_page.rb +0 -0
  201. data/vendor/extensions/archive/app/models/archive_year_index_page.rb +0 -0
  202. data/vendor/extensions/archive/lib/archive_index_tags_and_methods.rb +0 -0
  203. data/vendor/extensions/archive/spec/models/archive_day_index_page_spec.rb +20 -0
  204. data/vendor/extensions/archive/spec/models/archive_month_index_page_spec.rb +20 -0
  205. data/vendor/extensions/archive/spec/models/archive_page_spec.rb +33 -0
  206. data/vendor/extensions/archive/spec/models/archive_year_index_page_spec.rb +20 -0
  207. data/vendor/extensions/archive/spec/scenarios/archive_scenario.rb +51 -0
  208. data/vendor/extensions/archive/spec/spec.opts +6 -0
  209. data/vendor/extensions/archive/spec/spec_helper.rb +37 -0
  210. data/vendor/extensions/archive/test/functional/archive_extension_test.rb +1 -1
  211. data/vendor/extensions/archive/test/helpers/archive_index_test_helper.rb +0 -0
  212. data/vendor/extensions/archive/test/test_helper.rb +11 -4
  213. data/vendor/extensions/archive/test/unit/archive_day_index_page_test.rb +0 -0
  214. data/vendor/extensions/archive/test/unit/archive_month_index_page_test.rb +0 -0
  215. data/vendor/extensions/archive/test/unit/archive_page_test.rb +0 -0
  216. data/vendor/extensions/archive/test/unit/archive_year_index_page_test.rb +0 -0
  217. data/vendor/extensions/markdown_filter/Rakefile +105 -10
  218. data/vendor/extensions/markdown_filter/lib/tasks/markdown_filter_extension_tasks.rake +28 -0
  219. data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +15 -0
  220. data/vendor/extensions/markdown_filter/spec/models/smarty_pants_filter_spec.rb +12 -0
  221. data/vendor/extensions/markdown_filter/spec/spec.opts +6 -0
  222. data/vendor/extensions/markdown_filter/spec/spec_helper.rb +37 -0
  223. data/vendor/extensions/markdown_filter/test/test_helper.rb +11 -2
  224. data/vendor/extensions/textile_filter/Rakefile +105 -10
  225. data/vendor/extensions/textile_filter/spec/models/textile_filter_spec.rb +11 -0
  226. data/vendor/extensions/textile_filter/spec/spec.opts +6 -0
  227. data/vendor/extensions/textile_filter/spec/spec_helper.rb +37 -0
  228. data/vendor/extensions/textile_filter/test/test_helper.rb +11 -2
  229. data/vendor/plugins/acts_as_tree/README +26 -0
  230. data/vendor/plugins/acts_as_tree/Rakefile +22 -0
  231. data/vendor/plugins/acts_as_tree/init.rb +1 -0
  232. data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
  233. data/vendor/plugins/acts_as_tree/test/abstract_unit.rb +0 -0
  234. data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
  235. data/vendor/plugins/acts_as_tree/test/database.yml +0 -0
  236. data/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
  237. data/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
  238. data/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
  239. data/vendor/plugins/rspec/CHANGES +1079 -0
  240. data/vendor/plugins/rspec/MIT-LICENSE +20 -0
  241. data/vendor/plugins/rspec/README +71 -0
  242. data/vendor/plugins/rspec/Rakefile +279 -0
  243. data/vendor/plugins/rspec/TODO +2 -0
  244. data/vendor/plugins/rspec/UPGRADE +31 -0
  245. data/vendor/plugins/rspec/bin/spec +4 -0
  246. data/vendor/plugins/rspec/bin/spec_translator +8 -0
  247. data/vendor/plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +19 -0
  248. data/vendor/plugins/rspec/examples/pure/before_and_after_example.rb +40 -0
  249. data/vendor/plugins/rspec/examples/pure/behave_as_example.rb +45 -0
  250. data/vendor/plugins/rspec/examples/pure/custom_expectation_matchers.rb +54 -0
  251. data/vendor/plugins/rspec/examples/pure/custom_formatter.rb +12 -0
  252. data/vendor/plugins/rspec/examples/pure/dynamic_spec.rb +9 -0
  253. data/vendor/plugins/rspec/examples/pure/file_accessor.rb +19 -0
  254. data/vendor/plugins/rspec/examples/pure/file_accessor_spec.rb +38 -0
  255. data/vendor/plugins/rspec/examples/pure/greeter_spec.rb +31 -0
  256. data/vendor/plugins/rspec/examples/pure/helper_method_example.rb +14 -0
  257. data/vendor/plugins/rspec/examples/pure/io_processor.rb +8 -0
  258. data/vendor/plugins/rspec/examples/pure/io_processor_spec.rb +21 -0
  259. data/vendor/plugins/rspec/examples/pure/legacy_spec.rb +11 -0
  260. data/vendor/plugins/rspec/examples/pure/mocking_example.rb +27 -0
  261. data/vendor/plugins/rspec/examples/pure/multi_threaded_behaviour_runner.rb +28 -0
  262. data/vendor/plugins/rspec/examples/pure/nested_classes_example.rb +36 -0
  263. data/vendor/plugins/rspec/examples/pure/partial_mock_example.rb +28 -0
  264. data/vendor/plugins/rspec/examples/pure/pending_example.rb +20 -0
  265. data/vendor/plugins/rspec/examples/pure/predicate_example.rb +27 -0
  266. data/vendor/plugins/rspec/examples/pure/priority.txt +1 -0
  267. data/vendor/plugins/rspec/examples/pure/shared_example_group_example.rb +81 -0
  268. data/vendor/plugins/rspec/examples/pure/shared_stack_examples.rb +38 -0
  269. data/vendor/plugins/rspec/examples/pure/spec_helper.rb +3 -0
  270. data/vendor/plugins/rspec/examples/pure/stack.rb +36 -0
  271. data/vendor/plugins/rspec/examples/pure/stack_spec.rb +63 -0
  272. data/vendor/plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +67 -0
  273. data/vendor/plugins/rspec/examples/pure/stubbing_example.rb +69 -0
  274. data/vendor/plugins/rspec/examples/stories/adder.rb +13 -0
  275. data/vendor/plugins/rspec/examples/stories/addition +34 -0
  276. data/vendor/plugins/rspec/examples/stories/addition.rb +9 -0
  277. data/vendor/plugins/rspec/examples/stories/calculator.rb +65 -0
  278. data/vendor/plugins/rspec/examples/stories/game-of-life/README.txt +21 -0
  279. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/everything.rb +6 -0
  280. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/examples.rb +3 -0
  281. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +35 -0
  282. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +66 -0
  283. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithLessThanTwoNeighboursDie.story +21 -0
  284. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithMoreThanThreeNeighboursDie.story +21 -0
  285. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/EmptySpacesWithThreeNeighboursCreateACell.story +42 -0
  286. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanCreateACell.story +42 -0
  287. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanKillACell.story +17 -0
  288. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/TheGridWraps.story +53 -0
  289. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +52 -0
  290. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/helper.rb +6 -0
  291. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +26 -0
  292. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/steps.rb +5 -0
  293. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.rb +3 -0
  294. data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.txt +22 -0
  295. data/vendor/plugins/rspec/examples/stories/game-of-life/life.rb +3 -0
  296. data/vendor/plugins/rspec/examples/stories/game-of-life/life/game.rb +23 -0
  297. data/vendor/plugins/rspec/examples/stories/game-of-life/life/grid.rb +43 -0
  298. data/vendor/plugins/rspec/examples/stories/helper.rb +9 -0
  299. data/vendor/plugins/rspec/examples/stories/steps/addition_steps.rb +18 -0
  300. data/vendor/plugins/rspec/failing_examples/README.txt +7 -0
  301. data/vendor/plugins/rspec/failing_examples/diffing_spec.rb +36 -0
  302. data/vendor/plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +19 -0
  303. data/vendor/plugins/rspec/failing_examples/failure_in_setup.rb +10 -0
  304. data/vendor/plugins/rspec/failing_examples/failure_in_teardown.rb +10 -0
  305. data/vendor/plugins/rspec/failing_examples/mocking_example.rb +40 -0
  306. data/vendor/plugins/rspec/failing_examples/mocking_with_flexmock.rb +26 -0
  307. data/vendor/plugins/rspec/failing_examples/mocking_with_mocha.rb +25 -0
  308. data/vendor/plugins/rspec/failing_examples/mocking_with_rr.rb +27 -0
  309. data/vendor/plugins/rspec/failing_examples/partial_mock_example.rb +20 -0
  310. data/vendor/plugins/rspec/failing_examples/predicate_example.rb +29 -0
  311. data/vendor/plugins/rspec/failing_examples/raising_example.rb +47 -0
  312. data/vendor/plugins/rspec/failing_examples/spec_helper.rb +3 -0
  313. data/vendor/plugins/rspec/failing_examples/syntax_error_example.rb +7 -0
  314. data/vendor/plugins/rspec/failing_examples/team_spec.rb +44 -0
  315. data/vendor/plugins/rspec/failing_examples/timeout_behaviour.rb +7 -0
  316. data/vendor/plugins/rspec/init.rb +9 -0
  317. data/vendor/plugins/rspec/lib/autotest/discover.rb +3 -0
  318. data/vendor/plugins/rspec/lib/autotest/rspec.rb +72 -0
  319. data/vendor/plugins/rspec/lib/spec.rb +30 -0
  320. data/vendor/plugins/rspec/lib/spec/example.rb +12 -0
  321. data/vendor/plugins/rspec/lib/spec/example/configuration.rb +144 -0
  322. data/vendor/plugins/rspec/lib/spec/example/errors.rb +9 -0
  323. data/vendor/plugins/rspec/lib/spec/example/example_group.rb +16 -0
  324. data/vendor/plugins/rspec/lib/spec/example/example_group_factory.rb +58 -0
  325. data/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb +433 -0
  326. data/vendor/plugins/rspec/lib/spec/example/example_matcher.rb +42 -0
  327. data/vendor/plugins/rspec/lib/spec/example/example_methods.rb +110 -0
  328. data/vendor/plugins/rspec/lib/spec/example/module_reopening_fix.rb +21 -0
  329. data/vendor/plugins/rspec/lib/spec/example/pending.rb +18 -0
  330. data/vendor/plugins/rspec/lib/spec/example/shared_example_group.rb +58 -0
  331. data/vendor/plugins/rspec/lib/spec/expectations.rb +56 -0
  332. data/vendor/plugins/rspec/lib/spec/expectations/differs/default.rb +66 -0
  333. data/vendor/plugins/rspec/lib/spec/expectations/errors.rb +12 -0
  334. data/vendor/plugins/rspec/lib/spec/expectations/extensions.rb +2 -0
  335. data/vendor/plugins/rspec/lib/spec/expectations/extensions/object.rb +71 -0
  336. data/vendor/plugins/rspec/lib/spec/expectations/extensions/string_and_symbol.rb +17 -0
  337. data/vendor/plugins/rspec/lib/spec/expectations/handler.rb +52 -0
  338. data/vendor/plugins/rspec/lib/spec/extensions.rb +4 -0
  339. data/vendor/plugins/rspec/lib/spec/extensions/class.rb +24 -0
  340. data/vendor/plugins/rspec/lib/spec/extensions/main.rb +102 -0
  341. data/vendor/plugins/rspec/lib/spec/extensions/metaclass.rb +7 -0
  342. data/vendor/plugins/rspec/lib/spec/extensions/object.rb +6 -0
  343. data/vendor/plugins/rspec/lib/spec/interop/test.rb +12 -0
  344. data/vendor/plugins/rspec/lib/spec/interop/test/unit/autorunner.rb +6 -0
  345. data/vendor/plugins/rspec/lib/spec/interop/test/unit/testcase.rb +61 -0
  346. data/vendor/plugins/rspec/lib/spec/interop/test/unit/testresult.rb +6 -0
  347. data/vendor/plugins/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb +34 -0
  348. data/vendor/plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +61 -0
  349. data/vendor/plugins/rspec/lib/spec/matchers.rb +156 -0
  350. data/vendor/plugins/rspec/lib/spec/matchers/be.rb +224 -0
  351. data/vendor/plugins/rspec/lib/spec/matchers/be_close.rb +37 -0
  352. data/vendor/plugins/rspec/lib/spec/matchers/change.rb +144 -0
  353. data/vendor/plugins/rspec/lib/spec/matchers/eql.rb +43 -0
  354. data/vendor/plugins/rspec/lib/spec/matchers/equal.rb +43 -0
  355. data/vendor/plugins/rspec/lib/spec/matchers/exist.rb +17 -0
  356. data/vendor/plugins/rspec/lib/spec/matchers/has.rb +34 -0
  357. data/vendor/plugins/rspec/lib/spec/matchers/have.rb +145 -0
  358. data/vendor/plugins/rspec/lib/spec/matchers/include.rb +70 -0
  359. data/vendor/plugins/rspec/lib/spec/matchers/match.rb +41 -0
  360. data/vendor/plugins/rspec/lib/spec/matchers/operator_matcher.rb +73 -0
  361. data/vendor/plugins/rspec/lib/spec/matchers/raise_error.rb +132 -0
  362. data/vendor/plugins/rspec/lib/spec/matchers/respond_to.rb +45 -0
  363. data/vendor/plugins/rspec/lib/spec/matchers/satisfy.rb +47 -0
  364. data/vendor/plugins/rspec/lib/spec/matchers/simple_matcher.rb +29 -0
  365. data/vendor/plugins/rspec/lib/spec/matchers/throw_symbol.rb +74 -0
  366. data/vendor/plugins/rspec/lib/spec/mocks.rb +211 -0
  367. data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb +31 -0
  368. data/vendor/plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb.orig +27 -0
  369. data/vendor/plugins/rspec/lib/spec/mocks/argument_expectation.rb +209 -0
  370. data/vendor/plugins/rspec/lib/spec/mocks/error_generator.rb +84 -0
  371. data/vendor/plugins/rspec/lib/spec/mocks/errors.rb +10 -0
  372. data/vendor/plugins/rspec/lib/spec/mocks/extensions/object.rb +3 -0
  373. data/vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb +269 -0
  374. data/vendor/plugins/rspec/lib/spec/mocks/methods.rb +39 -0
  375. data/vendor/plugins/rspec/lib/spec/mocks/mock.rb +50 -0
  376. data/vendor/plugins/rspec/lib/spec/mocks/order_group.rb +29 -0
  377. data/vendor/plugins/rspec/lib/spec/mocks/proxy.rb +166 -0
  378. data/vendor/plugins/rspec/lib/spec/mocks/space.rb +28 -0
  379. data/vendor/plugins/rspec/lib/spec/mocks/spec_methods.rb +38 -0
  380. data/vendor/plugins/rspec/lib/spec/rake/spectask.rb +235 -0
  381. data/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb +52 -0
  382. data/vendor/plugins/rspec/lib/spec/runner.rb +202 -0
  383. data/vendor/plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +57 -0
  384. data/vendor/plugins/rspec/lib/spec/runner/class_and_arguments_parser.rb +16 -0
  385. data/vendor/plugins/rspec/lib/spec/runner/command_line.rb +28 -0
  386. data/vendor/plugins/rspec/lib/spec/runner/drb_command_line.rb +20 -0
  387. data/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb +59 -0
  388. data/vendor/plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +77 -0
  389. data/vendor/plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +130 -0
  390. data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_example_groups_formatter.rb +33 -0
  391. data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +20 -0
  392. data/vendor/plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +333 -0
  393. data/vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +47 -0
  394. data/vendor/plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +30 -0
  395. data/vendor/plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +52 -0
  396. data/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +39 -0
  397. data/vendor/plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +128 -0
  398. data/vendor/plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +131 -0
  399. data/vendor/plugins/rspec/lib/spec/runner/formatter/text_mate_formatter.rb +16 -0
  400. data/vendor/plugins/rspec/lib/spec/runner/heckle_runner.rb +72 -0
  401. data/vendor/plugins/rspec/lib/spec/runner/heckle_runner_unsupported.rb +10 -0
  402. data/vendor/plugins/rspec/lib/spec/runner/option_parser.rb +205 -0
  403. data/vendor/plugins/rspec/lib/spec/runner/options.rb +288 -0
  404. data/vendor/plugins/rspec/lib/spec/runner/reporter.rb +147 -0
  405. data/vendor/plugins/rspec/lib/spec/runner/spec_parser.rb +71 -0
  406. data/vendor/plugins/rspec/lib/spec/story.rb +10 -0
  407. data/vendor/plugins/rspec/lib/spec/story/extensions.rb +3 -0
  408. data/vendor/plugins/rspec/lib/spec/story/extensions/main.rb +86 -0
  409. data/vendor/plugins/rspec/lib/spec/story/extensions/regexp.rb +9 -0
  410. data/vendor/plugins/rspec/lib/spec/story/extensions/string.rb +9 -0
  411. data/vendor/plugins/rspec/lib/spec/story/given_scenario.rb +14 -0
  412. data/vendor/plugins/rspec/lib/spec/story/runner.rb +56 -0
  413. data/vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +48 -0
  414. data/vendor/plugins/rspec/lib/spec/story/runner/scenario_collector.rb +18 -0
  415. data/vendor/plugins/rspec/lib/spec/story/runner/scenario_runner.rb +48 -0
  416. data/vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb +123 -0
  417. data/vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb +227 -0
  418. data/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb +70 -0
  419. data/vendor/plugins/rspec/lib/spec/story/scenario.rb +14 -0
  420. data/vendor/plugins/rspec/lib/spec/story/step.rb +58 -0
  421. data/vendor/plugins/rspec/lib/spec/story/step_group.rb +89 -0
  422. data/vendor/plugins/rspec/lib/spec/story/step_mother.rb +37 -0
  423. data/vendor/plugins/rspec/lib/spec/story/story.rb +39 -0
  424. data/vendor/plugins/rspec/lib/spec/story/world.rb +124 -0
  425. data/vendor/plugins/rspec/lib/spec/translator.rb +114 -0
  426. data/vendor/plugins/rspec/lib/spec/version.rb +22 -0
  427. data/vendor/plugins/rspec/plugins/mock_frameworks/flexmock.rb +23 -0
  428. data/vendor/plugins/rspec/plugins/mock_frameworks/mocha.rb +19 -0
  429. data/vendor/plugins/rspec/plugins/mock_frameworks/rr.rb +21 -0
  430. data/vendor/plugins/rspec/plugins/mock_frameworks/rspec.rb +18 -0
  431. data/vendor/plugins/rspec/pre_commit/lib/pre_commit.rb +4 -0
  432. data/vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb +50 -0
  433. data/vendor/plugins/rspec/pre_commit/lib/pre_commit/pre_commit.rb +54 -0
  434. data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec.rb +111 -0
  435. data/vendor/plugins/rspec/pre_commit/lib/pre_commit/rspec_on_rails.rb +314 -0
  436. data/vendor/plugins/rspec/pre_commit/spec/pre_commit/pre_commit_spec.rb +15 -0
  437. data/vendor/plugins/rspec/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +51 -0
  438. data/vendor/plugins/rspec/pre_commit/spec/spec_helper.rb +3 -0
  439. data/vendor/plugins/rspec/pre_commit/spec/spec_suite.rb +11 -0
  440. data/vendor/plugins/rspec/rake_tasks/examples.rake +7 -0
  441. data/vendor/plugins/rspec/rake_tasks/examples_with_rcov.rake +9 -0
  442. data/vendor/plugins/rspec/rake_tasks/failing_examples_with_html.rake +9 -0
  443. data/vendor/plugins/rspec/rake_tasks/verify_rcov.rake +7 -0
  444. data/vendor/plugins/rspec/spec/README.jruby +15 -0
  445. data/vendor/plugins/rspec/spec/autotest/discover_spec.rb +19 -0
  446. data/vendor/plugins/rspec/spec/autotest/rspec_spec.rb +197 -0
  447. data/vendor/plugins/rspec/spec/autotest_helper.rb +6 -0
  448. data/vendor/plugins/rspec/spec/autotest_matchers.rb +47 -0
  449. data/vendor/plugins/rspec/spec/rspec_suite.rb +7 -0
  450. data/vendor/plugins/rspec/spec/ruby_forker.rb +13 -0
  451. data/vendor/plugins/rspec/spec/spec.opts +6 -0
  452. data/vendor/plugins/rspec/spec/spec/example/configuration_spec.rb +282 -0
  453. data/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb +48 -0
  454. data/vendor/plugins/rspec/spec/spec/example/example_group_factory_spec.rb +135 -0
  455. data/vendor/plugins/rspec/spec/spec/example/example_group_methods_spec.rb +523 -0
  456. data/vendor/plugins/rspec/spec/spec/example/example_group_spec.rb +711 -0
  457. data/vendor/plugins/rspec/spec/spec/example/example_matcher_spec.rb +96 -0
  458. data/vendor/plugins/rspec/spec/spec/example/example_methods_spec.rb +115 -0
  459. data/vendor/plugins/rspec/spec/spec/example/example_runner_spec.rb +194 -0
  460. data/vendor/plugins/rspec/spec/spec/example/example_spec.rb +53 -0
  461. data/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb +71 -0
  462. data/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb +31 -0
  463. data/vendor/plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +21 -0
  464. data/vendor/plugins/rspec/spec/spec/example/shared_example_group_spec.rb +265 -0
  465. data/vendor/plugins/rspec/spec/spec/example/subclassing_example_group_spec.rb +25 -0
  466. data/vendor/plugins/rspec/spec/spec/expectations/differs/default_spec.rb +127 -0
  467. data/vendor/plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +107 -0
  468. data/vendor/plugins/rspec/spec/spec/expectations/fail_with_spec.rb +71 -0
  469. data/vendor/plugins/rspec/spec/spec/extensions/main_spec.rb +76 -0
  470. data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_fails.rb +10 -0
  471. data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_passes.rb +10 -0
  472. data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_with_errors.rb +10 -0
  473. data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +10 -0
  474. data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +10 -0
  475. data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +10 -0
  476. data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +38 -0
  477. data/vendor/plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +45 -0
  478. data/vendor/plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +14 -0
  479. data/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +45 -0
  480. data/vendor/plugins/rspec/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +9 -0
  481. data/vendor/plugins/rspec/spec/spec/matchers/be_close_spec.rb +39 -0
  482. data/vendor/plugins/rspec/spec/spec/matchers/be_spec.rb +248 -0
  483. data/vendor/plugins/rspec/spec/spec/matchers/change_spec.rb +319 -0
  484. data/vendor/plugins/rspec/spec/spec/matchers/description_generation_spec.rb +153 -0
  485. data/vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb +28 -0
  486. data/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb +28 -0
  487. data/vendor/plugins/rspec/spec/spec/matchers/exist_spec.rb +57 -0
  488. data/vendor/plugins/rspec/spec/spec/matchers/handler_spec.rb +129 -0
  489. data/vendor/plugins/rspec/spec/spec/matchers/has_spec.rb +53 -0
  490. data/vendor/plugins/rspec/spec/spec/matchers/have_spec.rb +291 -0
  491. data/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb +45 -0
  492. data/vendor/plugins/rspec/spec/spec/matchers/match_spec.rb +37 -0
  493. data/vendor/plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +78 -0
  494. data/vendor/plugins/rspec/spec/spec/matchers/mock_constraint_matchers_spec.rb +24 -0
  495. data/vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +158 -0
  496. data/vendor/plugins/rspec/spec/spec/matchers/raise_error_spec.rb +315 -0
  497. data/vendor/plugins/rspec/spec/spec/matchers/respond_to_spec.rb +54 -0
  498. data/vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb +36 -0
  499. data/vendor/plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +31 -0
  500. data/vendor/plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +54 -0
  501. data/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +29 -0
  502. data/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb +23 -0
  503. data/vendor/plugins/rspec/spec/spec/mocks/at_least_spec.rb +97 -0
  504. data/vendor/plugins/rspec/spec/spec/mocks/at_most_spec.rb +93 -0
  505. data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10260_spec.rb +8 -0
  506. data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb +24 -0
  507. data/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +33 -0
  508. data/vendor/plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +30 -0
  509. data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +19 -0
  510. data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb +22 -0
  511. data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8165_spec.rb +31 -0
  512. data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +26 -0
  513. data/vendor/plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +123 -0
  514. data/vendor/plugins/rspec/spec/spec/mocks/hash_including_matcher_spec.rb +32 -0
  515. data/vendor/plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +84 -0
  516. data/vendor/plugins/rspec/spec/spec/mocks/mock_space_spec.rb +54 -0
  517. data/vendor/plugins/rspec/spec/spec/mocks/mock_spec.rb +481 -0
  518. data/vendor/plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +113 -0
  519. data/vendor/plugins/rspec/spec/spec/mocks/null_object_mock_spec.rb +40 -0
  520. data/vendor/plugins/rspec/spec/spec/mocks/once_counts_spec.rb +53 -0
  521. data/vendor/plugins/rspec/spec/spec/mocks/options_hash_spec.rb +45 -0
  522. data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +106 -0
  523. data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +66 -0
  524. data/vendor/plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +160 -0
  525. data/vendor/plugins/rspec/spec/spec/mocks/precise_counts_spec.rb +52 -0
  526. data/vendor/plugins/rspec/spec/spec/mocks/record_messages_spec.rb +26 -0
  527. data/vendor/plugins/rspec/spec/spec/mocks/stub_spec.rb +181 -0
  528. data/vendor/plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +67 -0
  529. data/vendor/plugins/rspec/spec/spec/package/bin_spec_spec.rb +14 -0
  530. data/vendor/plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +23 -0
  531. data/vendor/plugins/rspec/spec/spec/runner/command_line_spec.rb +147 -0
  532. data/vendor/plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +92 -0
  533. data/vendor/plugins/rspec/spec/spec/runner/empty_file.txt +0 -0
  534. data/vendor/plugins/rspec/spec/spec/runner/examples.txt +2 -0
  535. data/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb +37 -0
  536. data/vendor/plugins/rspec/spec/spec/runner/failed.txt +3 -0
  537. data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +45 -0
  538. data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +33 -0
  539. data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +365 -0
  540. data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +387 -0
  541. data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +371 -0
  542. data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +381 -0
  543. data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +371 -0
  544. data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +66 -0
  545. data/vendor/plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +65 -0
  546. data/vendor/plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +137 -0
  547. data/vendor/plugins/rspec/spec/spec/runner/formatter/snippet_extractor_spec.rb +18 -0
  548. data/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +103 -0
  549. data/vendor/plugins/rspec/spec/spec/runner/formatter/specdoc_formatter_spec.rb +129 -0
  550. data/vendor/plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +61 -0
  551. data/vendor/plugins/rspec/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +335 -0
  552. data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +365 -0
  553. data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +371 -0
  554. data/vendor/plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +78 -0
  555. data/vendor/plugins/rspec/spec/spec/runner/heckler_spec.rb +13 -0
  556. data/vendor/plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +45 -0
  557. data/vendor/plugins/rspec/spec/spec/runner/option_parser_spec.rb +384 -0
  558. data/vendor/plugins/rspec/spec/spec/runner/options_spec.rb +386 -0
  559. data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture.rb +7 -0
  560. data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture_runner.rb +8 -0
  561. data/vendor/plugins/rspec/spec/spec/runner/output_one_time_spec.rb +16 -0
  562. data/vendor/plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +56 -0
  563. data/vendor/plugins/rspec/spec/spec/runner/reporter_spec.rb +192 -0
  564. data/vendor/plugins/rspec/spec/spec/runner/resources/a_bar.rb +0 -0
  565. data/vendor/plugins/rspec/spec/spec/runner/resources/a_foo.rb +0 -0
  566. data/vendor/plugins/rspec/spec/spec/runner/resources/a_spec.rb +1 -0
  567. data/vendor/plugins/rspec/spec/spec/runner/spec.opts +2 -0
  568. data/vendor/plugins/rspec/spec/spec/runner/spec_drb.opts +1 -0
  569. data/vendor/plugins/rspec/spec/spec/runner/spec_parser/spec_parser_fixture.rb +70 -0
  570. data/vendor/plugins/rspec/spec/spec/runner/spec_parser_spec.rb +79 -0
  571. data/vendor/plugins/rspec/spec/spec/runner/spec_spaced.opts +2 -0
  572. data/vendor/plugins/rspec/spec/spec/runner_spec.rb +11 -0
  573. data/vendor/plugins/rspec/spec/spec/spec_classes.rb +133 -0
  574. data/vendor/plugins/rspec/spec/spec/story/builders.rb +46 -0
  575. data/vendor/plugins/rspec/spec/spec/story/extensions/main_spec.rb +161 -0
  576. data/vendor/plugins/rspec/spec/spec/story/extensions_spec.rb +14 -0
  577. data/vendor/plugins/rspec/spec/spec/story/given_scenario_spec.rb +27 -0
  578. data/vendor/plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +92 -0
  579. data/vendor/plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +27 -0
  580. data/vendor/plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +191 -0
  581. data/vendor/plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +133 -0
  582. data/vendor/plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +384 -0
  583. data/vendor/plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +294 -0
  584. data/vendor/plugins/rspec/spec/spec/story/runner_spec.rb +106 -0
  585. data/vendor/plugins/rspec/spec/spec/story/scenario_spec.rb +20 -0
  586. data/vendor/plugins/rspec/spec/spec/story/step_group_spec.rb +157 -0
  587. data/vendor/plugins/rspec/spec/spec/story/step_mother_spec.rb +72 -0
  588. data/vendor/plugins/rspec/spec/spec/story/step_spec.rb +200 -0
  589. data/vendor/plugins/rspec/spec/spec/story/story_helper.rb +2 -0
  590. data/vendor/plugins/rspec/spec/spec/story/story_spec.rb +86 -0
  591. data/vendor/plugins/rspec/spec/spec/story/world_spec.rb +423 -0
  592. data/vendor/plugins/rspec/spec/spec/translator_spec.rb +265 -0
  593. data/vendor/plugins/rspec/spec/spec_helper.rb +103 -0
  594. data/vendor/plugins/rspec/stories/all.rb +5 -0
  595. data/vendor/plugins/rspec/stories/example_groups/autogenerated_docstrings +45 -0
  596. data/vendor/plugins/rspec/stories/example_groups/example_group_with_should_methods +17 -0
  597. data/vendor/plugins/rspec/stories/example_groups/nested_groups +17 -0
  598. data/vendor/plugins/rspec/stories/example_groups/output +25 -0
  599. data/vendor/plugins/rspec/stories/example_groups/stories.rb +7 -0
  600. data/vendor/plugins/rspec/stories/helper.rb +6 -0
  601. data/vendor/plugins/rspec/stories/interop/examples_and_tests_together +30 -0
  602. data/vendor/plugins/rspec/stories/interop/stories.rb +7 -0
  603. data/vendor/plugins/rspec/stories/interop/test_case_with_should_methods +17 -0
  604. data/vendor/plugins/rspec/stories/pending_stories/README +3 -0
  605. data/vendor/plugins/rspec/stories/resources/helpers/cmdline.rb +9 -0
  606. data/vendor/plugins/rspec/stories/resources/helpers/story_helper.rb +16 -0
  607. data/vendor/plugins/rspec/stories/resources/matchers/smart_match.rb +37 -0
  608. data/vendor/plugins/rspec/stories/resources/spec/example_group_with_should_methods.rb +12 -0
  609. data/vendor/plugins/rspec/stories/resources/spec/simple_spec.rb +8 -0
  610. data/vendor/plugins/rspec/stories/resources/steps/running_rspec.rb +50 -0
  611. data/vendor/plugins/rspec/stories/resources/stories/failing_story.rb +15 -0
  612. data/vendor/plugins/rspec/stories/resources/test/spec_and_test_together.rb +57 -0
  613. data/vendor/plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +30 -0
  614. data/vendor/plugins/rspec/story_server/prototype/javascripts/builder.js +136 -0
  615. data/vendor/plugins/rspec/story_server/prototype/javascripts/controls.js +972 -0
  616. data/vendor/plugins/rspec/story_server/prototype/javascripts/dragdrop.js +976 -0
  617. data/vendor/plugins/rspec/story_server/prototype/javascripts/effects.js +1117 -0
  618. data/vendor/plugins/rspec/story_server/prototype/javascripts/prototype.js +4140 -0
  619. data/vendor/plugins/rspec/story_server/prototype/javascripts/rspec.js +149 -0
  620. data/vendor/plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +58 -0
  621. data/vendor/plugins/rspec/story_server/prototype/javascripts/slider.js +276 -0
  622. data/vendor/plugins/rspec/story_server/prototype/javascripts/sound.js +55 -0
  623. data/vendor/plugins/rspec/story_server/prototype/javascripts/unittest.js +568 -0
  624. data/vendor/plugins/rspec/story_server/prototype/lib/server.rb +24 -0
  625. data/vendor/plugins/rspec/story_server/prototype/stories.html +176 -0
  626. data/vendor/plugins/rspec/story_server/prototype/stylesheets/rspec.css +136 -0
  627. data/vendor/plugins/rspec/story_server/prototype/stylesheets/test.css +90 -0
  628. data/vendor/plugins/rspec_on_rails/MIT-LICENSE +31 -0
  629. data/vendor/plugins/rspec_on_rails/README +3 -0
  630. data/vendor/plugins/rspec_on_rails/Rakefile +9 -0
  631. data/vendor/plugins/rspec_on_rails/generators/rspec/CHANGES +1 -0
  632. data/vendor/plugins/rspec_on_rails/generators/rspec/rspec_generator.rb +35 -0
  633. data/vendor/plugins/rspec_on_rails/generators/rspec/templates/all_stories.rb +4 -0
  634. data/vendor/plugins/rspec_on_rails/generators/rspec/templates/previous_failures.txt +0 -0
  635. data/vendor/plugins/rspec_on_rails/generators/rspec/templates/rcov.opts +2 -0
  636. data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec +4 -0
  637. data/vendor/plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +102 -0
  638. data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec.opts +4 -0
  639. data/vendor/plugins/rspec_on_rails/generators/rspec/templates/spec_helper.rb +39 -0
  640. data/vendor/plugins/rspec_on_rails/generators/rspec/templates/stories_helper.rb +3 -0
  641. data/vendor/plugins/rspec_on_rails/generators/rspec_controller/USAGE +33 -0
  642. data/vendor/plugins/rspec_on_rails/generators/rspec_controller/rspec_controller_generator.rb +49 -0
  643. data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/controller_spec.rb +25 -0
  644. data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +11 -0
  645. data/vendor/plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +12 -0
  646. data/vendor/plugins/rspec_on_rails/generators/rspec_model/USAGE +18 -0
  647. data/vendor/plugins/rspec_on_rails/generators/rspec_model/rspec_model_generator.rb +30 -0
  648. data/vendor/plugins/rspec_on_rails/generators/rspec_model/templates/model_spec.rb +11 -0
  649. data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +167 -0
  650. data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +313 -0
  651. data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +25 -0
  652. data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +11 -0
  653. data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +22 -0
  654. data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +26 -0
  655. data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +61 -0
  656. data/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +22 -0
  657. data/vendor/plugins/rspec_on_rails/init.rb +9 -0
  658. data/vendor/plugins/rspec_on_rails/lib/autotest/discover.rb +1 -0
  659. data/vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +81 -0
  660. data/vendor/plugins/rspec_on_rails/lib/spec/rails.rb +51 -0
  661. data/vendor/plugins/rspec_on_rails/lib/spec/rails/example.rb +46 -0
  662. data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/assigns_hash_proxy.rb +43 -0
  663. data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +269 -0
  664. data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/functional_example_group.rb +59 -0
  665. data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/helper_example_group.rb +130 -0
  666. data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/model_example_group.rb +14 -0
  667. data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +98 -0
  668. data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +90 -0
  669. data/vendor/plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +178 -0
  670. data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions.rb +12 -0
  671. data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +14 -0
  672. data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/rescue.rb +21 -0
  673. data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/test_response.rb +11 -0
  674. data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/action_view/base.rb +27 -0
  675. data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/active_record/base.rb +30 -0
  676. data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/object.rb +5 -0
  677. data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/example/configuration.rb +66 -0
  678. data/vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +21 -0
  679. data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers.rb +29 -0
  680. data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +130 -0
  681. data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +55 -0
  682. data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/redirect_to.rb +113 -0
  683. data/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +70 -0
  684. data/vendor/plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +71 -0
  685. data/vendor/plugins/rspec_on_rails/lib/spec/rails/version.rb +23 -0
  686. data/vendor/plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +36 -0
  687. data/vendor/plugins/rspec_on_rails/spec/rails/autotest/rails_rspec_spec.rb +8 -0
  688. data/vendor/plugins/rspec_on_rails/spec/rails/example/assigns_hash_proxy_spec.rb +60 -0
  689. data/vendor/plugins/rspec_on_rails/spec/rails/example/configuration_spec.rb +83 -0
  690. data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +43 -0
  691. data/vendor/plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +195 -0
  692. data/vendor/plugins/rspec_on_rails/spec/rails/example/example_group_factory_spec.rb +112 -0
  693. data/vendor/plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +133 -0
  694. data/vendor/plugins/rspec_on_rails/spec/rails/example/model_spec_spec.rb +18 -0
  695. data/vendor/plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +16 -0
  696. data/vendor/plugins/rspec_on_rails/spec/rails/example/test_unit_assertion_accessibility_spec.rb +33 -0
  697. data/vendor/plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +264 -0
  698. data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_controller_rescue_action_spec.rb +54 -0
  699. data/vendor/plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +48 -0
  700. data/vendor/plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +14 -0
  701. data/vendor/plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +783 -0
  702. data/vendor/plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +37 -0
  703. data/vendor/plugins/rspec_on_rails/spec/rails/matchers/errors_on_spec.rb +13 -0
  704. data/vendor/plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +62 -0
  705. data/vendor/plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +209 -0
  706. data/vendor/plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +169 -0
  707. data/vendor/plugins/rspec_on_rails/spec/rails/mocks/ar_classes.rb +10 -0
  708. data/vendor/plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +55 -0
  709. data/vendor/plugins/rspec_on_rails/spec/rails/mocks/stub_model_spec.rb +54 -0
  710. data/vendor/plugins/rspec_on_rails/spec/rails/sample_spec.rb +7 -0
  711. data/vendor/plugins/rspec_on_rails/spec/rails/spec_server_spec.rb +89 -0
  712. data/vendor/plugins/rspec_on_rails/spec/rails/spec_spec.rb +11 -0
  713. data/vendor/plugins/rspec_on_rails/spec/rails_suite.rb +7 -0
  714. data/vendor/plugins/rspec_on_rails/spec/spec_helper.rb +46 -0
  715. data/vendor/plugins/rspec_on_rails/spec_resources/controllers/action_view_base_spec_controller.rb +2 -0
  716. data/vendor/plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +68 -0
  717. data/vendor/plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +59 -0
  718. data/vendor/plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +26 -0
  719. data/vendor/plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +58 -0
  720. data/vendor/plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +10 -0
  721. data/vendor/plugins/rspec_on_rails/spec_resources/helpers/more_explicit_helper.rb +5 -0
  722. data/vendor/plugins/rspec_on_rails/spec_resources/helpers/plugin_application_helper.rb +6 -0
  723. data/vendor/plugins/rspec_on_rails/spec_resources/helpers/view_spec_helper.rb +13 -0
  724. data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/_partial.rhtml +0 -0
  725. data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_after_session_reset.rhtml +1 -0
  726. data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml +1 -0
  727. data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_setting_the_assigns_hash.rhtml +0 -0
  728. data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_errors_in_template.rhtml +1 -0
  729. data/vendor/plugins/rspec_on_rails/spec_resources/views/controller_spec/action_with_template.rhtml +1 -0
  730. data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/_a_partial.rhtml +0 -0
  731. data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.js.rjs +1 -0
  732. data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rhtml +0 -0
  733. data/vendor/plugins/rspec_on_rails/spec_resources/views/render_spec/some_action.rjs +1 -0
  734. data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/_replacement_partial.rhtml +1 -0
  735. data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_div.rjs +1 -0
  736. data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/hide_page_element.rjs +1 -0
  737. data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/insert_html.rjs +1 -0
  738. data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace.rjs +1 -0
  739. data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html.rjs +1 -0
  740. data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/replace_html_with_partial.rjs +1 -0
  741. data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_effect.rjs +1 -0
  742. data/vendor/plugins/rspec_on_rails/spec_resources/views/rjs_spec/visual_toggle_effect.rjs +1 -0
  743. data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/no_tags.rhtml +1 -0
  744. data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_no_attributes.rhtml +1 -0
  745. data/vendor/plugins/rspec_on_rails/spec_resources/views/tag_spec/single_div_with_one_attribute.rhtml +1 -0
  746. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial.rhtml +2 -0
  747. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_used_twice.rhtml +0 -0
  748. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_local_variable.rhtml +1 -0
  749. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_partial_with_sub_partial.rhtml +1 -0
  750. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/_spacer.rhtml +1 -0
  751. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/accessor.rhtml +3 -0
  752. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/entry_form.rhtml +2 -0
  753. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/explicit_helper.rhtml +2 -0
  754. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/foo/show.rhtml +1 -0
  755. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/implicit_helper.rhtml +2 -0
  756. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/multiple_helpers.rhtml +3 -0
  757. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial.rhtml +5 -0
  758. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_using_collection.rhtml +3 -0
  759. data/vendor/plugins/rspec_on_rails/spec_resources/views/view_spec/template_with_partial_with_array.rhtml +1 -0
  760. data/vendor/plugins/rspec_on_rails/stories/all.rb +10 -0
  761. data/vendor/plugins/rspec_on_rails/stories/helper.rb +5 -0
  762. data/vendor/plugins/rspec_on_rails/stories/steps/people.rb +8 -0
  763. data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback +15 -0
  764. data/vendor/plugins/rspec_on_rails/stories/transactions_should_rollback.rb +25 -0
  765. data/vendor/plugins/rspec_on_rails/tasks/rspec.rake +137 -0
  766. data/vendor/plugins/scenarios/LICENSE +19 -0
  767. data/vendor/plugins/scenarios/README +262 -0
  768. data/vendor/plugins/scenarios/Rakefile +66 -0
  769. data/vendor/plugins/scenarios/TODO +1 -0
  770. data/vendor/plugins/scenarios/lib/scenarios.rb +34 -0
  771. data/vendor/plugins/scenarios/lib/scenarios/base.rb +73 -0
  772. data/vendor/plugins/scenarios/lib/scenarios/builtin/blank_scenario.rb +18 -0
  773. data/vendor/plugins/scenarios/lib/scenarios/configuration.rb +55 -0
  774. data/vendor/plugins/scenarios/lib/scenarios/extensions.rb +5 -0
  775. data/vendor/plugins/scenarios/lib/scenarios/extensions/active_record.rb +14 -0
  776. data/vendor/plugins/scenarios/lib/scenarios/extensions/delegating_attributes.rb +40 -0
  777. data/vendor/plugins/scenarios/lib/scenarios/extensions/object.rb +5 -0
  778. data/vendor/plugins/scenarios/lib/scenarios/extensions/string.rb +22 -0
  779. data/vendor/plugins/scenarios/lib/scenarios/extensions/symbol.rb +14 -0
  780. data/vendor/plugins/scenarios/lib/scenarios/extensions/test_case.rb +76 -0
  781. data/vendor/plugins/scenarios/lib/scenarios/loading.rb +51 -0
  782. data/vendor/plugins/scenarios/lib/scenarios/table_blasting.rb +20 -0
  783. data/vendor/plugins/scenarios/lib/scenarios/table_methods.rb +205 -0
  784. data/vendor/plugins/scenarios/spec/scenarios/complex_composite_scenario.rb +9 -0
  785. data/vendor/plugins/scenarios/spec/scenarios/composite_scenario.rb +9 -0
  786. data/vendor/plugins/scenarios/spec/scenarios/empty_scenario.rb +4 -0
  787. data/vendor/plugins/scenarios/spec/scenarios/people_scenario.rb +26 -0
  788. data/vendor/plugins/scenarios/spec/scenarios/places_scenario.rb +22 -0
  789. data/vendor/plugins/scenarios/spec/scenarios/things_scenario.rb +22 -0
  790. data/vendor/plugins/scenarios/spec/scenarios_spec.rb +189 -0
  791. data/vendor/plugins/scenarios/spec/spec.opts +7 -0
  792. data/vendor/plugins/scenarios/spec/spec_helper.rb +6 -0
  793. data/vendor/plugins/scenarios/tasks/scenario.rake +21 -0
  794. data/vendor/plugins/scenarios/test/scenarios_test.rb +39 -0
  795. data/vendor/plugins/scenarios/test/test_helper.rb +5 -0
  796. data/vendor/plugins/scenarios/testing/application.rb +2 -0
  797. data/vendor/plugins/scenarios/testing/database.yml +9 -0
  798. data/vendor/plugins/scenarios/testing/environment.rb +68 -0
  799. data/vendor/plugins/scenarios/testing/library.rb +128 -0
  800. data/vendor/plugins/scenarios/testing/models.rb +14 -0
  801. data/vendor/plugins/scenarios/testing/rspec_on_rails_3014.patch +52 -0
  802. data/vendor/plugins/scenarios/testing/rspec_on_rails_3119.patch +53 -0
  803. data/vendor/plugins/scenarios/testing/schema.rb +31 -0
  804. data/vendor/rails/Rakefile +21 -0
  805. data/vendor/rails/actionmailer/CHANGELOG +44 -26
  806. data/vendor/rails/actionmailer/MIT-LICENSE +1 -1
  807. data/vendor/rails/actionmailer/README +2 -2
  808. data/vendor/rails/actionmailer/Rakefile +4 -3
  809. data/vendor/rails/actionmailer/install.rb +1 -1
  810. data/vendor/rails/actionmailer/lib/action_mailer.rb +5 -3
  811. data/vendor/rails/actionmailer/lib/action_mailer/base.rb +57 -36
  812. data/vendor/rails/actionmailer/lib/action_mailer/helpers.rb +4 -4
  813. data/vendor/rails/actionmailer/lib/action_mailer/part.rb +2 -5
  814. data/vendor/rails/actionmailer/lib/action_mailer/test_case.rb +59 -0
  815. data/vendor/rails/actionmailer/lib/action_mailer/test_helper.rb +67 -0
  816. data/vendor/rails/actionmailer/lib/action_mailer/vendor.rb +14 -0
  817. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{text → text-format-0.6.3/text}/format.rb +0 -0
  818. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail.rb +4 -0
  819. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/Makefile +19 -0
  820. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/address.rb +245 -0
  821. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/attachments.rb +47 -0
  822. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/base64.rb +52 -0
  823. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/compat.rb +39 -0
  824. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/config.rb +71 -0
  825. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/core_extensions.rb +67 -0
  826. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/encode.rb +481 -0
  827. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/facade.rb +0 -0
  828. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/header.rb +931 -0
  829. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/info.rb +0 -0
  830. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/interface.rb +540 -0
  831. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/loader.rb +0 -0
  832. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mail.rb +462 -0
  833. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/mailbox.rb +435 -0
  834. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/mbox.rb +0 -0
  835. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/net.rb +282 -0
  836. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/obsolete.rb +137 -0
  837. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.rb +1475 -0
  838. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/parser.y +381 -0
  839. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/port.rb +379 -0
  840. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/quoting.rb +142 -0
  841. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner.rb +43 -0
  842. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/scanner_r.rb +263 -0
  843. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/stringio.rb +279 -0
  844. data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail → tmail-1.1.0/tmail}/tmail.rb +0 -0
  845. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/utils.rb +281 -0
  846. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.1.0/tmail/version.rb +38 -0
  847. data/vendor/rails/actionmailer/lib/action_mailer/version.rb +3 -3
  848. data/vendor/rails/actionmailer/lib/actionmailer.rb +1 -0
  849. data/vendor/rails/actionmailer/test/abstract_unit.rb +19 -0
  850. data/vendor/rails/actionmailer/test/delivery_method_test.rb +51 -0
  851. data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.erb +1 -0
  852. data/vendor/rails/actionmailer/test/fixtures/first_mailer/share.rhtml +0 -1
  853. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb +1 -0
  854. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml +0 -0
  855. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.erb +1 -0
  856. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml +0 -1
  857. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb +1 -0
  858. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml +0 -1
  859. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb +5 -0
  860. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml +0 -5
  861. data/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +5 -0
  862. data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb +1 -0
  863. data/vendor/rails/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml +0 -1
  864. data/vendor/rails/actionmailer/test/fixtures/raw_base64_decoded_string +0 -0
  865. data/vendor/rails/actionmailer/test/fixtures/raw_base64_encoded_string +1 -0
  866. data/vendor/rails/actionmailer/test/fixtures/raw_email_with_invalid_characters_in_content_type +104 -0
  867. data/vendor/rails/actionmailer/test/fixtures/raw_email_with_nested_attachment +100 -0
  868. data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.erb +1 -0
  869. data/vendor/rails/actionmailer/test/fixtures/second_mailer/share.rhtml +0 -1
  870. data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.erb +3 -0
  871. data/vendor/rails/actionmailer/test/fixtures/templates/signed_up.rhtml +0 -3
  872. data/vendor/rails/actionmailer/test/fixtures/test_mailer/_subtemplate.text.plain.erb +1 -0
  873. data/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.html.haml +6 -0
  874. data/vendor/rails/actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.plain.haml +6 -0
  875. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb +1 -0
  876. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml +0 -1
  877. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb +10 -0
  878. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml +0 -10
  879. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb +2 -0
  880. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml +0 -2
  881. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb +1 -0
  882. data/vendor/rails/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml +0 -1
  883. data/vendor/rails/actionmailer/test/fixtures/test_mailer/included_subtemplate.text.plain.erb +1 -0
  884. data/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.builder +2 -0
  885. data/vendor/rails/actionmailer/test/fixtures/test_mailer/rxml_template.rxml +2 -0
  886. data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.erb +3 -0
  887. data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up.rhtml +0 -3
  888. data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb +5 -0
  889. data/vendor/rails/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml +0 -3
  890. data/vendor/rails/actionmailer/test/mail_helper_test.rb +10 -6
  891. data/vendor/rails/actionmailer/test/mail_render_test.rb +45 -2
  892. data/vendor/rails/actionmailer/test/mail_service_test.rb +150 -27
  893. data/vendor/rails/actionmailer/test/quoting_test.rb +57 -3
  894. data/vendor/rails/actionmailer/test/test_helper_test.rb +117 -0
  895. data/vendor/rails/actionmailer/test/tmail_test.rb +9 -0
  896. data/vendor/rails/actionmailer/test/url_test.rb +10 -2
  897. data/vendor/rails/actionpack/CHANGELOG +1439 -20
  898. data/vendor/rails/actionpack/MIT-LICENSE +1 -1
  899. data/vendor/rails/actionpack/README +5 -5
  900. data/vendor/rails/actionpack/RUNNING_UNIT_TESTS +4 -5
  901. data/vendor/rails/actionpack/Rakefile +5 -6
  902. data/vendor/rails/actionpack/install.rb +2 -2
  903. data/vendor/rails/actionpack/lib/action_controller.rb +11 -15
  904. data/vendor/rails/actionpack/lib/action_controller/assertions.rb +12 -25
  905. data/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +18 -4
  906. data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +8 -1
  907. data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +35 -12
  908. data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +56 -12
  909. data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +105 -38
  910. data/vendor/rails/actionpack/lib/action_controller/assertions/tag_assertions.rb +28 -15
  911. data/vendor/rails/actionpack/lib/action_controller/base.rb +320 -262
  912. data/vendor/rails/actionpack/lib/action_controller/benchmarking.rb +36 -31
  913. data/vendor/rails/actionpack/lib/action_controller/caching.rb +132 -66
  914. data/vendor/rails/actionpack/lib/action_controller/cgi_ext.rb +16 -0
  915. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie.rb +106 -0
  916. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/query_extension.rb +22 -0
  917. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb +73 -0
  918. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/stdinput.rb +23 -0
  919. data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +36 -55
  920. data/vendor/rails/actionpack/lib/action_controller/components.rb +19 -36
  921. data/vendor/rails/actionpack/lib/action_controller/cookies.rb +13 -9
  922. data/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +195 -0
  923. data/vendor/rails/actionpack/lib/action_controller/filters.rb +35 -34
  924. data/vendor/rails/actionpack/lib/action_controller/flash.rb +30 -35
  925. data/vendor/rails/actionpack/lib/action_controller/helpers.rb +123 -50
  926. data/vendor/rails/actionpack/lib/action_controller/http_authentication.rb +126 -0
  927. data/vendor/rails/actionpack/lib/action_controller/integration.rb +127 -108
  928. data/vendor/rails/actionpack/lib/action_controller/layout.rb +61 -48
  929. data/vendor/rails/actionpack/lib/action_controller/mime_responds.rb +57 -68
  930. data/vendor/rails/actionpack/lib/action_controller/mime_type.rb +43 -80
  931. data/vendor/rails/actionpack/lib/action_controller/mime_types.rb +20 -0
  932. data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +88 -0
  933. data/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +91 -0
  934. data/vendor/rails/actionpack/lib/action_controller/request.rb +553 -88
  935. data/vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb +132 -0
  936. data/vendor/rails/actionpack/lib/action_controller/request_profiler.rb +138 -0
  937. data/vendor/rails/actionpack/lib/action_controller/rescue.rb +185 -69
  938. data/vendor/rails/actionpack/lib/action_controller/resources.rb +211 -172
  939. data/vendor/rails/actionpack/lib/action_controller/response.rb +49 -8
  940. data/vendor/rails/actionpack/lib/action_controller/routing.rb +368 -242
  941. data/vendor/rails/actionpack/lib/action_controller/routing_optimisation.rb +119 -0
  942. data/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb +3 -2
  943. data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +164 -0
  944. data/vendor/rails/actionpack/lib/action_controller/session/mem_cache_store.rb +9 -16
  945. data/vendor/rails/actionpack/lib/action_controller/session_management.rb +17 -8
  946. data/vendor/rails/actionpack/lib/action_controller/streaming.rb +6 -3
  947. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.erb +24 -0
  948. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{_trace.rhtml → _trace.erb} +0 -0
  949. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.erb +11 -0
  950. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{layout.rhtml → layout.erb} +0 -0
  951. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{missing_template.rhtml → missing_template.erb} +0 -0
  952. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{routing_error.rhtml → routing_error.erb} +0 -0
  953. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.erb +21 -0
  954. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/{unknown_action.rhtml → unknown_action.erb} +0 -0
  955. data/vendor/rails/actionpack/lib/action_controller/test_case.rb +53 -0
  956. data/vendor/rails/actionpack/lib/action_controller/test_process.rb +59 -46
  957. data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +48 -24
  958. data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb +7 -4
  959. data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +173 -0
  960. data/vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb +11 -6
  961. data/vendor/rails/actionpack/lib/action_controller/verification.rb +27 -21
  962. data/vendor/rails/actionpack/lib/action_pack.rb +1 -1
  963. data/vendor/rails/actionpack/lib/action_pack/version.rb +4 -4
  964. data/vendor/rails/actionpack/lib/action_view.rb +8 -3
  965. data/vendor/rails/actionpack/lib/action_view/base.rb +238 -140
  966. data/vendor/rails/actionpack/lib/action_view/compiled_templates.rb +1 -2
  967. data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +35 -17
  968. data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +417 -87
  969. data/vendor/rails/actionpack/lib/action_view/helpers/atom_feed_helper.rb +111 -0
  970. data/vendor/rails/actionpack/lib/action_view/helpers/benchmark_helper.rb +12 -5
  971. data/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb +29 -0
  972. data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +97 -63
  973. data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +295 -35
  974. data/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +6 -2
  975. data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +354 -111
  976. data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +171 -109
  977. data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +332 -76
  978. data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +35 -11
  979. data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/controls.js +484 -354
  980. data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/dragdrop.js +88 -58
  981. data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/effects.js +396 -364
  982. data/vendor/rails/actionpack/lib/action_view/helpers/javascripts/prototype.js +2817 -1107
  983. data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +84 -60
  984. data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +419 -43
  985. data/vendor/rails/actionpack/lib/action_view/helpers/record_identification_helper.rb +20 -0
  986. data/vendor/rails/actionpack/lib/action_view/helpers/record_tag_helper.rb +59 -0
  987. data/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +223 -0
  988. data/vendor/rails/actionpack/lib/action_view/helpers/scriptaculous_helper.rb +63 -4
  989. data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +69 -39
  990. data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +221 -148
  991. data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +283 -165
  992. data/vendor/rails/actionpack/lib/action_view/partials.rb +134 -62
  993. data/vendor/rails/actionpack/lib/action_view/template_error.rb +4 -12
  994. data/vendor/rails/actionpack/lib/action_view/template_handler.rb +17 -0
  995. data/vendor/rails/actionpack/lib/action_view/template_handlers/builder.rb +19 -0
  996. data/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +21 -0
  997. data/vendor/rails/actionpack/lib/action_view/template_handlers/rjs.rb +14 -0
  998. data/vendor/rails/actionpack/lib/actionpack.rb +1 -0
  999. data/vendor/rails/actionpack/test/abstract_unit.rb +21 -1
  1000. data/vendor/rails/actionpack/test/action_view_test.rb +44 -0
  1001. data/vendor/rails/actionpack/test/active_record_unit.rb +12 -20
  1002. data/vendor/rails/actionpack/test/activerecord/active_record_store_test.rb +2 -2
  1003. data/vendor/rails/actionpack/test/activerecord/render_partial_with_record_identification_test.rb +74 -0
  1004. data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +21 -152
  1005. data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +2 -7
  1006. data/vendor/rails/actionpack/test/controller/assert_select_test.rb +120 -14
  1007. data/vendor/rails/actionpack/test/controller/base_test.rb +11 -13
  1008. data/vendor/rails/actionpack/test/controller/caching_test.rb +125 -5
  1009. data/vendor/rails/actionpack/test/controller/capture_test.rb +23 -16
  1010. data/vendor/rails/actionpack/test/controller/cgi_test.rb +70 -395
  1011. data/vendor/rails/actionpack/test/controller/components_test.rb +31 -42
  1012. data/vendor/rails/actionpack/test/controller/content_type_test.rb +1 -1
  1013. data/vendor/rails/actionpack/test/controller/cookie_test.rb +51 -15
  1014. data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +1 -42
  1015. data/vendor/rails/actionpack/test/controller/dispatcher_test.rb +123 -0
  1016. data/vendor/rails/actionpack/test/controller/fake_models.rb +5 -0
  1017. data/vendor/rails/actionpack/test/controller/filters_test.rb +45 -7
  1018. data/vendor/rails/actionpack/test/controller/flash_test.rb +46 -2
  1019. data/vendor/rails/actionpack/test/controller/fragment_store_setting_test.rb +10 -8
  1020. data/vendor/rails/actionpack/test/controller/helper_test.rb +23 -4
  1021. data/vendor/rails/actionpack/test/controller/html-scanner/document_test.rb +124 -0
  1022. data/vendor/rails/actionpack/test/controller/html-scanner/node_test.rb +69 -0
  1023. data/vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb +250 -0
  1024. data/vendor/rails/actionpack/test/controller/html-scanner/tag_node_test.rb +239 -0
  1025. data/vendor/rails/actionpack/test/controller/html-scanner/text_node_test.rb +51 -0
  1026. data/vendor/rails/actionpack/test/controller/html-scanner/tokenizer_test.rb +125 -0
  1027. data/vendor/rails/actionpack/test/controller/http_authentication_test.rb +54 -0
  1028. data/vendor/rails/actionpack/test/controller/integration_test.rb +47 -31
  1029. data/vendor/rails/actionpack/test/controller/layout_test.rb +64 -12
  1030. data/vendor/rails/actionpack/test/controller/mime_responds_test.rb +193 -38
  1031. data/vendor/rails/actionpack/test/controller/mime_type_test.rb +30 -8
  1032. data/vendor/rails/actionpack/test/controller/new_render_test.rb +104 -22
  1033. data/vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb +98 -0
  1034. data/vendor/rails/actionpack/test/controller/record_identifier_test.rb +103 -0
  1035. data/vendor/rails/actionpack/test/controller/redirect_test.rb +120 -18
  1036. data/vendor/rails/actionpack/test/controller/render_test.rb +226 -55
  1037. data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +217 -0
  1038. data/vendor/rails/actionpack/test/controller/request_test.rb +546 -27
  1039. data/vendor/rails/actionpack/test/controller/rescue_test.rb +501 -0
  1040. data/vendor/rails/actionpack/test/controller/resources_test.rb +258 -132
  1041. data/vendor/rails/actionpack/test/controller/routing_test.rb +508 -106
  1042. data/vendor/rails/actionpack/test/controller/selector_test.rb +5 -5
  1043. data/vendor/rails/actionpack/test/controller/send_file_test.rb +17 -7
  1044. data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +246 -0
  1045. data/vendor/rails/actionpack/test/controller/session/mem_cache_store_test.rb +182 -0
  1046. data/vendor/rails/actionpack/test/controller/session_fixation_test.rb +89 -0
  1047. data/vendor/rails/actionpack/test/controller/session_management_test.rb +7 -7
  1048. data/vendor/rails/actionpack/test/controller/test_test.rb +150 -38
  1049. data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +87 -12
  1050. data/vendor/rails/actionpack/test/controller/verification_test.rb +11 -0
  1051. data/vendor/rails/actionpack/test/controller/view_paths_test.rb +137 -0
  1052. data/vendor/rails/actionpack/test/controller/webservice_test.rb +11 -75
  1053. data/vendor/rails/actionpack/test/fixtures/addresses/{list.rhtml → list.erb} +0 -0
  1054. data/vendor/rails/actionpack/test/fixtures/db_definitions/sqlite.sql +2 -1
  1055. data/vendor/rails/actionpack/test/fixtures/developer.rb +2 -0
  1056. data/vendor/rails/actionpack/test/fixtures/fun/games/{hello_world.rhtml → hello_world.erb} +0 -0
  1057. data/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +1 -1
  1058. data/vendor/rails/actionpack/test/fixtures/layout_tests/alt/hello.rhtml +1 -0
  1059. data/vendor/rails/actionpack/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb +1 -0
  1060. data/vendor/rails/actionpack/test/fixtures/layouts/{builder.rxml → builder.builder} +0 -0
  1061. data/vendor/rails/actionpack/test/fixtures/layouts/{standard.rhtml → standard.erb} +0 -0
  1062. data/vendor/rails/actionpack/test/fixtures/layouts/{talk_from_action.rhtml → talk_from_action.erb} +0 -0
  1063. data/vendor/rails/actionpack/test/fixtures/layouts/{yield.rhtml → yield.erb} +0 -0
  1064. data/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
  1065. data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_param +5 -0
  1066. data/vendor/rails/actionpack/test/fixtures/override/test/hello_world.erb +1 -0
  1067. data/vendor/rails/actionpack/test/fixtures/override2/layouts/test/sub.erb +1 -0
  1068. data/vendor/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +1 -0
  1069. data/vendor/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +1 -0
  1070. data/vendor/rails/actionpack/test/fixtures/post_test/post/index.html.erb +1 -0
  1071. data/vendor/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +1 -0
  1072. data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +1 -0
  1073. data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +1 -0
  1074. data/vendor/rails/actionpack/test/fixtures/public/404.html +1 -0
  1075. data/vendor/rails/actionpack/test/fixtures/public/500.html +1 -0
  1076. data/vendor/rails/actionpack/test/fixtures/public/javascripts/application.js +0 -1
  1077. data/vendor/rails/actionpack/test/fixtures/public/javascripts/bank.js +1 -0
  1078. data/vendor/rails/actionpack/test/fixtures/public/javascripts/robber.js +1 -0
  1079. data/vendor/rails/actionpack/test/fixtures/public/stylesheets/bank.css +1 -0
  1080. data/vendor/rails/actionpack/test/fixtures/public/stylesheets/robber.css +1 -0
  1081. data/vendor/rails/actionpack/test/fixtures/replies.yml +2 -0
  1082. data/vendor/rails/actionpack/test/fixtures/reply.rb +2 -1
  1083. data/vendor/rails/actionpack/test/fixtures/respond_to/{all_types_with_layout.rhtml → all_types_with_layout.html.erb} +0 -0
  1084. data/vendor/rails/actionpack/test/fixtures/respond_to/{all_types_with_layout.rjs → all_types_with_layout.js.rjs} +0 -0
  1085. data/vendor/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +1 -0
  1086. data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +1 -0
  1087. data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +1 -0
  1088. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +1 -0
  1089. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +1 -0
  1090. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +1 -0
  1091. data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults.rhtml → using_defaults.html.erb} +0 -0
  1092. data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults.rjs → using_defaults.js.rjs} +0 -0
  1093. data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults.rxml → using_defaults.xml.builder} +0 -0
  1094. data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults_with_type_list.rhtml → using_defaults_with_type_list.html.erb} +0 -0
  1095. data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults_with_type_list.rjs → using_defaults_with_type_list.js.rjs} +0 -0
  1096. data/vendor/rails/actionpack/test/fixtures/respond_to/{using_defaults_with_type_list.rxml → using_defaults_with_type_list.xml.builder} +0 -0
  1097. data/vendor/rails/actionpack/test/fixtures/scope/test/{modgreet.rhtml → modgreet.erb} +0 -0
  1098. data/vendor/rails/actionpack/test/fixtures/test/{_customer.rhtml → _customer.erb} +0 -0
  1099. data/vendor/rails/actionpack/test/fixtures/test/{_customer_greeting.rhtml → _customer_greeting.erb} +0 -0
  1100. data/vendor/rails/actionpack/test/fixtures/test/_hash_greeting.erb +1 -0
  1101. data/vendor/rails/actionpack/test/fixtures/test/_hash_object.erb +2 -0
  1102. data/vendor/rails/actionpack/test/fixtures/test/{_hello.rxml → _hello.builder} +0 -0
  1103. data/vendor/rails/actionpack/test/fixtures/test/_layout_for_partial.html.erb +3 -0
  1104. data/vendor/rails/actionpack/test/fixtures/test/_partial.erb +1 -0
  1105. data/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +1 -0
  1106. data/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +1 -0
  1107. data/vendor/rails/actionpack/test/fixtures/test/_partial_for_use_in_layout.html.erb +1 -0
  1108. data/vendor/rails/actionpack/test/fixtures/test/{_partial_only.rhtml → _partial_only.erb} +0 -0
  1109. data/vendor/rails/actionpack/test/fixtures/test/{_person.rhtml → _person.erb} +0 -0
  1110. data/vendor/rails/actionpack/test/fixtures/test/{action_talk_to_layout.rhtml → action_talk_to_layout.erb} +0 -0
  1111. data/vendor/rails/actionpack/test/fixtures/test/{block_content_for.rhtml → block_content_for.erb} +0 -0
  1112. data/vendor/rails/actionpack/test/fixtures/test/calling_partial_with_layout.html.erb +1 -0
  1113. data/vendor/rails/actionpack/test/fixtures/test/{capturing.rhtml → capturing.erb} +0 -0
  1114. data/vendor/rails/actionpack/test/fixtures/test/{content_for.rhtml → content_for.erb} +0 -0
  1115. data/vendor/rails/actionpack/test/fixtures/test/content_for_concatenated.erb +3 -0
  1116. data/vendor/rails/actionpack/test/fixtures/test/content_for_with_parameter.erb +2 -0
  1117. data/vendor/rails/actionpack/test/fixtures/test/dot.directory/{render_file_with_ivar.rhtml → render_file_with_ivar.erb} +0 -0
  1118. data/vendor/rails/actionpack/test/fixtures/test/{erb_content_for.rhtml → erb_content_for.erb} +0 -0
  1119. data/vendor/rails/actionpack/test/fixtures/test/formatted_html_erb.html.erb +1 -0
  1120. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +1 -0
  1121. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +1 -0
  1122. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +1 -0
  1123. data/vendor/rails/actionpack/test/fixtures/test/{greeting.rhtml → greeting.erb} +0 -0
  1124. data/vendor/rails/actionpack/test/fixtures/test/{hello.rxml → hello.builder} +0 -0
  1125. data/vendor/rails/actionpack/test/fixtures/test/{hello_world.rhtml → hello_world.erb} +0 -0
  1126. data/vendor/rails/actionpack/test/fixtures/test/{hello_world_container.rxml → hello_world_container.builder} +0 -0
  1127. data/vendor/rails/actionpack/test/fixtures/test/{hello_world.rxml → hello_world_from_rxml.builder} +0 -0
  1128. data/vendor/rails/actionpack/test/fixtures/test/{hello_world_with_layout_false.rhtml → hello_world_with_layout_false.erb} +0 -0
  1129. data/vendor/rails/actionpack/test/fixtures/test/{hello_xml_world.rxml → hello_xml_world.builder} +0 -0
  1130. data/vendor/rails/actionpack/test/fixtures/test/list.erb +1 -0
  1131. data/vendor/rails/actionpack/test/fixtures/test/{non_erb_block_content_for.rxml → non_erb_block_content_for.builder} +0 -0
  1132. data/vendor/rails/actionpack/test/fixtures/test/{potential_conflicts.rhtml → potential_conflicts.erb} +0 -0
  1133. data/vendor/rails/actionpack/test/fixtures/test/{render_file_with_ivar.rhtml → render_file_with_ivar.erb} +0 -0
  1134. data/vendor/rails/actionpack/test/fixtures/test/{render_file_with_locals.rhtml → render_file_with_locals.erb} +0 -0
  1135. data/vendor/rails/actionpack/test/fixtures/test/{render_to_string_test.rhtml → render_to_string_test.erb} +0 -0
  1136. data/vendor/rails/actionpack/test/fixtures/test/{update_element_with_capture.rhtml → update_element_with_capture.erb} +0 -0
  1137. data/vendor/rails/actionpack/test/fixtures/test/using_layout_around_block.html.erb +1 -0
  1138. data/vendor/rails/actionpack/test/fixtures/topic.rb +1 -1
  1139. data/vendor/rails/actionpack/test/template/active_record_helper_test.rb +67 -20
  1140. data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +255 -54
  1141. data/vendor/rails/actionpack/test/template/atom_feed_helper_test.rb +101 -0
  1142. data/vendor/rails/actionpack/test/template/benchmark_helper_test.rb +2 -2
  1143. data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +88 -42
  1144. data/vendor/rails/actionpack/test/template/date_helper_test.rb +125 -9
  1145. data/vendor/rails/actionpack/test/template/erb_util_test.rb +56 -0
  1146. data/vendor/rails/actionpack/test/template/form_helper_test.rb +326 -33
  1147. data/vendor/rails/actionpack/test/template/form_options_helper_test.rb +822 -15
  1148. data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +96 -30
  1149. data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +61 -13
  1150. data/vendor/rails/actionpack/test/template/number_helper_test.rb +12 -11
  1151. data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +185 -24
  1152. data/vendor/rails/actionpack/test/template/sanitize_helper_test.rb +49 -0
  1153. data/vendor/rails/actionpack/test/template/scriptaculous_helper_test.rb +9 -3
  1154. data/vendor/rails/actionpack/test/template/tag_helper_test.rb +13 -2
  1155. data/vendor/rails/actionpack/test/template/text_helper_test.rb +38 -52
  1156. data/vendor/rails/actionpack/test/template/url_helper_test.rb +216 -46
  1157. data/vendor/rails/activemodel/CHANGES +12 -0
  1158. data/vendor/rails/activemodel/README +21 -0
  1159. data/vendor/rails/activemodel/Rakefile +4 -0
  1160. data/vendor/rails/activemodel/lib/active_model.rb +17 -0
  1161. data/vendor/rails/activemodel/lib/active_model/base.rb +4 -0
  1162. data/vendor/rails/activemodel/lib/active_model/callbacks.rb +5 -0
  1163. data/vendor/rails/activemodel/lib/active_model/observing.rb +100 -0
  1164. data/vendor/rails/activemodel/lib/active_model/validations.rb +4 -0
  1165. data/vendor/rails/activemodel/spec/observing_spec.rb +120 -0
  1166. data/vendor/rails/activemodel/spec/spec_helper.rb +17 -0
  1167. data/vendor/rails/activerecord/CHANGELOG +2484 -34
  1168. data/vendor/rails/activerecord/MIT-LICENSE +1 -1
  1169. data/vendor/rails/activerecord/README +1 -15
  1170. data/vendor/rails/activerecord/RUNNING_UNIT_TESTS +3 -34
  1171. data/vendor/rails/activerecord/Rakefile +98 -77
  1172. data/vendor/rails/activerecord/install.rb +1 -1
  1173. data/vendor/rails/activerecord/lib/active_record.rb +13 -22
  1174. data/vendor/rails/activerecord/lib/active_record/aggregations.rb +38 -49
  1175. data/vendor/rails/activerecord/lib/active_record/associations.rb +465 -338
  1176. data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +66 -20
  1177. data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +24 -22
  1178. data/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +46 -51
  1179. data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +21 -57
  1180. data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +52 -25
  1181. data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +30 -14
  1182. data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +253 -0
  1183. data/vendor/rails/activerecord/lib/active_record/base.rb +830 -532
  1184. data/vendor/rails/activerecord/lib/active_record/calculations.rb +60 -63
  1185. data/vendor/rails/activerecord/lib/active_record/callbacks.rb +57 -83
  1186. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +38 -9
  1187. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb +56 -15
  1188. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +87 -0
  1189. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +23 -12
  1190. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +191 -62
  1191. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +37 -34
  1192. data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +28 -17
  1193. data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +119 -37
  1194. data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +473 -210
  1195. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +34 -0
  1196. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +91 -107
  1197. data/vendor/rails/activerecord/lib/active_record/fixtures.rb +522 -116
  1198. data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +72 -34
  1199. data/vendor/rails/activerecord/lib/active_record/migration.rb +80 -57
  1200. data/vendor/rails/activerecord/lib/active_record/observer.rb +13 -10
  1201. data/vendor/rails/activerecord/lib/active_record/query_cache.rb +14 -57
  1202. data/vendor/rails/activerecord/lib/active_record/reflection.rb +35 -38
  1203. data/vendor/rails/activerecord/lib/active_record/schema.rb +5 -5
  1204. data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +35 -13
  1205. data/vendor/rails/activerecord/lib/active_record/serialization.rb +98 -0
  1206. data/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +71 -0
  1207. data/vendor/rails/activerecord/lib/active_record/serializers/xml_serializer.rb +315 -0
  1208. data/vendor/rails/activerecord/lib/active_record/timestamp.rb +20 -21
  1209. data/vendor/rails/activerecord/lib/active_record/transactions.rb +39 -43
  1210. data/vendor/rails/activerecord/lib/active_record/validations.rb +290 -108
  1211. data/vendor/rails/activerecord/lib/active_record/version.rb +3 -3
  1212. data/vendor/rails/activerecord/lib/activerecord.rb +1 -0
  1213. data/vendor/rails/activerecord/test/aaa_create_tables_test.rb +15 -2
  1214. data/vendor/rails/activerecord/test/abstract_unit.rb +24 -17
  1215. data/vendor/rails/activerecord/test/active_schema_test_mysql.rb +20 -8
  1216. data/vendor/rails/activerecord/test/adapter_test.rb +23 -5
  1217. data/vendor/rails/activerecord/test/adapter_test_sqlserver.rb +15 -1
  1218. data/vendor/rails/activerecord/test/aggregations_test.rb +34 -1
  1219. data/vendor/rails/activerecord/test/all.sh +2 -2
  1220. data/vendor/rails/activerecord/test/associations/callbacks_test.rb +51 -30
  1221. data/vendor/rails/activerecord/test/associations/cascaded_eager_loading_test.rb +1 -29
  1222. data/vendor/rails/activerecord/test/associations/eager_singularization_test.rb +145 -0
  1223. data/vendor/rails/activerecord/test/associations/eager_test.rb +42 -6
  1224. data/vendor/rails/activerecord/test/associations/extension_test.rb +6 -1
  1225. data/vendor/rails/activerecord/test/associations/inner_join_association_test.rb +88 -0
  1226. data/vendor/rails/activerecord/test/associations/join_model_test.rb +66 -13
  1227. data/vendor/rails/activerecord/test/associations_test.rb +531 -226
  1228. data/vendor/rails/activerecord/test/attribute_methods_test.rb +97 -0
  1229. data/vendor/rails/activerecord/test/base_test.rb +251 -105
  1230. data/vendor/rails/activerecord/test/binary_test.rb +22 -27
  1231. data/vendor/rails/activerecord/test/calculations_test.rb +37 -5
  1232. data/vendor/rails/activerecord/test/callbacks_test.rb +23 -0
  1233. data/vendor/rails/activerecord/test/connection_test_firebird.rb +2 -2
  1234. data/vendor/rails/activerecord/test/connection_test_mysql.rb +30 -0
  1235. data/vendor/rails/activerecord/test/connections/native_mysql/connection.rb +3 -0
  1236. data/vendor/rails/activerecord/test/connections/native_sqlite/connection.rb +5 -14
  1237. data/vendor/rails/activerecord/test/connections/native_sqlite3/connection.rb +5 -14
  1238. data/vendor/rails/activerecord/test/connections/native_sqlite3/in_memory_connection.rb +1 -1
  1239. data/vendor/rails/activerecord/test/copy_table_test_sqlite.rb +69 -0
  1240. data/vendor/rails/activerecord/test/datatype_test_postgresql.rb +178 -27
  1241. data/vendor/rails/activerecord/test/date_time_test.rb +37 -0
  1242. data/vendor/rails/activerecord/test/defaults_test.rb +6 -14
  1243. data/vendor/rails/activerecord/test/deprecated_finder_test.rb +7 -128
  1244. data/vendor/rails/activerecord/test/finder_test.rb +201 -55
  1245. data/vendor/rails/activerecord/test/fixtures/all/developers.yml +0 -0
  1246. data/vendor/rails/activerecord/test/fixtures/all/people.csv +0 -0
  1247. data/vendor/rails/activerecord/test/fixtures/all/tasks.yml +0 -0
  1248. data/vendor/rails/activerecord/test/fixtures/author.rb +14 -5
  1249. data/vendor/rails/activerecord/test/fixtures/binaries.yml +130 -435
  1250. data/vendor/rails/activerecord/test/fixtures/book.rb +4 -0
  1251. data/vendor/rails/activerecord/test/fixtures/books.yml +7 -0
  1252. data/vendor/rails/activerecord/test/fixtures/category.rb +6 -0
  1253. data/vendor/rails/activerecord/test/fixtures/citation.rb +6 -0
  1254. data/vendor/rails/activerecord/test/fixtures/company.rb +8 -1
  1255. data/vendor/rails/activerecord/test/fixtures/computer.rb +1 -0
  1256. data/vendor/rails/activerecord/test/fixtures/contact.rb +16 -0
  1257. data/vendor/rails/activerecord/test/fixtures/customer.rb +2 -2
  1258. data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.drop.sql +1 -0
  1259. data/vendor/rails/activerecord/test/fixtures/db_definitions/db2.sql +4 -0
  1260. data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.drop.sql +3 -1
  1261. data/vendor/rails/activerecord/test/fixtures/db_definitions/firebird.sql +6 -0
  1262. data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.drop.sql +1 -0
  1263. data/vendor/rails/activerecord/test/fixtures/db_definitions/frontbase.sql +5 -0
  1264. data/vendor/rails/activerecord/test/fixtures/db_definitions/openbase.sql +41 -25
  1265. data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.drop.sql +2 -0
  1266. data/vendor/rails/activerecord/test/fixtures/db_definitions/oracle.sql +5 -0
  1267. data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.drop.sql +7 -0
  1268. data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql.sql +87 -58
  1269. data/vendor/rails/activerecord/test/fixtures/db_definitions/postgresql2.sql +1 -2
  1270. data/vendor/rails/activerecord/test/fixtures/db_definitions/schema.rb +289 -8
  1271. data/vendor/rails/activerecord/test/fixtures/db_definitions/schema2.rb +11 -0
  1272. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.drop.sql +1 -0
  1273. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlite.sql +4 -0
  1274. data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.drop.sql +1 -0
  1275. data/vendor/rails/activerecord/test/fixtures/db_definitions/sybase.sql +4 -0
  1276. data/vendor/rails/activerecord/test/fixtures/developer.rb +10 -0
  1277. data/vendor/rails/activerecord/test/fixtures/example.log +1 -0
  1278. data/vendor/rails/activerecord/test/fixtures/flowers.jpg +0 -0
  1279. data/vendor/rails/activerecord/test/fixtures/item.rb +7 -0
  1280. data/vendor/rails/activerecord/test/fixtures/items.yml +4 -0
  1281. data/vendor/rails/activerecord/test/fixtures/joke.rb +0 -3
  1282. data/vendor/rails/activerecord/test/fixtures/matey.rb +4 -0
  1283. data/vendor/rails/activerecord/test/fixtures/mateys.yml +4 -0
  1284. data/vendor/rails/activerecord/test/fixtures/minimalistic.rb +2 -0
  1285. data/vendor/rails/activerecord/test/fixtures/minimalistics.yml +2 -0
  1286. data/vendor/rails/activerecord/test/fixtures/mixins.yml +2 -100
  1287. data/vendor/rails/activerecord/test/fixtures/parrot.rb +13 -0
  1288. data/vendor/rails/activerecord/test/fixtures/parrots.yml +27 -0
  1289. data/vendor/rails/activerecord/test/fixtures/parrots_pirates.yml +7 -0
  1290. data/vendor/rails/activerecord/test/fixtures/pirate.rb +5 -0
  1291. data/vendor/rails/activerecord/test/fixtures/pirates.yml +9 -0
  1292. data/vendor/rails/activerecord/test/fixtures/post.rb +1 -0
  1293. data/vendor/rails/activerecord/test/fixtures/project.rb +3 -2
  1294. data/vendor/rails/activerecord/test/fixtures/reply.rb +0 -0
  1295. data/vendor/rails/activerecord/test/fixtures/reserved_words/distinct.yml +5 -0
  1296. data/vendor/rails/activerecord/test/fixtures/reserved_words/distincts_selects.yml +11 -0
  1297. data/vendor/rails/activerecord/test/fixtures/reserved_words/group.yml +14 -0
  1298. data/vendor/rails/activerecord/test/fixtures/reserved_words/select.yml +8 -0
  1299. data/vendor/rails/activerecord/test/fixtures/reserved_words/values.yml +7 -0
  1300. data/vendor/rails/activerecord/test/fixtures/ship.rb +3 -0
  1301. data/vendor/rails/activerecord/test/fixtures/ships.yml +5 -0
  1302. data/vendor/rails/activerecord/test/fixtures/tagging.rb +4 -0
  1303. data/vendor/rails/activerecord/test/fixtures/taggings.yml +8 -1
  1304. data/vendor/rails/activerecord/test/fixtures/topic.rb +13 -1
  1305. data/vendor/rails/activerecord/test/fixtures/treasure.rb +4 -0
  1306. data/vendor/rails/activerecord/test/fixtures/treasures.yml +10 -0
  1307. data/vendor/rails/activerecord/test/fixtures_test.rb +220 -23
  1308. data/vendor/rails/activerecord/test/inheritance_test.rb +7 -1
  1309. data/vendor/rails/activerecord/test/json_serialization_test.rb +180 -0
  1310. data/vendor/rails/activerecord/test/lifecycle_test.rb +1 -1
  1311. data/vendor/rails/activerecord/test/locking_test.rb +94 -2
  1312. data/vendor/rails/activerecord/test/migration_test.rb +206 -40
  1313. data/vendor/rails/activerecord/test/mixin_test.rb +13 -515
  1314. data/vendor/rails/activerecord/test/pk_test.rb +3 -6
  1315. data/vendor/rails/activerecord/test/query_cache_test.rb +104 -0
  1316. data/vendor/rails/activerecord/test/readonly_test.rb +0 -0
  1317. data/vendor/rails/activerecord/test/reflection_test.rb +16 -0
  1318. data/vendor/rails/activerecord/test/reserved_word_test_mysql.rb +177 -0
  1319. data/vendor/rails/activerecord/test/schema_dumper_test.rb +38 -3
  1320. data/vendor/rails/activerecord/test/serialization_test.rb +47 -0
  1321. data/vendor/rails/activerecord/test/transactions_test.rb +74 -23
  1322. data/vendor/rails/activerecord/test/unconnected_test.rb +1 -1
  1323. data/vendor/rails/activerecord/test/validations_test.rb +330 -32
  1324. data/vendor/rails/activerecord/test/xml_serialization_test.rb +121 -44
  1325. data/vendor/rails/activeresource/CHANGELOG +223 -0
  1326. data/vendor/rails/activeresource/MIT-LICENSE +20 -0
  1327. data/vendor/rails/activeresource/README +165 -0
  1328. data/vendor/rails/activeresource/Rakefile +133 -0
  1329. data/vendor/rails/activeresource/lib/active_resource.rb +47 -0
  1330. data/vendor/rails/activeresource/lib/active_resource/base.rb +872 -0
  1331. data/vendor/rails/activeresource/lib/active_resource/connection.rb +172 -0
  1332. data/vendor/rails/activeresource/lib/active_resource/custom_methods.rb +105 -0
  1333. data/vendor/rails/activeresource/lib/active_resource/formats.rb +14 -0
  1334. data/vendor/rails/activeresource/lib/active_resource/formats/json_format.rb +23 -0
  1335. data/vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb +34 -0
  1336. data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +147 -0
  1337. data/vendor/rails/activeresource/lib/active_resource/validations.rb +288 -0
  1338. data/vendor/rails/activeresource/lib/active_resource/version.rb +9 -0
  1339. data/vendor/rails/activeresource/lib/activeresource.rb +1 -0
  1340. data/vendor/rails/activeresource/test/abstract_unit.rb +10 -0
  1341. data/vendor/rails/activeresource/test/authorization_test.rb +82 -0
  1342. data/vendor/rails/activeresource/test/base/custom_methods_test.rb +96 -0
  1343. data/vendor/rails/activeresource/test/base/equality_test.rb +43 -0
  1344. data/vendor/rails/activeresource/test/base/load_test.rb +111 -0
  1345. data/vendor/rails/activeresource/test/base_errors_test.rb +48 -0
  1346. data/vendor/rails/activeresource/test/base_test.rb +454 -0
  1347. data/vendor/rails/activeresource/test/connection_test.rb +170 -0
  1348. data/vendor/rails/activeresource/test/fixtures/beast.rb +14 -0
  1349. data/vendor/rails/activeresource/test/fixtures/person.rb +3 -0
  1350. data/vendor/rails/activeresource/test/fixtures/street_address.rb +4 -0
  1351. data/vendor/rails/activeresource/test/format_test.rb +42 -0
  1352. data/vendor/rails/activeresource/test/setter_trap.rb +27 -0
  1353. data/vendor/rails/activesupport/CHANGELOG +274 -7
  1354. data/vendor/rails/activesupport/MIT-LICENSE +1 -1
  1355. data/vendor/rails/activesupport/Rakefile +2 -1
  1356. data/vendor/rails/activesupport/install.rb +1 -1
  1357. data/vendor/rails/activesupport/lib/active_support.rb +9 -4
  1358. data/vendor/rails/activesupport/lib/active_support/basic_object.rb +5 -0
  1359. data/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +107 -0
  1360. data/vendor/rails/activesupport/lib/active_support/clean_logger.rb +94 -5
  1361. data/vendor/rails/activesupport/lib/active_support/core_ext.rb +4 -1
  1362. data/vendor/rails/activesupport/lib/active_support/core_ext/array.rb +8 -2
  1363. data/vendor/rails/activesupport/lib/active_support/core_ext/array/access.rb +28 -0
  1364. data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +40 -18
  1365. data/vendor/rails/activesupport/lib/active_support/core_ext/array/extract_options.rb +19 -0
  1366. data/vendor/rails/activesupport/lib/active_support/core_ext/array/grouping.rb +20 -7
  1367. data/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +12 -0
  1368. data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal.rb +1 -2
  1369. data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb +6 -0
  1370. data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +2 -8
  1371. data/vendor/rails/activesupport/lib/active_support/core_ext/cgi.rb +2 -2
  1372. data/vendor/rails/activesupport/lib/active_support/core_ext/class.rb +4 -3
  1373. data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +1 -1
  1374. data/vendor/rails/activesupport/lib/active_support/core_ext/class/delegating_attributes.rb +40 -0
  1375. data/vendor/rails/activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb +3 -3
  1376. data/vendor/rails/activesupport/lib/active_support/core_ext/class/removal.rb +2 -2
  1377. data/vendor/rails/activesupport/lib/active_support/core_ext/date.rb +5 -1
  1378. data/vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb +13 -0
  1379. data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +188 -0
  1380. data/vendor/rails/activesupport/lib/active_support/core_ext/date/conversions.rb +72 -13
  1381. data/vendor/rails/activesupport/lib/active_support/core_ext/date_time.rb +10 -0
  1382. data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/calculations.rb +77 -0
  1383. data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +74 -0
  1384. data/vendor/rails/activesupport/lib/active_support/core_ext/duplicable.rb +37 -0
  1385. data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +1 -0
  1386. data/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb +2 -2
  1387. data/vendor/rails/activesupport/lib/active_support/core_ext/file.rb +21 -0
  1388. data/vendor/rails/activesupport/lib/active_support/core_ext/float.rb +5 -0
  1389. data/vendor/rails/activesupport/lib/active_support/core_ext/float/rounding.rb +24 -0
  1390. data/vendor/rails/activesupport/lib/active_support/core_ext/hash.rb +5 -5
  1391. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +91 -49
  1392. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/diff.rb +8 -0
  1393. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb +24 -0
  1394. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +16 -2
  1395. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/keys.rb +9 -8
  1396. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb +2 -2
  1397. data/vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb +28 -0
  1398. data/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb +2 -2
  1399. data/vendor/rails/activesupport/lib/active_support/core_ext/integer/even_odd.rb +4 -4
  1400. data/vendor/rails/activesupport/lib/active_support/core_ext/kernel.rb +5 -4
  1401. data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb +13 -0
  1402. data/vendor/rails/activesupport/lib/active_support/core_ext/module.rb +8 -7
  1403. data/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +17 -5
  1404. data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +31 -0
  1405. data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +1 -1
  1406. data/vendor/rails/activesupport/lib/active_support/core_ext/module/delegation.rb +21 -0
  1407. data/vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb +2 -2
  1408. data/vendor/rails/activesupport/lib/active_support/core_ext/numeric.rb +2 -2
  1409. data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/time.rb +30 -11
  1410. data/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +4 -2
  1411. data/vendor/rails/activesupport/lib/active_support/core_ext/object/conversions.rb +14 -0
  1412. data/vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb +40 -29
  1413. data/vendor/rails/activesupport/lib/active_support/core_ext/object/instance_variables.rb +22 -0
  1414. data/vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb +29 -4
  1415. data/vendor/rails/activesupport/lib/active_support/core_ext/pathname.rb +1 -1
  1416. data/vendor/rails/activesupport/lib/active_support/core_ext/range.rb +7 -1
  1417. data/vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb +22 -0
  1418. data/vendor/rails/activesupport/lib/active_support/core_ext/range/conversions.rb +11 -9
  1419. data/vendor/rails/activesupport/lib/active_support/core_ext/range/include_range.rb +22 -0
  1420. data/vendor/rails/activesupport/lib/active_support/core_ext/range/overlaps.rb +12 -0
  1421. data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +16 -8
  1422. data/vendor/rails/activesupport/lib/active_support/core_ext/string/conversions.rb +11 -2
  1423. data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +7 -0
  1424. data/vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb +2 -2
  1425. data/vendor/rails/activesupport/lib/active_support/core_ext/string/xchar.rb +11 -0
  1426. data/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb +12 -10
  1427. data/vendor/rails/activesupport/lib/active_support/core_ext/test.rb +1 -0
  1428. data/vendor/rails/activesupport/lib/active_support/core_ext/test/unit/assertions.rb +62 -0
  1429. data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +4 -2
  1430. data/vendor/rails/activesupport/lib/active_support/core_ext/time/behavior.rb +13 -0
  1431. data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +87 -54
  1432. data/vendor/rails/activesupport/lib/active_support/core_ext/time/conversions.rb +71 -10
  1433. data/vendor/rails/activesupport/lib/active_support/dependencies.rb +32 -31
  1434. data/vendor/rails/activesupport/lib/active_support/deprecation.rb +4 -2
  1435. data/vendor/rails/activesupport/lib/active_support/duration.rb +96 -0
  1436. data/vendor/rails/activesupport/lib/active_support/inflections.rb +2 -1
  1437. data/vendor/rails/activesupport/lib/active_support/inflector.rb +13 -6
  1438. data/vendor/rails/activesupport/lib/active_support/json.rb +22 -39
  1439. data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +60 -0
  1440. data/vendor/rails/activesupport/lib/active_support/json/encoders/date.rb +5 -0
  1441. data/vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb +5 -0
  1442. data/vendor/rails/activesupport/lib/active_support/json/encoders/enumerable.rb +12 -0
  1443. data/vendor/rails/activesupport/lib/active_support/json/encoders/false_class.rb +5 -0
  1444. data/vendor/rails/activesupport/lib/active_support/json/encoders/hash.rb +50 -0
  1445. data/vendor/rails/activesupport/lib/active_support/json/encoders/nil_class.rb +5 -0
  1446. data/vendor/rails/activesupport/lib/active_support/json/encoders/numeric.rb +5 -0
  1447. data/vendor/rails/activesupport/lib/active_support/json/encoders/object.rb +6 -0
  1448. data/vendor/rails/activesupport/lib/active_support/json/encoders/regexp.rb +5 -0
  1449. data/vendor/rails/activesupport/lib/active_support/json/encoders/string.rb +30 -0
  1450. data/vendor/rails/activesupport/lib/active_support/json/encoders/symbol.rb +5 -0
  1451. data/vendor/rails/activesupport/lib/active_support/json/encoders/time.rb +5 -0
  1452. data/vendor/rails/activesupport/lib/active_support/json/encoders/true_class.rb +5 -0
  1453. data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +38 -0
  1454. data/vendor/rails/activesupport/lib/active_support/json/variable.rb +10 -0
  1455. data/vendor/rails/activesupport/lib/active_support/multibyte.rb +7 -5
  1456. data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +14 -2
  1457. data/vendor/rails/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +115 -5
  1458. data/vendor/rails/activesupport/lib/active_support/option_merger.rb +7 -7
  1459. data/vendor/rails/activesupport/lib/active_support/ordered_options.rb +22 -17
  1460. data/vendor/rails/activesupport/lib/active_support/test_case.rb +5 -0
  1461. data/vendor/rails/activesupport/lib/active_support/testing.rb +1 -0
  1462. data/vendor/rails/activesupport/lib/active_support/testing/default.rb +12 -0
  1463. data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +8 -7
  1464. data/vendor/rails/activesupport/lib/active_support/vendor.rb +14 -0
  1465. data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/blankslate.rb +113 -0
  1466. data/vendor/rails/activesupport/lib/active_support/vendor/{builder.rb → builder-2.1.2/builder.rb} +0 -0
  1467. data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/blankslate.rb +20 -0
  1468. data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/css.rb +250 -0
  1469. data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb +115 -0
  1470. data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlbase.rb +139 -0
  1471. data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb +63 -0
  1472. data/vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlmarkup.rb +328 -0
  1473. data/vendor/rails/activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb +1021 -0
  1474. data/vendor/rails/activesupport/lib/active_support/version.rb +3 -3
  1475. data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +12 -12
  1476. data/vendor/rails/activesupport/lib/activesupport.rb +1 -0
  1477. data/vendor/rails/activesupport/test/abstract_unit.rb +13 -0
  1478. data/vendor/rails/activesupport/test/buffered_logger_test.rb +107 -0
  1479. data/vendor/rails/activesupport/test/clean_logger_test.rb +12 -35
  1480. data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +74 -6
  1481. data/vendor/rails/activesupport/test/core_ext/blank_test.rb +12 -4
  1482. data/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +16 -0
  1483. data/vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +105 -0
  1484. data/vendor/rails/activesupport/test/core_ext/class_test.rb +10 -0
  1485. data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +180 -4
  1486. data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +230 -0
  1487. data/vendor/rails/activesupport/test/core_ext/duplicable_test.rb +22 -0
  1488. data/vendor/rails/activesupport/test/core_ext/duration_test.rb +21 -0
  1489. data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +10 -10
  1490. data/vendor/rails/activesupport/test/core_ext/file_test.rb +29 -0
  1491. data/vendor/rails/activesupport/test/core_ext/float_ext_test.rb +25 -0
  1492. data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +262 -28
  1493. data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +30 -0
  1494. data/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +11 -11
  1495. data/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +7 -7
  1496. data/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +29 -2
  1497. data/vendor/rails/activesupport/test/core_ext/module_test.rb +92 -28
  1498. data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +91 -1
  1499. data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +98 -7
  1500. data/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +50 -0
  1501. data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +40 -12
  1502. data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +107 -22
  1503. data/vendor/rails/activesupport/test/dependencies_test.rb +30 -31
  1504. data/vendor/rails/activesupport/test/inflector_test.rb +49 -205
  1505. data/vendor/rails/activesupport/test/inflector_test_cases.rb +208 -0
  1506. data/vendor/rails/activesupport/test/json/decoding_test.rb +41 -0
  1507. data/vendor/rails/activesupport/test/json/encoding_test.rb +111 -0
  1508. data/vendor/rails/activesupport/test/multibyte_chars_test.rb +10 -1
  1509. data/vendor/rails/activesupport/test/multibyte_conformance.rb +2 -2
  1510. data/vendor/rails/activesupport/test/multibyte_handler_test.rb +95 -2
  1511. data/vendor/rails/activesupport/test/ordered_options_test.rb +5 -1
  1512. data/vendor/rails/activesupport/test/test_test.rb +73 -0
  1513. data/vendor/rails/activesupport/test/time_zone_test.rb +10 -3
  1514. data/vendor/rails/cleanlogs.sh +0 -0
  1515. data/vendor/rails/pushgems.rb +2 -2
  1516. data/vendor/rails/railties/CHANGELOG +518 -9
  1517. data/vendor/rails/railties/MIT-LICENSE +1 -1
  1518. data/vendor/rails/railties/README +17 -25
  1519. data/vendor/rails/railties/Rakefile +41 -18
  1520. data/vendor/rails/railties/bin/about +1 -1
  1521. data/vendor/rails/railties/bin/console +1 -1
  1522. data/vendor/rails/railties/bin/destroy +1 -1
  1523. data/vendor/rails/railties/bin/generate +1 -1
  1524. data/vendor/rails/railties/bin/performance/request +3 -0
  1525. data/vendor/rails/railties/bin/plugin +1 -1
  1526. data/vendor/rails/railties/bin/rails +0 -0
  1527. data/vendor/rails/railties/bin/runner +1 -1
  1528. data/vendor/rails/railties/bin/server +1 -1
  1529. data/vendor/rails/railties/builtin/rails_info/rails/info.rb +3 -3
  1530. data/vendor/rails/railties/configs/apache.conf +1 -1
  1531. data/vendor/rails/railties/configs/databases/mysql.yml +10 -4
  1532. data/vendor/rails/railties/configs/databases/postgresql.yml +16 -12
  1533. data/vendor/rails/railties/configs/databases/sqlite3.yml +1 -1
  1534. data/vendor/rails/railties/configs/initializers/inflections.rb +10 -0
  1535. data/vendor/rails/railties/configs/initializers/mime_types.rb +5 -0
  1536. data/vendor/rails/railties/configs/routes.rb +23 -11
  1537. data/vendor/rails/railties/dispatches/dispatch.fcgi +0 -0
  1538. data/vendor/rails/railties/dispatches/dispatch.rb +0 -0
  1539. data/vendor/rails/railties/doc/README_FOR_APP +1 -1
  1540. data/vendor/rails/railties/environments/boot.rb +96 -26
  1541. data/vendor/rails/railties/environments/development.rb +2 -5
  1542. data/vendor/rails/railties/environments/environment.rb +24 -25
  1543. data/vendor/rails/railties/environments/production.rb +1 -0
  1544. data/vendor/rails/railties/environments/test.rb +4 -1
  1545. data/vendor/rails/railties/fresh_rakefile +0 -0
  1546. data/vendor/rails/railties/helpers/application.rb +5 -2
  1547. data/vendor/rails/railties/helpers/test_helper.rb +10 -0
  1548. data/vendor/rails/railties/html/422.html +30 -0
  1549. data/vendor/rails/railties/html/500.html +1 -1
  1550. data/vendor/rails/railties/html/index.html +2 -2
  1551. data/vendor/rails/railties/html/javascripts/controls.js +484 -354
  1552. data/vendor/rails/railties/html/javascripts/dragdrop.js +88 -58
  1553. data/vendor/rails/railties/html/javascripts/effects.js +396 -364
  1554. data/vendor/rails/railties/html/javascripts/prototype.js +2817 -1107
  1555. data/vendor/rails/railties/html/robots.txt +5 -1
  1556. data/vendor/rails/railties/lib/commands/console.rb +12 -5
  1557. data/vendor/rails/railties/lib/commands/generate.rb +0 -0
  1558. data/vendor/rails/railties/lib/commands/performance/request.rb +6 -0
  1559. data/vendor/rails/railties/lib/commands/plugin.rb +17 -12
  1560. data/vendor/rails/railties/lib/commands/process/spawner.rb +14 -4
  1561. data/vendor/rails/railties/lib/commands/runner.rb +1 -1
  1562. data/vendor/rails/railties/lib/commands/servers/base.rb +12 -0
  1563. data/vendor/rails/railties/lib/commands/servers/mongrel.rb +5 -1
  1564. data/vendor/rails/railties/lib/commands/servers/webrick.rb +14 -7
  1565. data/vendor/rails/railties/lib/console_app.rb +5 -2
  1566. data/vendor/rails/railties/lib/console_with_helpers.rb +5 -2
  1567. data/vendor/rails/railties/lib/dispatcher.rb +3 -151
  1568. data/vendor/rails/railties/lib/fcgi_handler.rb +79 -81
  1569. data/vendor/rails/railties/lib/initializer.rb +125 -169
  1570. data/vendor/rails/railties/lib/rails/plugin.rb +84 -0
  1571. data/vendor/rails/railties/lib/rails/plugin/loader.rb +150 -0
  1572. data/vendor/rails/railties/lib/rails/plugin/locator.rb +78 -0
  1573. data/vendor/rails/railties/lib/rails/version.rb +3 -3
  1574. data/vendor/rails/railties/lib/rails_generator/base.rb +11 -9
  1575. data/vendor/rails/railties/lib/rails_generator/commands.rb +24 -14
  1576. data/vendor/rails/railties/lib/rails_generator/generators/applications/app/USAGE +0 -7
  1577. data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +26 -7
  1578. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/USAGE +11 -12
  1579. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/controller_generator.rb +2 -2
  1580. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb +1 -11
  1581. data/vendor/rails/railties/lib/rails_generator/generators/components/controller/templates/{view.rhtml → view.html.erb} +0 -0
  1582. data/vendor/rails/railties/lib/rails_generator/generators/components/integration_test/USAGE +5 -11
  1583. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/USAGE +8 -10
  1584. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/mailer_generator.rb +3 -3
  1585. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.erb +3 -0
  1586. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -3
  1587. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +8 -24
  1588. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.erb +3 -0
  1589. data/vendor/rails/railties/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -3
  1590. data/vendor/rails/railties/lib/rails_generator/generators/components/migration/USAGE +23 -8
  1591. data/vendor/rails/railties/lib/rails_generator/generators/components/migration/migration_generator.rb +15 -2
  1592. data/vendor/rails/railties/lib/rails_generator/generators/components/migration/templates/migration.rb +6 -2
  1593. data/vendor/rails/railties/lib/rails_generator/generators/components/model/USAGE +15 -14
  1594. data/vendor/rails/railties/lib/rails_generator/generators/components/model/model_generator.rb +10 -3
  1595. data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +11 -3
  1596. data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/migration.rb +4 -1
  1597. data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb +1 -3
  1598. data/vendor/rails/railties/lib/rails_generator/generators/components/observer/USAGE +5 -7
  1599. data/vendor/rails/railties/lib/rails_generator/generators/components/observer/templates/unit_test.rb +0 -2
  1600. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/USAGE +8 -18
  1601. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb +1 -0
  1602. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +20 -0
  1603. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/README +10 -1
  1604. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile +0 -0
  1605. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/USAGE +1 -1
  1606. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/init.rb +1 -1
  1607. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/plugin.rb +1 -1
  1608. data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/templates/tasks.rake +1 -1
  1609. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/USAGE +23 -0
  1610. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/resource_generator.rb +13 -15
  1611. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/controller.rb +1 -1
  1612. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/functional_test.rb +2 -14
  1613. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/USAGE +24 -31
  1614. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +45 -146
  1615. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +64 -37
  1616. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +23 -80
  1617. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/{layout.rhtml → layout.html.erb} +0 -0
  1618. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/style.css +1 -1
  1619. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +19 -0
  1620. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +24 -0
  1621. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +18 -0
  1622. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +10 -0
  1623. data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/USAGE +6 -11
  1624. data/vendor/rails/railties/lib/rails_generator/generators/components/session_migration/templates/migration.rb +3 -3
  1625. data/vendor/rails/railties/lib/rails_generator/lookup.rb +45 -10
  1626. data/vendor/rails/railties/lib/rails_generator/scripts.rb +6 -3
  1627. data/vendor/rails/railties/lib/rails_generator/scripts/destroy.rb +23 -0
  1628. data/vendor/rails/railties/lib/rails_generator/secret_key_generator.rb +160 -0
  1629. data/vendor/rails/railties/lib/rails_generator/spec.rb +1 -1
  1630. data/vendor/rails/railties/lib/source_annotation_extractor.rb +62 -0
  1631. data/vendor/rails/railties/lib/tasks/annotations.rake +23 -0
  1632. data/vendor/rails/railties/lib/tasks/databases.rake +260 -84
  1633. data/vendor/rails/railties/lib/tasks/documentation.rake +11 -13
  1634. data/vendor/rails/railties/lib/tasks/framework.rake +14 -8
  1635. data/vendor/rails/railties/lib/tasks/misc.rake +7 -1
  1636. data/vendor/rails/railties/lib/tasks/rails.rb +1 -1
  1637. data/vendor/rails/railties/lib/tasks/testing.rake +5 -7
  1638. data/vendor/rails/railties/lib/test_help.rb +4 -3
  1639. data/vendor/rails/railties/lib/webrick_server.rb +3 -4
  1640. data/vendor/rails/railties/test/abstract_unit.rb +11 -7
  1641. data/vendor/rails/railties/test/boot_test.rb +179 -0
  1642. data/vendor/rails/railties/test/console_app_test.rb +29 -0
  1643. data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +147 -176
  1644. data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +1 -1
  1645. data/vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
  1646. data/vendor/rails/railties/test/generators/generator_test_helper.rb +195 -0
  1647. data/vendor/rails/railties/test/generators/rails_model_generator_test.rb +109 -0
  1648. data/vendor/rails/railties/test/generators/rails_resource_generator_test.rb +106 -0
  1649. data/vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb +185 -0
  1650. data/vendor/rails/railties/test/initializer_test.rb +204 -19
  1651. data/vendor/rails/railties/test/plugin_loader_test.rb +140 -0
  1652. data/vendor/rails/railties/test/plugin_locator_test.rb +69 -0
  1653. data/vendor/rails/railties/test/plugin_test.rb +130 -100
  1654. data/vendor/rails/railties/test/plugin_test_helper.rb +29 -0
  1655. data/vendor/rails/railties/test/rails_generator_test.rb +25 -15
  1656. data/vendor/rails/railties/test/rails_info_test.rb +7 -0
  1657. data/vendor/rails/railties/test/secret_key_generation_test.rb +35 -0
  1658. data/vendor/rails/release.rb +4 -4
  1659. metadata +1355 -486
  1660. data/app/views/admin/extension/index.rhtml +0 -45
  1661. data/app/views/admin/layout/edit.rhtml +0 -39
  1662. data/app/views/admin/page/_meta_row.rhtml +0 -4
  1663. data/app/views/admin/page/_tag_reference.rhtml +0 -4
  1664. data/app/views/admin/page/edit.rhtml +0 -140
  1665. data/app/views/admin/page/index.rhtml +0 -31
  1666. data/app/views/admin/user/edit.rhtml +0 -54
  1667. data/app/views/admin/user/preferences.rhtml +0 -29
  1668. data/lib/console_utils.rb +0 -167
  1669. data/lib/plugins/extension_patches/lib/view_paths_extension.rb +0 -23
  1670. data/public/javascripts/admin.js +0 -89
  1671. data/public/javascripts/sitemap.js +0 -131
  1672. data/public/javascripts/tabcontrol.js +0 -125
  1673. data/public/javascripts/tag_reference_search.js +0 -23
  1674. data/test/functional/admin/abstract_model_controller_test.rb +0 -125
  1675. data/test/functional/admin/export_controller_test.rb +0 -23
  1676. data/test/functional/admin/extension_controller_test.rb +0 -41
  1677. data/test/functional/admin/layout_controller_test.rb +0 -42
  1678. data/test/functional/admin/page_controller_test.rb +0 -300
  1679. data/test/functional/admin/snippet_controller_test.rb +0 -11
  1680. data/test/functional/admin/user_controller_test.rb +0 -90
  1681. data/test/functional/admin/welcome_controller_test.rb +0 -51
  1682. data/test/functional/application_controller_test.rb +0 -45
  1683. data/test/functional/extension_initialization_test.rb +0 -131
  1684. data/test/functional/extension_load_order_test.rb +0 -49
  1685. data/test/functional/login_system_test.rb +0 -138
  1686. data/test/functional/site_controller_test.rb +0 -203
  1687. data/test/unit/admin_ui_test.rb +0 -93
  1688. data/test/unit/annotatable_test.rb +0 -76
  1689. data/test/unit/extension_migrator_test.rb +0 -17
  1690. data/test/unit/extension_test.rb +0 -42
  1691. data/test/unit/file_not_found_page_test.rb +0 -31
  1692. data/test/unit/inheritable_class_attributes_test.rb +0 -47
  1693. data/test/unit/layout_test.rb +0 -29
  1694. data/test/unit/local_time_test.rb +0 -45
  1695. data/test/unit/method_observer_test.rb +0 -53
  1696. data/test/unit/page_context_test.rb +0 -60
  1697. data/test/unit/page_part_test.rb +0 -44
  1698. data/test/unit/page_test.rb +0 -449
  1699. data/test/unit/radiant/config_test.rb +0 -57
  1700. data/test/unit/radiant/exporter_test.rb +0 -26
  1701. data/test/unit/radiant/taggable_test.rb +0 -105
  1702. data/test/unit/response_cache_test.rb +0 -233
  1703. data/test/unit/simpleton_test.rb +0 -42
  1704. data/test/unit/snippet_test.rb +0 -47
  1705. data/test/unit/standard_tags_test.rb +0 -472
  1706. data/test/unit/status_test.rb +0 -43
  1707. data/test/unit/text_filter_test.rb +0 -42
  1708. data/test/unit/user_action_observer_test.rb +0 -40
  1709. data/test/unit/user_test.rb +0 -137
  1710. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb +0 -3
  1711. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/address.rb +0 -242
  1712. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/attachments.rb +0 -39
  1713. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/base64.rb +0 -71
  1714. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/config.rb +0 -69
  1715. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/encode.rb +0 -467
  1716. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/header.rb +0 -914
  1717. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mail.rb +0 -447
  1718. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/mailbox.rb +0 -433
  1719. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/net.rb +0 -280
  1720. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/obsolete.rb +0 -135
  1721. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/parser.rb +0 -1522
  1722. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/port.rb +0 -377
  1723. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb +0 -131
  1724. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner.rb +0 -41
  1725. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/scanner_r.rb +0 -263
  1726. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/stringio.rb +0 -277
  1727. data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail/utils.rb +0 -238
  1728. data/vendor/rails/actionmailer/test/fixtures/helper_mailer/use_test_helper.rhtml +0 -1
  1729. data/vendor/rails/actionmailer/test/fixtures/helpers/test_helper.rb +0 -5
  1730. data/vendor/rails/actionmailer/test/fixtures/raw_email11 +0 -34
  1731. data/vendor/rails/actionpack/examples/address_book/index.rhtml +0 -33
  1732. data/vendor/rails/actionpack/examples/address_book/layout.rhtml +0 -8
  1733. data/vendor/rails/actionpack/examples/address_book_controller.cgi +0 -9
  1734. data/vendor/rails/actionpack/examples/address_book_controller.fcgi +0 -6
  1735. data/vendor/rails/actionpack/examples/address_book_controller.rb +0 -52
  1736. data/vendor/rails/actionpack/examples/address_book_controller.rbx +0 -4
  1737. data/vendor/rails/actionpack/examples/benchmark.rb +0 -52
  1738. data/vendor/rails/actionpack/examples/benchmark_with_ar.fcgi +0 -89
  1739. data/vendor/rails/actionpack/examples/blog_controller.cgi +0 -53
  1740. data/vendor/rails/actionpack/examples/debate/index.rhtml +0 -14
  1741. data/vendor/rails/actionpack/examples/debate/new_topic.rhtml +0 -22
  1742. data/vendor/rails/actionpack/examples/debate/topic.rhtml +0 -32
  1743. data/vendor/rails/actionpack/examples/debate_controller.cgi +0 -57
  1744. data/vendor/rails/actionpack/lib/action_controller/assertions/deprecated_assertions.rb +0 -228
  1745. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb +0 -36
  1746. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb +0 -211
  1747. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb +0 -125
  1748. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/pstore_performance_fix.rb +0 -30
  1749. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb +0 -95
  1750. data/vendor/rails/actionpack/lib/action_controller/cgi_ext/session_performance_fix.rb +0 -30
  1751. data/vendor/rails/actionpack/lib/action_controller/deprecated_dependencies.rb +0 -65
  1752. data/vendor/rails/actionpack/lib/action_controller/deprecated_redirects.rb +0 -17
  1753. data/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb +0 -34
  1754. data/vendor/rails/actionpack/lib/action_controller/macros/auto_complete.rb +0 -53
  1755. data/vendor/rails/actionpack/lib/action_controller/macros/in_place_editing.rb +0 -33
  1756. data/vendor/rails/actionpack/lib/action_controller/pagination.rb +0 -408
  1757. data/vendor/rails/actionpack/lib/action_controller/scaffolding.rb +0 -189
  1758. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml +0 -44
  1759. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml +0 -11
  1760. data/vendor/rails/actionpack/lib/action_controller/templates/rescues/template_error.rhtml +0 -21
  1761. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml +0 -7
  1762. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/layout.rhtml +0 -69
  1763. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/list.rhtml +0 -27
  1764. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/new.rhtml +0 -6
  1765. data/vendor/rails/actionpack/lib/action_controller/templates/scaffolds/show.rhtml +0 -9
  1766. data/vendor/rails/actionpack/lib/action_controller/vendor/xml_node.rb +0 -97
  1767. data/vendor/rails/actionpack/lib/action_view/helpers/deprecated_helper.rb +0 -37
  1768. data/vendor/rails/actionpack/lib/action_view/helpers/java_script_macros_helper.rb +0 -233
  1769. data/vendor/rails/actionpack/lib/action_view/helpers/pagination_helper.rb +0 -86
  1770. data/vendor/rails/actionpack/test/activerecord/active_record_assertions_test.rb +0 -92
  1771. data/vendor/rails/actionpack/test/activerecord/pagination_test.rb +0 -165
  1772. data/vendor/rails/actionpack/test/controller/deprecated_instance_variables_test.rb +0 -48
  1773. data/vendor/rails/actionpack/test/controller/raw_post_test.rb +0 -68
  1774. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml +0 -1
  1775. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml +0 -1
  1776. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml +0 -1
  1777. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_flash_method.rhtml +0 -1
  1778. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml +0 -1
  1779. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_headers_method.rhtml +0 -1
  1780. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_params_ivar.rhtml +0 -1
  1781. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_params_method.rhtml +0 -1
  1782. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_request_ivar.rhtml +0 -1
  1783. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_request_method.rhtml +0 -1
  1784. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_response_ivar.rhtml +0 -1
  1785. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_response_method.rhtml +0 -1
  1786. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_session_ivar.rhtml +0 -1
  1787. data/vendor/rails/actionpack/test/fixtures/deprecated_instance_variables/_session_method.rhtml +0 -1
  1788. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.rhtml +0 -1
  1789. data/vendor/rails/actionpack/test/fixtures/test/_hash_object.rhtml +0 -1
  1790. data/vendor/rails/actionpack/test/fixtures/test/list.rhtml +0 -1
  1791. data/vendor/rails/actionpack/test/template/deprecated_helper_test.rb +0 -36
  1792. data/vendor/rails/actionpack/test/template/deprecated_instance_variables_test.rb +0 -43
  1793. data/vendor/rails/actionpack/test/template/java_script_macros_helper_test.rb +0 -109
  1794. data/vendor/rails/actionwebservice/CHANGELOG +0 -293
  1795. data/vendor/rails/actionwebservice/MIT-LICENSE +0 -21
  1796. data/vendor/rails/actionwebservice/README +0 -364
  1797. data/vendor/rails/actionwebservice/Rakefile +0 -171
  1798. data/vendor/rails/actionwebservice/TODO +0 -32
  1799. data/vendor/rails/actionwebservice/examples/googlesearch/README +0 -143
  1800. data/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_api.rb +0 -50
  1801. data/vendor/rails/actionwebservice/examples/googlesearch/autoloading/google_search_controller.rb +0 -57
  1802. data/vendor/rails/actionwebservice/examples/googlesearch/delegated/google_search_service.rb +0 -108
  1803. data/vendor/rails/actionwebservice/examples/googlesearch/delegated/search_controller.rb +0 -7
  1804. data/vendor/rails/actionwebservice/examples/googlesearch/direct/google_search_api.rb +0 -50
  1805. data/vendor/rails/actionwebservice/examples/googlesearch/direct/search_controller.rb +0 -58
  1806. data/vendor/rails/actionwebservice/examples/metaWeblog/README +0 -17
  1807. data/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_api.rb +0 -60
  1808. data/vendor/rails/actionwebservice/examples/metaWeblog/apis/blogger_service.rb +0 -34
  1809. data/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_api.rb +0 -67
  1810. data/vendor/rails/actionwebservice/examples/metaWeblog/apis/meta_weblog_service.rb +0 -48
  1811. data/vendor/rails/actionwebservice/examples/metaWeblog/controllers/xmlrpc_controller.rb +0 -16
  1812. data/vendor/rails/actionwebservice/install.rb +0 -30
  1813. data/vendor/rails/actionwebservice/lib/action_web_service.rb +0 -66
  1814. data/vendor/rails/actionwebservice/lib/action_web_service/api.rb +0 -249
  1815. data/vendor/rails/actionwebservice/lib/action_web_service/base.rb +0 -42
  1816. data/vendor/rails/actionwebservice/lib/action_web_service/casting.rb +0 -136
  1817. data/vendor/rails/actionwebservice/lib/action_web_service/client.rb +0 -3
  1818. data/vendor/rails/actionwebservice/lib/action_web_service/client/base.rb +0 -28
  1819. data/vendor/rails/actionwebservice/lib/action_web_service/client/soap_client.rb +0 -113
  1820. data/vendor/rails/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb +0 -58
  1821. data/vendor/rails/actionwebservice/lib/action_web_service/container.rb +0 -3
  1822. data/vendor/rails/actionwebservice/lib/action_web_service/container/action_controller_container.rb +0 -93
  1823. data/vendor/rails/actionwebservice/lib/action_web_service/container/delegated_container.rb +0 -86
  1824. data/vendor/rails/actionwebservice/lib/action_web_service/container/direct_container.rb +0 -69
  1825. data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher.rb +0 -2
  1826. data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/abstract.rb +0 -203
  1827. data/vendor/rails/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +0 -376
  1828. data/vendor/rails/actionwebservice/lib/action_web_service/invocation.rb +0 -202
  1829. data/vendor/rails/actionwebservice/lib/action_web_service/protocol.rb +0 -4
  1830. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/abstract.rb +0 -112
  1831. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/discovery.rb +0 -37
  1832. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb +0 -176
  1833. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/soap_protocol/marshaler.rb +0 -241
  1834. data/vendor/rails/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb +0 -110
  1835. data/vendor/rails/actionwebservice/lib/action_web_service/scaffolding.rb +0 -283
  1836. data/vendor/rails/actionwebservice/lib/action_web_service/struct.rb +0 -68
  1837. data/vendor/rails/actionwebservice/lib/action_web_service/support/class_inheritable_options.rb +0 -26
  1838. data/vendor/rails/actionwebservice/lib/action_web_service/support/signature_types.rb +0 -222
  1839. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/layout.rhtml +0 -65
  1840. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/methods.rhtml +0 -6
  1841. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/parameters.rhtml +0 -29
  1842. data/vendor/rails/actionwebservice/lib/action_web_service/templates/scaffolds/result.rhtml +0 -30
  1843. data/vendor/rails/actionwebservice/lib/action_web_service/test_invoke.rb +0 -110
  1844. data/vendor/rails/actionwebservice/lib/action_web_service/version.rb +0 -9
  1845. data/vendor/rails/actionwebservice/setup.rb +0 -1379
  1846. data/vendor/rails/actionwebservice/test/abstract_client.rb +0 -183
  1847. data/vendor/rails/actionwebservice/test/abstract_dispatcher.rb +0 -505
  1848. data/vendor/rails/actionwebservice/test/abstract_unit.rb +0 -45
  1849. data/vendor/rails/actionwebservice/test/api_test.rb +0 -102
  1850. data/vendor/rails/actionwebservice/test/apis/auto_load_api.rb +0 -3
  1851. data/vendor/rails/actionwebservice/test/apis/broken_auto_load_api.rb +0 -2
  1852. data/vendor/rails/actionwebservice/test/base_test.rb +0 -42
  1853. data/vendor/rails/actionwebservice/test/casting_test.rb +0 -86
  1854. data/vendor/rails/actionwebservice/test/client_soap_test.rb +0 -152
  1855. data/vendor/rails/actionwebservice/test/client_xmlrpc_test.rb +0 -151
  1856. data/vendor/rails/actionwebservice/test/container_test.rb +0 -73
  1857. data/vendor/rails/actionwebservice/test/dispatcher_action_controller_soap_test.rb +0 -137
  1858. data/vendor/rails/actionwebservice/test/dispatcher_action_controller_xmlrpc_test.rb +0 -59
  1859. data/vendor/rails/actionwebservice/test/fixtures/db_definitions/mysql.sql +0 -7
  1860. data/vendor/rails/actionwebservice/test/fixtures/users.yml +0 -10
  1861. data/vendor/rails/actionwebservice/test/gencov +0 -3
  1862. data/vendor/rails/actionwebservice/test/invocation_test.rb +0 -185
  1863. data/vendor/rails/actionwebservice/test/run +0 -6
  1864. data/vendor/rails/actionwebservice/test/scaffolded_controller_test.rb +0 -146
  1865. data/vendor/rails/actionwebservice/test/struct_test.rb +0 -52
  1866. data/vendor/rails/actionwebservice/test/test_invoke_test.rb +0 -112
  1867. data/vendor/rails/activerecord/benchmarks/benchmark.rb +0 -26
  1868. data/vendor/rails/activerecord/benchmarks/mysql_benchmark.rb +0 -19
  1869. data/vendor/rails/activerecord/examples/associations.rb +0 -87
  1870. data/vendor/rails/activerecord/examples/shared_setup.rb +0 -15
  1871. data/vendor/rails/activerecord/examples/validation.rb +0 -85
  1872. data/vendor/rails/activerecord/lib/active_record/acts/list.rb +0 -256
  1873. data/vendor/rails/activerecord/lib/active_record/acts/nested_set.rb +0 -211
  1874. data/vendor/rails/activerecord/lib/active_record/acts/tree.rb +0 -96
  1875. data/vendor/rails/activerecord/lib/active_record/connection_adapters/db2_adapter.rb +0 -228
  1876. data/vendor/rails/activerecord/lib/active_record/connection_adapters/firebird_adapter.rb +0 -728
  1877. data/vendor/rails/activerecord/lib/active_record/connection_adapters/frontbase_adapter.rb +0 -861
  1878. data/vendor/rails/activerecord/lib/active_record/connection_adapters/openbase_adapter.rb +0 -350
  1879. data/vendor/rails/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb +0 -690
  1880. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +0 -607
  1881. data/vendor/rails/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb +0 -662
  1882. data/vendor/rails/activerecord/lib/active_record/deprecated_associations.rb +0 -104
  1883. data/vendor/rails/activerecord/lib/active_record/deprecated_finders.rb +0 -44
  1884. data/vendor/rails/activerecord/lib/active_record/vendor/simple.rb +0 -693
  1885. data/vendor/rails/activerecord/lib/active_record/wrappers/yaml_wrapper.rb +0 -15
  1886. data/vendor/rails/activerecord/lib/active_record/wrappings.rb +0 -58
  1887. data/vendor/rails/activerecord/lib/active_record/xml_serialization.rb +0 -308
  1888. data/vendor/rails/activerecord/test/connections/native_sqlserver/connection.rb +0 -23
  1889. data/vendor/rails/activerecord/test/connections/native_sqlserver_odbc/connection.rb +0 -25
  1890. data/vendor/rails/activerecord/test/copy_table_sqlite.rb +0 -64
  1891. data/vendor/rails/activerecord/test/deprecated_associations_test.rb +0 -396
  1892. data/vendor/rails/activerecord/test/empty_date_time_test.rb +0 -25
  1893. data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.drop.sql +0 -32
  1894. data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql.sql +0 -234
  1895. data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql2.drop.sql +0 -2
  1896. data/vendor/rails/activerecord/test/fixtures/db_definitions/mysql2.sql +0 -5
  1897. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver.drop.sql +0 -34
  1898. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver.sql +0 -243
  1899. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver2.drop.sql +0 -2
  1900. data/vendor/rails/activerecord/test/fixtures/db_definitions/sqlserver2.sql +0 -5
  1901. data/vendor/rails/activerecord/test/fixtures/mixin.rb +0 -63
  1902. data/vendor/rails/activerecord/test/mixin_nested_set_test.rb +0 -196
  1903. data/vendor/rails/activesupport/lib/active_support/binding_of_caller.rb +0 -84
  1904. data/vendor/rails/activesupport/lib/active_support/breakpoint.rb +0 -528
  1905. data/vendor/rails/activesupport/lib/active_support/caching_tools.rb +0 -62
  1906. data/vendor/rails/activesupport/lib/active_support/core_ext/bigdecimal/formatting.rb +0 -7
  1907. data/vendor/rails/activesupport/lib/active_support/json/encoders.rb +0 -25
  1908. data/vendor/rails/activesupport/lib/active_support/json/encoders/core.rb +0 -70
  1909. data/vendor/rails/activesupport/lib/active_support/reloadable.rb +0 -60
  1910. data/vendor/rails/activesupport/lib/active_support/vendor/builder/blankslate.rb +0 -63
  1911. data/vendor/rails/activesupport/lib/active_support/vendor/builder/xchar.rb +0 -112
  1912. data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlbase.rb +0 -145
  1913. data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlevents.rb +0 -63
  1914. data/vendor/rails/activesupport/lib/active_support/vendor/builder/xmlmarkup.rb +0 -327
  1915. data/vendor/rails/activesupport/lib/active_support/vendor/xml_simple.rb +0 -1021
  1916. data/vendor/rails/activesupport/test/caching_tools_test.rb +0 -79
  1917. data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default.rb +0 -30
  1918. data/vendor/rails/activesupport/test/json_test.rb +0 -97
  1919. data/vendor/rails/activesupport/test/reloadable_test.rb +0 -123
  1920. data/vendor/rails/railties/bin/breakpointer +0 -3
  1921. data/vendor/rails/railties/lib/binding_of_caller.rb +0 -85
  1922. data/vendor/rails/railties/lib/breakpoint.rb +0 -553
  1923. data/vendor/rails/railties/lib/breakpoint_client.rb +0 -196
  1924. data/vendor/rails/railties/lib/commands/breakpointer.rb +0 -1
  1925. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/USAGE +0 -18
  1926. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/fixtures.yml +0 -11
  1927. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/migration.rb +0 -13
  1928. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/model.rb +0 -2
  1929. data/vendor/rails/railties/lib/rails_generator/generators/components/resource/templates/unit_test.rb +0 -10
  1930. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/form.rhtml +0 -3
  1931. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml +0 -1
  1932. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml +0 -9
  1933. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +0 -27
  1934. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml +0 -8
  1935. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml +0 -8
  1936. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/USAGE +0 -29
  1937. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb +0 -93
  1938. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/controller.rb +0 -79
  1939. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/fixtures.yml +0 -11
  1940. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/functional_test.rb +0 -57
  1941. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/helper.rb +0 -2
  1942. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/layout.rhtml +0 -17
  1943. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/migration.rb +0 -13
  1944. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/model.rb +0 -2
  1945. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/style.css +0 -74
  1946. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/unit_test.rb +0 -10
  1947. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_edit.rhtml +0 -19
  1948. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_index.rhtml +0 -24
  1949. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_new.rhtml +0 -18
  1950. data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/templates/view_show.rhtml +0 -10
  1951. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/USAGE +0 -28
  1952. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/api_definition.rb +0 -5
  1953. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/controller.rb +0 -8
  1954. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/templates/functional_test.rb +0 -19
  1955. data/vendor/rails/railties/lib/rails_generator/generators/components/web_service/web_service_generator.rb +0 -29
  1956. data/vendor/rails/railties/lib/tasks/pre_namespace_aliases.rake +0 -53
  1957. data/vendor/rails/railties/test/dispatcher_test.rb +0 -141
  1958. data/vendor/rails/railties/test/mocks/dispatcher.rb +0 -13
  1959. data/vendor/rails/railties/test/mocks/fcgi.rb +0 -15
  1960. data/vendor/rails/railties/test/mocks/stubbed_breakpoint.rb +0 -2
  1961. data/vendor/rails/railties/test/mocks/stubbed_kernel.rb +0 -5
@@ -1,22 +1,28 @@
1
1
  module ActionView
2
2
  module Helpers #:nodoc:
3
- # Provides methods for converting a numbers into formatted strings.
3
+ # Provides methods for converting numbers into formatted strings.
4
4
  # Methods are provided for phone numbers, currency, percentage,
5
5
  # precision, positional notation, and file size.
6
6
  module NumberHelper
7
- # Formats a +number+ into a US phone number. You can customize the format
7
+ # Formats a +number+ into a US phone number (e.g., (555) 123-9876). You can customize the format
8
8
  # in the +options+ hash.
9
+ #
10
+ # ==== Options
9
11
  # * <tt>:area_code</tt> - Adds parentheses around the area code.
10
- # * <tt>:delimiter</tt> - Specifies the delimiter to use, defaults to "-".
12
+ # * <tt>:delimiter</tt> - Specifies the delimiter to use (defaults to "-").
11
13
  # * <tt>:extension</tt> - Specifies an extension to add to the end of the
12
- # generated number
14
+ # generated number.
13
15
  # * <tt>:country_code</tt> - Sets the country code for the phone number.
14
16
  #
15
- # number_to_phone(1235551234) => 123-555-1234
16
- # number_to_phone(1235551234, :area_code => true) => (123) 555-1234
17
- # number_to_phone(1235551234, :delimiter => " ") => 123 555 1234
18
- # number_to_phone(1235551234, :area_code => true, :extension => 555) => (123) 555-1234 x 555
19
- # number_to_phone(1235551234, :country_code => 1)
17
+ # ==== Examples
18
+ # number_to_phone(1235551234) # => 123-555-1234
19
+ # number_to_phone(1235551234, :area_code => true) # => (123) 555-1234
20
+ # number_to_phone(1235551234, :delimiter => " ") # => 123 555 1234
21
+ # number_to_phone(1235551234, :area_code => true, :extension => 555) # => (123) 555-1234 x 555
22
+ # number_to_phone(1235551234, :country_code => 1) # => +1-123-555-1234
23
+ #
24
+ # number_to_phone(1235551234, :country_code => 1, :extension => 1343, :delimiter => ".")
25
+ # => +1.123.555.1234 x 1343
20
26
  def number_to_phone(number, options = {})
21
27
  number = number.to_s.strip unless number.nil?
22
28
  options = options.stringify_keys
@@ -40,25 +46,29 @@ module ActionView
40
46
  end
41
47
  end
42
48
 
43
- # Formats a +number+ into a currency string. You can customize the format
49
+ # Formats a +number+ into a currency string (e.g., $13.65). You can customize the format
44
50
  # in the +options+ hash.
45
- # * <tt>:precision</tt> - Sets the level of precision, defaults to 2
46
- # * <tt>:unit</tt> - Sets the denomination of the currency, defaults to "$"
47
- # * <tt>:separator</tt> - Sets the separator between the units, defaults to "."
48
- # * <tt>:delimiter</tt> - Sets the thousands delimiter, defaults to ","
49
51
  #
50
- # number_to_currency(1234567890.50) => $1,234,567,890.50
51
- # number_to_currency(1234567890.506) => $1,234,567,890.51
52
- # number_to_currency(1234567890.506, :precision => 3) => $1,234,567,890.506
53
- # number_to_currency(1234567890.50, :unit => "&pound;", :separator => ",", :delimiter => "")
54
- # => &pound;1234567890,50
52
+ # ==== Options
53
+ # * <tt>:precision</tt> - Sets the level of precision (defaults to 2).
54
+ # * <tt>:unit</tt> - Sets the denomination of the currency (defaults to "$").
55
+ # * <tt>:separator</tt> - Sets the separator between the units (defaults to ".").
56
+ # * <tt>:delimiter</tt> - Sets the thousands delimiter (defaults to ",").
57
+ #
58
+ # ==== Examples
59
+ # number_to_currency(1234567890.50) # => $1,234,567,890.50
60
+ # number_to_currency(1234567890.506) # => $1,234,567,890.51
61
+ # number_to_currency(1234567890.506, :precision => 3) # => $1,234,567,890.506
62
+ #
63
+ # number_to_currency(1234567890.50, :unit => "&pound;", :separator => ",", :delimiter => "")
64
+ # # => &pound;1234567890,50
55
65
  def number_to_currency(number, options = {})
56
66
  options = options.stringify_keys
57
67
  precision = options["precision"] || 2
58
68
  unit = options["unit"] || "$"
59
69
  separator = precision > 0 ? options["separator"] || "." : ""
60
70
  delimiter = options["delimiter"] || ","
61
-
71
+
62
72
  begin
63
73
  parts = number_with_precision(number, precision).split('.')
64
74
  unit + number_with_delimiter(parts[0], delimiter) + separator + parts[1].to_s
@@ -67,19 +77,24 @@ module ActionView
67
77
  end
68
78
  end
69
79
 
70
- # Formats a +number+ as a percentage string. You can customize the
80
+ # Formats a +number+ as a percentage string (e.g., 65%). You can customize the
71
81
  # format in the +options+ hash.
72
- # * <tt>:precision</tt> - Sets the level of precision, defaults to 3
73
- # * <tt>:separator</tt> - Sets the separator between the units, defaults to "."
74
82
  #
75
- # number_to_percentage(100) => 100.000%
76
- # number_to_percentage(100, {:precision => 0}) => 100%
77
- # number_to_percentage(302.0574, {:precision => 2}) => 302.06%
83
+ # ==== Options
84
+ # * <tt>:precision</tt> - Sets the level of precision (defaults to 3).
85
+ # * <tt>:separator</tt> - Sets the separator between the units (defaults to ".").
86
+ #
87
+ # ==== Examples
88
+ # number_to_percentage(100) # => 100.000%
89
+ # number_to_percentage(100, :precision => 0) # => 100%
90
+ #
91
+ # number_to_percentage(302.24398923423, :precision => 5)
92
+ # # => 302.24399%
78
93
  def number_to_percentage(number, options = {})
79
94
  options = options.stringify_keys
80
95
  precision = options["precision"] || 3
81
96
  separator = options["separator"] || "."
82
-
97
+
83
98
  begin
84
99
  number = number_with_precision(number, precision)
85
100
  parts = number.split('.')
@@ -93,14 +108,20 @@ module ActionView
93
108
  end
94
109
  end
95
110
 
96
- # Formats a +number+ with grouped thousands using +delimiter+. You
111
+ # Formats a +number+ with grouped thousands using +delimiter+ (e.g., 12,324). You
97
112
  # can customize the format using optional <em>delimiter</em> and <em>separator</em> parameters.
98
- # * <tt>delimiter</tt> - Sets the thousands delimiter, defaults to ","
99
- # * <tt>separator</tt> - Sets the separator between the units, defaults to "."
100
113
  #
101
- # number_with_delimiter(12345678) => 12,345,678
102
- # number_with_delimiter(12345678.05) => 12,345,678.05
103
- # number_with_delimiter(12345678, ".") => 12.345.678
114
+ # ==== Options
115
+ # * <tt>delimiter</tt> - Sets the thousands delimiter (defaults to ",").
116
+ # * <tt>separator</tt> - Sets the separator between the units (defaults to ".").
117
+ #
118
+ # ==== Examples
119
+ # number_with_delimiter(12345678) # => 12,345,678
120
+ # number_with_delimiter(12345678.05) # => 12,345,678.05
121
+ # number_with_delimiter(12345678, ".") # => 12.345.678
122
+ #
123
+ # number_with_delimiter(98765432.98, " ", ",")
124
+ # # => 98 765 432,98
104
125
  def number_with_delimiter(number, delimiter=",", separator=".")
105
126
  begin
106
127
  parts = number.to_s.split('.')
@@ -110,46 +131,49 @@ module ActionView
110
131
  number
111
132
  end
112
133
  end
113
-
114
- # Formats a +number+ with the specified level of +precision+. The default
134
+
135
+ # Formats a +number+ with the specified level of +precision+ (e.g., 112.32 has a precision of 2). The default
115
136
  # level of precision is 3.
116
137
  #
117
- # number_with_precision(111.2345) => 111.235
118
- # number_with_precision(111.2345, 2) => 111.24
138
+ # ==== Examples
139
+ # number_with_precision(111.2345) # => 111.235
140
+ # number_with_precision(111.2345, 2) # => 111.24
141
+ # number_with_precision(13, 5) # => 13.00000
142
+ # number_with_precision(389.32314, 0) # => 389
119
143
  def number_with_precision(number, precision=3)
120
144
  "%01.#{precision}f" % number
121
145
  rescue
122
146
  number
123
147
  end
124
-
125
- # Formats the bytes in +size+ into a more understandable representation.
126
- # Useful for reporting file sizes to users. This method returns nil if
127
- # +size+ cannot be converted into a number. You can change the default
128
- # precision of 1 in +precision+.
129
- #
130
- # number_to_human_size(123) => 123 Bytes
131
- # number_to_human_size(1234) => 1.2 KB
132
- # number_to_human_size(12345) => 12.1 KB
133
- # number_to_human_size(1234567) => 1.2 MB
134
- # number_to_human_size(1234567890) => 1.1 GB
135
- # number_to_human_size(1234567890123) => 1.1 TB
136
- # number_to_human_size(1234567, 2) => 1.18 MB
148
+
149
+ # Formats the bytes in +size+ into a more understandable representation
150
+ # (e.g., giving it 1500 yields 1.5 KB). This method is useful for
151
+ # reporting file sizes to users. This method returns nil if
152
+ # +size+ cannot be converted into a number. You can change the default
153
+ # precision of 1 using the precision parameter +precision+.
154
+ #
155
+ # ==== Examples
156
+ # number_to_human_size(123) # => 123 Bytes
157
+ # number_to_human_size(1234) # => 1.2 KB
158
+ # number_to_human_size(12345) # => 12.1 KB
159
+ # number_to_human_size(1234567) # => 1.2 MB
160
+ # number_to_human_size(1234567890) # => 1.1 GB
161
+ # number_to_human_size(1234567890123) # => 1.1 TB
162
+ # number_to_human_size(1234567, 2) # => 1.18 MB
163
+ # number_to_human_size(483989, 0) # => 4 MB
137
164
  def number_to_human_size(size, precision=1)
138
165
  size = Kernel.Float(size)
139
- case
140
- when size == 1 : "1 Byte"
141
- when size < 1.kilobyte: "%d Bytes" % size
142
- when size < 1.megabyte: "%.#{precision}f KB" % (size / 1.0.kilobyte)
143
- when size < 1.gigabyte: "%.#{precision}f MB" % (size / 1.0.megabyte)
144
- when size < 1.terabyte: "%.#{precision}f GB" % (size / 1.0.gigabyte)
166
+ case
167
+ when size.to_i == 1; "1 Byte"
168
+ when size < 1.kilobyte; "%d Bytes" % size
169
+ when size < 1.megabyte; "%.#{precision}f KB" % (size / 1.0.kilobyte)
170
+ when size < 1.gigabyte; "%.#{precision}f MB" % (size / 1.0.megabyte)
171
+ when size < 1.terabyte; "%.#{precision}f GB" % (size / 1.0.gigabyte)
145
172
  else "%.#{precision}f TB" % (size / 1.0.terabyte)
146
- end.sub('.0', '')
173
+ end.sub(/([0-9])\.?0+ /, '\1 ' )
147
174
  rescue
148
175
  nil
149
176
  end
150
-
151
- alias_method :human_size, :number_to_human_size # deprecated alias
152
- deprecate :human_size => :number_to_human_size
153
177
  end
154
178
  end
155
179
  end
@@ -2,25 +2,106 @@ require 'set'
2
2
 
3
3
  module ActionView
4
4
  module Helpers
5
- # Provides a set of helpers for calling Prototype JavaScript functions,
6
- # including functionality to call remote methods using
7
- # Ajax[http://www.adaptivepath.com/publications/essays/archives/000385.php].
5
+ # Prototype[http://www.prototypejs.org/] is a JavaScript library that provides
6
+ # DOM[http://en.wikipedia.org/wiki/Document_Object_Model] manipulation,
7
+ # Ajax[http://www.adaptivepath.com/publications/essays/archives/000385.php]
8
+ # functionality, and more traditional object-oriented facilities for JavaScript.
9
+ # This module provides a set of helpers to make it more convenient to call
10
+ # functions from Prototype using Rails, including functionality to call remote
11
+ # Rails methods (that is, making a background request to a Rails action) using Ajax.
8
12
  # This means that you can call actions in your controllers without
9
13
  # reloading the page, but still update certain parts of it using
10
- # injections into the DOM. The common use case is having a form that adds
11
- # a new element to a list without reloading the page.
14
+ # injections into the DOM. A common use case is having a form that adds
15
+ # a new element to a list without reloading the page or updating a shopping
16
+ # cart total when a new item is added.
12
17
  #
13
- # To be able to use these helpers, you must include the Prototype
14
- # JavaScript framework in your pages. See the documentation for
15
- # ActionView::Helpers::JavaScriptHelper for more information on including
16
- # the necessary JavaScript.
18
+ # == Usage
19
+ # To be able to use these helpers, you must first include the Prototype
20
+ # JavaScript framework in your pages.
17
21
  #
22
+ # javascript_include_tag 'prototype'
23
+ #
24
+ # (See the documentation for
25
+ # ActionView::Helpers::JavaScriptHelper for more information on including
26
+ # this and other JavaScript files in your Rails templates.)
27
+ #
28
+ # Now you're ready to call a remote action either through a link...
29
+ #
30
+ # link_to_remote "Add to cart",
31
+ # :url => { :action => "add", :id => product.id },
32
+ # :update => { :success => "cart", :failure => "error" }
33
+ #
34
+ # ...through a form...
35
+ #
36
+ # <% form_remote_tag :url => '/shipping' do -%>
37
+ # <div><%= submit_tag 'Recalculate Shipping' %></div>
38
+ # <% end -%>
39
+ #
40
+ # ...periodically...
41
+ #
42
+ # periodically_call_remote(:url => 'update', :frequency => '5', :update => 'ticker')
43
+ #
44
+ # ...or through an observer (i.e., a form or field that is observed and calls a remote
45
+ # action when changed).
46
+ #
47
+ # <%= observe_field(:searchbox,
48
+ # :url => { :action => :live_search }),
49
+ # :frequency => 0.5,
50
+ # :update => :hits,
51
+ # :with => 'query'
52
+ # %>
53
+ #
54
+ # As you can see, there are numerous ways to use Prototype's Ajax functions (and actually more than
55
+ # are listed here); check out the documentation for each method to find out more about its usage and options.
56
+ #
57
+ # === Common Options
18
58
  # See link_to_remote for documentation of options common to all Ajax
19
- # helpers.
59
+ # helpers; any of the options specified by link_to_remote can be used
60
+ # by the other helpers.
61
+ #
62
+ # == Designing your Rails actions for Ajax
63
+ # When building your action handlers (that is, the Rails actions that receive your background requests), it's
64
+ # important to remember a few things. First, whatever your action would normall return to the browser, it will
65
+ # return to the Ajax call. As such, you typically don't want to render with a layout. This call will cause
66
+ # the layout to be transmitted back to your page, and, if you have a full HTML/CSS, will likely mess a lot of things up.
67
+ # You can turn the layout off on particular actions by doing the following:
68
+ #
69
+ # class SiteController < ActionController::Base
70
+ # layout "standard", :except => [:ajax_method, :more_ajax, :another_ajax]
71
+ # end
72
+ #
73
+ # Optionally, you could do this in the method you wish to lack a layout:
74
+ #
75
+ # render :layout => false
76
+ #
77
+ # You can tell the type of request from within your action using the <tt>request.xhr?</tt> (XmlHttpRequest, the
78
+ # method that Ajax uses to make background requests) method.
79
+ # def name
80
+ # # Is this an XmlHttpRequest request?
81
+ # if (request.xhr?)
82
+ # render :text => @name.to_s
83
+ # else
84
+ # # No? Then render an action.
85
+ # render :action => 'view_attribute', :attr => @name
86
+ # end
87
+ # end
20
88
  #
21
- # See also ActionView::Helpers::ScriptaculousHelper for helpers which work
22
- # with the Scriptaculous controls and visual effects library.
89
+ # The else clause can be left off and the current action will render with full layout and template. An extension
90
+ # to this solution was posted to Ryan Heneise's blog at ArtOfMission["http://www.artofmission.com/"].
23
91
  #
92
+ # layout proc{ |c| c.request.xhr? ? false : "application" }
93
+ #
94
+ # Dropping this in your ApplicationController turns the layout off for every request that is an "xhr" request.
95
+ #
96
+ # If you are just returning a little data or don't want to build a template for your output, you may opt to simply
97
+ # render text output, like this:
98
+ #
99
+ # render :text => 'Return this from my method!'
100
+ #
101
+ # Since whatever the method returns is injected into the DOM, this will simply inject some text (or HTML, if you
102
+ # tell it to). This is usually how small updates, such updating a cart total or a file count, are handled.
103
+ #
104
+ # == Updating multiple elements
24
105
  # See JavaScriptGenerator for information on updating multiple elements
25
106
  # on the page in an Ajax response.
26
107
  module PrototypeHelper
@@ -41,16 +122,30 @@ module ActionView
41
122
  # render :partial.
42
123
  #
43
124
  # Examples:
125
+ # # Generates: <a href="#" onclick="new Ajax.Updater('posts', '/blog/destroy/3', {asynchronous:true, evalScripts:true});
126
+ # # return false;">Delete this post</a>
44
127
  # link_to_remote "Delete this post", :update => "posts",
45
128
  # :url => { :action => "destroy", :id => post.id }
129
+ #
130
+ # # Generates: <a href="#" onclick="new Ajax.Updater('emails', '/mail/list_emails', {asynchronous:true, evalScripts:true});
131
+ # # return false;"><img alt="Refresh" src="/images/refresh.png?" /></a>
46
132
  # link_to_remote(image_tag("refresh"), :update => "emails",
47
133
  # :url => { :action => "list_emails" })
134
+ #
135
+ # You can override the generated HTML options by specifying a hash in
136
+ # <tt>options[:html]</tt>.
137
+ #
138
+ # link_to_remote "Delete this post", :update => "posts",
139
+ # :url => post_url(@post), :method => :delete,
140
+ # :html => { :class => "destructive" }
48
141
  #
49
142
  # You can also specify a hash for <tt>options[:update]</tt> to allow for
50
143
  # easy redirection of output to an other DOM element if a server-side
51
144
  # error occurs:
52
145
  #
53
146
  # Example:
147
+ # # Generates: <a href="#" onclick="new Ajax.Updater({success:'posts',failure:'error'}, '/blog/destroy/5',
148
+ # # {asynchronous:true, evalScripts:true}); return false;">Delete this post</a>
54
149
  # link_to_remote "Delete this post",
55
150
  # :url => { :action => "destroy", :id => post.id },
56
151
  # :update => { :success => "posts", :failure => "error" }
@@ -63,6 +158,8 @@ module ActionView
63
158
  # can simulate PUT or DELETE over POST. All specified with <tt>options[:method]</tt>
64
159
  #
65
160
  # Example:
161
+ # # Generates: <a href="#" onclick="new Ajax.Request('/person/4', {asynchronous:true, evalScripts:true, method:'delete'});
162
+ # # return false;">Destroy</a>
66
163
  # link_to_remote "Destroy", :url => person_url(:id => person), :method => :delete
67
164
  #
68
165
  # By default, these remote requests are processed asynchronous during
@@ -74,6 +171,9 @@ module ActionView
74
171
  # find out the HTTP status, use <tt>request.status</tt>.
75
172
  #
76
173
  # Example:
174
+ # # Generates: <a href="#" onclick="new Ajax.Request('/words/undo?n=33', {asynchronous:true, evalScripts:true,
175
+ # # onComplete:function(request){undoRequestCompleted(request)}}); return false;">hello</a>
176
+ # word = 'hello'
77
177
  # link_to_remote word,
78
178
  # :url => { :action => "undo", :n => word_counter },
79
179
  # :complete => "undoRequestCompleted(request)"
@@ -100,6 +200,9 @@ module ActionView
100
200
  # adding additional callbacks for specific status codes.
101
201
  #
102
202
  # Example:
203
+ # # Generates: <a href="#" onclick="new Ajax.Request('/testing/action', {asynchronous:true, evalScripts:true,
204
+ # # on404:function(request){alert('Not found...? Wrong URL...?')},
205
+ # # onFailure:function(request){alert('HTTP Error ' + request.status + '!')}}); return false;">hello</a>
103
206
  # link_to_remote word,
104
207
  # :url => { :action => "action" },
105
208
  # 404 => "alert('Not found...? Wrong URL...?')",
@@ -129,8 +232,27 @@ module ActionView
129
232
  # default this is the current form, but
130
233
  # it could just as well be the ID of a
131
234
  # table row or any other DOM element.
132
- def link_to_remote(name, options = {}, html_options = {})
133
- link_to_function(name, remote_function(options), html_options)
235
+ # <tt>:with</tt>:: A JavaScript expression specifying
236
+ # the parameters for the XMLHttpRequest.
237
+ # Any expressions should return a valid
238
+ # URL query string.
239
+ #
240
+ # Example:
241
+ #
242
+ # :with => "'name=' + $('name').value"
243
+ #
244
+ # You can generate a link that uses AJAX in the general case, while
245
+ # degrading gracefully to plain link behavior in the absence of
246
+ # JavaScript by setting <tt>html_options[:href]</tt> to an alternate URL.
247
+ # Note the extra curly braces around the <tt>options</tt> hash separate
248
+ # it as the second parameter from <tt>html_options</tt>, the third.
249
+ #
250
+ # Example:
251
+ # link_to_remote "Delete this post",
252
+ # { :update => "posts", :url => { :action => "destroy", :id => post.id } },
253
+ # :href => url_for(:action => "destroy", :id => post.id)
254
+ def link_to_remote(name, options = {}, html_options = nil)
255
+ link_to_function(name, remote_function(options), html_options || options.delete(:html))
134
256
  end
135
257
 
136
258
  # Periodically calls the specified url (<tt>options[:url]</tt>) every
@@ -138,6 +260,26 @@ module ActionView
138
260
  # update a specified div (<tt>options[:update]</tt>) with the results
139
261
  # of the remote call. The options for specifying the target with :url
140
262
  # and defining callbacks is the same as link_to_remote.
263
+ # Examples:
264
+ # # Call get_averages and put its results in 'avg' every 10 seconds
265
+ # # Generates:
266
+ # # new PeriodicalExecuter(function() {new Ajax.Updater('avg', '/grades/get_averages',
267
+ # # {asynchronous:true, evalScripts:true})}, 10)
268
+ # periodically_call_remote(:url => { :action => 'get_averages' }, :update => 'avg')
269
+ #
270
+ # # Call invoice every 10 seconds with the id of the customer
271
+ # # If it succeeds, update the invoice DIV; if it fails, update the error DIV
272
+ # # Generates:
273
+ # # new PeriodicalExecuter(function() {new Ajax.Updater({success:'invoice',failure:'error'},
274
+ # # '/testing/invoice/16', {asynchronous:true, evalScripts:true})}, 10)
275
+ # periodically_call_remote(:url => { :action => 'invoice', :id => customer.id },
276
+ # :update => { :success => "invoice", :failure => "error" }
277
+ #
278
+ # # Call update every 20 seconds and update the new_block DIV
279
+ # # Generates:
280
+ # # new PeriodicalExecuter(function() {new Ajax.Updater('news_block', 'update', {asynchronous:true, evalScripts:true})}, 20)
281
+ # periodically_call_remote(:url => 'update', :frequency => '20', :update => 'news_block')
282
+ #
141
283
  def periodically_call_remote(options = {})
142
284
  frequency = options[:frequency] || 10 # every ten seconds by default
143
285
  code = "new PeriodicalExecuter(function() {#{remote_function(options)}}, #{frequency})"
@@ -156,6 +298,9 @@ module ActionView
156
298
  # specified with the :action/:method options on :html.
157
299
  #
158
300
  # Example:
301
+ # # Generates:
302
+ # # <form action="/some/place" method="post" onsubmit="new Ajax.Request('',
303
+ # # {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;">
159
304
  # form_remote_tag :html => { :action =>
160
305
  # url_for(:controller => "some", :action => "place") }
161
306
  #
@@ -166,6 +311,11 @@ module ActionView
166
311
  # the :url (and the default method is :post).
167
312
  #
168
313
  # form_remote_tag also takes a block, like form_tag:
314
+ # # Generates:
315
+ # # <form action="/" method="post" onsubmit="new Ajax.Request('/',
316
+ # # {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)});
317
+ # # return false;"> <div><input name="commit" type="submit" value="Save" /></div>
318
+ # # </form>
169
319
  # <% form_remote_tag :url => '/posts' do -%>
170
320
  # <div><%= submit_tag 'Save' %></div>
171
321
  # <% end -%>
@@ -180,18 +330,85 @@ module ActionView
180
330
  form_tag(options[:html].delete(:action) || url_for(options[:url]), options[:html], &block)
181
331
  end
182
332
 
183
- # Works like form_remote_tag, but uses form_for semantics.
184
- def remote_form_for(object_name, *args, &proc)
185
- options = args.last.is_a?(Hash) ? args.pop : {}
333
+ # Creates a form that will submit using XMLHttpRequest in the background
334
+ # instead of the regular reloading POST arrangement and a scope around a
335
+ # specific resource that is used as a base for questioning about
336
+ # values for the fields.
337
+ #
338
+ # === Resource
339
+ #
340
+ # Example:
341
+ # <% remote_form_for(@post) do |f| %>
342
+ # ...
343
+ # <% end %>
344
+ #
345
+ # This will expand to be the same as:
346
+ #
347
+ # <% remote_form_for :post, @post, :url => post_path(@post), :html => { :method => :put, :class => "edit_post", :id => "edit_post_45" } do |f| %>
348
+ # ...
349
+ # <% end %>
350
+ #
351
+ # === Nested Resource
352
+ #
353
+ # Example:
354
+ # <% remote_form_for([@post, @comment]) do |f| %>
355
+ # ...
356
+ # <% end %>
357
+ #
358
+ # This will expand to be the same as:
359
+ #
360
+ # <% remote_form_for :comment, @comment, :url => post_comment_path(@post, @comment), :html => { :method => :put, :class => "edit_comment", :id => "edit_comment_45" } do |f| %>
361
+ # ...
362
+ # <% end %>
363
+ #
364
+ # If you don't need to attach a form to a resource, then check out form_remote_tag.
365
+ #
366
+ # See FormHelper#form_for for additional semantics.
367
+ def remote_form_for(record_or_name_or_array, *args, &proc)
368
+ options = args.extract_options!
369
+
370
+ case record_or_name_or_array
371
+ when String, Symbol
372
+ object_name = record_or_name_or_array
373
+ when Array
374
+ object = record_or_name_or_array.last
375
+ object_name = ActionController::RecordIdentifier.singular_class_name(object)
376
+ apply_form_for_options!(record_or_name_or_array, options)
377
+ args.unshift object
378
+ else
379
+ object = record_or_name_or_array
380
+ object_name = ActionController::RecordIdentifier.singular_class_name(record_or_name_or_array)
381
+ apply_form_for_options!(object, options)
382
+ args.unshift object
383
+ end
384
+
186
385
  concat(form_remote_tag(options), proc.binding)
187
386
  fields_for(object_name, *(args << options), &proc)
188
387
  concat('</form>', proc.binding)
189
388
  end
190
389
  alias_method :form_remote_for, :remote_form_for
191
390
 
192
- # Returns a button input tag that will submit form using XMLHttpRequest
193
- # in the background instead of regular reloading POST arrangement.
194
- # <tt>options</tt> argument is the same as in <tt>form_remote_tag</tt>.
391
+ # Returns a button input tag with the element name of +name+ and a value (i.e., display text) of +value+
392
+ # that will submit form using XMLHttpRequest in the background instead of a regular POST request that
393
+ # reloads the page.
394
+ #
395
+ # # Create a button that submits to the create action
396
+ # #
397
+ # # Generates: <input name="create_btn" onclick="new Ajax.Request('/testing/create',
398
+ # # {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form)});
399
+ # # return false;" type="button" value="Create" />
400
+ # <%= submit_to_remote 'create_btn', 'Create', :url => { :action => 'create' } %>
401
+ #
402
+ # # Submit to the remote action update and update the DIV succeed or fail based
403
+ # # on the success or failure of the request
404
+ # #
405
+ # # Generates: <input name="update_btn" onclick="new Ajax.Updater({success:'succeed',failure:'fail'},
406
+ # # '/testing/update', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form)});
407
+ # # return false;" type="button" value="Update" />
408
+ # <%= submit_to_remote 'update_btn', 'Update', :url => { :action => 'update' },
409
+ # :update => { :success => "succeed", :failure => "fail" }
410
+ #
411
+ # <tt>options</tt> argument is the same as in form_remote_tag.
195
412
  def submit_to_remote(name, value, options = {})
196
413
  options[:with] ||= 'Form.serialize(this.form)'
197
414
 
@@ -204,7 +421,7 @@ module ActionView
204
421
  tag("input", options[:html], false)
205
422
  end
206
423
 
207
- # Returns 'eval(request.responseText)' which is the JavaScript function
424
+ # Returns '<tt>eval(request.responseText)</tt>' which is the JavaScript function
208
425
  # that form_remote_tag can call in :complete to evaluate a multiple
209
426
  # update return document using update_element_function calls.
210
427
  def evaluate_remote_response
@@ -215,6 +432,8 @@ module ActionView
215
432
  # Takes the same arguments as link_to_remote.
216
433
  #
217
434
  # Example:
435
+ # # Generates: <select id="options" onchange="new Ajax.Updater('options',
436
+ # # '/testing/update_options', {asynchronous:true, evalScripts:true})">
218
437
  # <select id="options" onchange="<%= remote_function(:update => "options",
219
438
  # :url => { :action => :update_options }) %>">
220
439
  # <option value="0">Hello</option>
@@ -255,11 +474,29 @@ module ActionView
255
474
  # Ajax call. By default the value of the observed field is sent as a
256
475
  # parameter with the Ajax call.
257
476
  #
477
+ # Example:
478
+ # # Generates: new Form.Element.Observer('suggest', 0.25, function(element, value) {new Ajax.Updater('suggest',
479
+ # # '/testing/find_suggestion', {asynchronous:true, evalScripts:true, parameters:'q=' + value})})
480
+ # <%= observe_field :suggest, :url => { :action => :find_suggestion },
481
+ # :frequency => 0.25,
482
+ # :update => :suggest,
483
+ # :with => 'q'
484
+ # %>
485
+ #
258
486
  # Required +options+ are either of:
259
487
  # <tt>:url</tt>:: +url_for+-style options for the action to call
260
488
  # when the field has changed.
261
489
  # <tt>:function</tt>:: Instead of making a remote call to a URL, you
262
- # can specify a function to be called instead.
490
+ # can specify javascript code to be called instead.
491
+ # Note that the value of this option is used as the
492
+ # *body* of the javascript function, a function definition
493
+ # with parameters named element and value will be generated for you
494
+ # for example:
495
+ # observe_field("glass", :frequency => 1, :function => "alert('Element changed')")
496
+ # will generate:
497
+ # new Form.Element.Observer('glass', 1, function(element, value) {alert('Element changed')})
498
+ # The element parameter is the DOM element being observed, and the value is its value at the
499
+ # time the observer is triggered.
263
500
  #
264
501
  # Additional options are:
265
502
  # <tt>:frequency</tt>:: The frequency (in seconds) at which changes to
@@ -294,8 +531,23 @@ module ActionView
294
531
  # you can specify it instead to be "blur" or "focus" or
295
532
  # any other event.
296
533
  #
297
- # Additionally, you may specify any of the options documented in
298
- # link_to_remote.
534
+ # Additionally, you may specify any of the options documented in the
535
+ # <em>Common options</em> section at the top of this document.
536
+ #
537
+ # Example:
538
+ #
539
+ # # Sends params: {:title => 'Title of the book'} when the book_title input
540
+ # # field is changed.
541
+ # observe_field 'book_title',
542
+ # :url => 'http://example.com/books/edit/1',
543
+ # :with => 'title'
544
+ #
545
+ # # Sends params: {:book_title => 'Title of the book'} when the focus leaves
546
+ # # the input field.
547
+ # observe_field 'book_title',
548
+ # :url => 'http://example.com/books/edit/1',
549
+ # :on => 'blur'
550
+ #
299
551
  def observe_field(field_id, options = {})
300
552
  if options[:frequency] && options[:frequency] > 0
301
553
  build_observer('Form.Element.Observer', field_id, options)
@@ -350,17 +602,16 @@ module ActionView
350
602
  #
351
603
  # Example:
352
604
  #
605
+ # # Generates:
606
+ # # new Insertion.Bottom("list", "<li>Some item</li>");
607
+ # # new Effect.Highlight("list");
608
+ # # ["status-indicator", "cancel-link"].each(Element.hide);
353
609
  # update_page do |page|
354
610
  # page.insert_html :bottom, 'list', "<li>#{@item.name}</li>"
355
611
  # page.visual_effect :highlight, 'list'
356
612
  # page.hide 'status-indicator', 'cancel-link'
357
613
  # end
358
614
  #
359
- # generates the following JavaScript:
360
- #
361
- # new Insertion.Bottom("list", "<li>Some item</li>");
362
- # new Effect.Highlight("list");
363
- # ["status-indicator", "cancel-link"].each(Element.hide);
364
615
  #
365
616
  # Helper methods can be used in conjunction with JavaScriptGenerator.
366
617
  # When a helper method is called inside an update block on the +page+
@@ -400,8 +651,19 @@ module ActionView
400
651
  # page['blank_slate'] # => $('blank_slate');
401
652
  # page['blank_slate'].show # => $('blank_slate').show();
402
653
  # page['blank_slate'].show('first').up # => $('blank_slate').show('first').up();
654
+ #
655
+ # You can also pass in a record, which will use ActionController::RecordIdentifier.dom_id to lookup
656
+ # the correct id:
657
+ #
658
+ # page[@post] # => $('post_45')
659
+ # page[Post.new] # => $('new_post')
403
660
  def [](id)
404
- JavaScriptElementProxy.new(self, id)
661
+ case id
662
+ when String, Symbol, NilClass
663
+ JavaScriptElementProxy.new(self, id)
664
+ else
665
+ JavaScriptElementProxy.new(self, ActionController::RecordIdentifier.dom_id(id))
666
+ end
405
667
  end
406
668
 
407
669
  # Returns an object whose <tt>#to_json</tt> evaluates to +code+. Use this to pass a literal JavaScript
@@ -419,18 +681,19 @@ module ActionView
419
681
  #
420
682
  # You can also use prototype enumerations with the collection. Observe:
421
683
  #
684
+ # # Generates: $$('#items li').each(function(value) { value.hide(); });
422
685
  # page.select('#items li').each do |value|
423
686
  # value.hide
424
687
  # end
425
- # # => $$('#items li').each(function(value) { value.hide(); });
426
688
  #
427
689
  # Though you can call the block param anything you want, they are always rendered in the
428
690
  # javascript as 'value, index.' Other enumerations, like collect() return the last statement:
429
- #
691
+ #
692
+ # # Generates: var hidden = $$('#items li').collect(function(value, index) { return value.hide(); });
430
693
  # page.select('#items li').collect('hidden') do |item|
431
694
  # item.hide
432
695
  # end
433
- # # => var hidden = $$('#items li').collect(function(value, index) { return value.hide(); });
696
+ #
434
697
  def select(pattern)
435
698
  JavaScriptElementCollectionProxy.new(self, pattern)
436
699
  end
@@ -444,7 +707,7 @@ module ActionView
444
707
  # element's existing content.
445
708
  # <tt>:bottom</tt>:: HTML is inserted inside the element, after the
446
709
  # element's existing content.
447
- # <tt>:before</tt>:: HTML is inserted immediately preceeding the element.
710
+ # <tt>:before</tt>:: HTML is inserted immediately preceding the element.
448
711
  # <tt>:after</tt>:: HTML is inserted immediately following the element.
449
712
  #
450
713
  # +options_for_render+ may be either a string of HTML to insert, or a hash
@@ -452,9 +715,11 @@ module ActionView
452
715
  #
453
716
  # # Insert the rendered 'navigation' partial just before the DOM
454
717
  # # element with ID 'content'.
718
+ # # Generates: new Insertion.Before("content", "-- Contents of 'navigation' partial --");
455
719
  # insert_html :before, 'content', :partial => 'navigation'
456
720
  #
457
721
  # # Add a list item to the bottom of the <ul> with ID 'list'.
722
+ # # Generates: new Insertion.Bottom("list", "<li>Last item</li>");
458
723
  # insert_html :bottom, 'list', '<li>Last item</li>'
459
724
  #
460
725
  def insert_html(position, id, *options_for_render)
@@ -469,6 +734,7 @@ module ActionView
469
734
  #
470
735
  # # Replace the HTML of the DOM element having ID 'person-45' with the
471
736
  # # 'person' partial for the appropriate object.
737
+ # # Generates: Element.update("person-45", "-- Contents of 'person' partial --");
472
738
  # replace_html 'person-45', :partial => 'person', :object => @person
473
739
  #
474
740
  def replace_html(id, *options_for_render)
@@ -496,9 +762,13 @@ module ActionView
496
762
  # </div>
497
763
  #
498
764
  # # Insert a new person
765
+ # #
766
+ # # Generates: new Insertion.Bottom({object: "Matz", partial: "person"}, "");
499
767
  # page.insert_html :bottom, :partial => 'person', :object => @person
500
768
  #
501
769
  # # Replace an existing person
770
+ #
771
+ # # Generates: Element.replace("person_45", "-- Contents of partial --");
502
772
  # page.replace 'person_45', :partial => 'person', :object => @person
503
773
  #
504
774
  def replace(id, *options_for_render)
@@ -506,31 +776,72 @@ module ActionView
506
776
  end
507
777
 
508
778
  # Removes the DOM elements with the given +ids+ from the page.
779
+ #
780
+ # Example:
781
+ #
782
+ # # Remove a few people
783
+ # # Generates: ["person_23", "person_9", "person_2"].each(Element.remove);
784
+ # page.remove 'person_23', 'person_9', 'person_2'
785
+ #
509
786
  def remove(*ids)
510
787
  loop_on_multiple_args 'Element.remove', ids
511
788
  end
512
789
 
513
790
  # Shows hidden DOM elements with the given +ids+.
791
+ #
792
+ # Example:
793
+ #
794
+ # # Show a few people
795
+ # # Generates: ["person_6", "person_13", "person_223"].each(Element.show);
796
+ # page.show 'person_6', 'person_13', 'person_223'
797
+ #
514
798
  def show(*ids)
515
799
  loop_on_multiple_args 'Element.show', ids
516
800
  end
517
801
 
518
802
  # Hides the visible DOM elements with the given +ids+.
803
+ #
804
+ # Example:
805
+ #
806
+ # # Hide a few people
807
+ # # Generates: ["person_29", "person_9", "person_0"].each(Element.hide);
808
+ # page.hide 'person_29', 'person_9', 'person_0'
809
+ #
519
810
  def hide(*ids)
520
811
  loop_on_multiple_args 'Element.hide', ids
521
812
  end
522
813
 
523
814
  # Toggles the visibility of the DOM elements with the given +ids+.
815
+ # Example:
816
+ #
817
+ # # Show a few people
818
+ # # Generates: ["person_14", "person_12", "person_23"].each(Element.toggle);
819
+ # page.toggle 'person_14', 'person_12', 'person_23' # Hides the elements
820
+ # page.toggle 'person_14', 'person_12', 'person_23' # Shows the previously hidden elements
821
+ #
524
822
  def toggle(*ids)
525
823
  loop_on_multiple_args 'Element.toggle', ids
526
824
  end
527
825
 
528
826
  # Displays an alert dialog with the given +message+.
827
+ #
828
+ # Example:
829
+ #
830
+ # # Generates: alert('This message is from Rails!')
831
+ # page.alert('This message is from Rails!')
529
832
  def alert(message)
530
833
  call 'alert', message
531
834
  end
532
835
 
533
- # Redirects the browser to the given +location+, in the same form as +url_for+.
836
+ # Redirects the browser to the given +location+ using JavaScript, in the same form as +url_for+.
837
+ #
838
+ # Examples:
839
+ #
840
+ # # Generates: window.location.href = "/mycontroller";
841
+ # page.redirect_to(:action => 'index')
842
+ #
843
+ # # Generates: window.location.href = "/account/signup";
844
+ # page.redirect_to(:controller => 'account', :action => 'signup')
534
845
  def redirect_to(location)
535
846
  assign 'window.location.href', @context.url_for(location)
536
847
  end
@@ -540,22 +851,52 @@ module ActionView
540
851
  # If a block is given, the block will be passed to a new JavaScriptGenerator;
541
852
  # the resulting JavaScript code will then be wrapped inside <tt>function() { ... }</tt>
542
853
  # and passed as the called function's final argument.
854
+ #
855
+ # Examples:
856
+ #
857
+ # # Generates: Element.replace(my_element, "My content to replace with.")
858
+ # page.call 'Element.replace', 'my_element', "My content to replace with."
859
+ #
860
+ # # Generates: alert('My message!')
861
+ # page.call 'alert', 'My message!'
862
+ #
543
863
  def call(function, *arguments, &block)
544
864
  record "#{function}(#{arguments_for_call(arguments, block)})"
545
865
  end
546
866
 
547
867
  # Assigns the JavaScript +variable+ the given +value+.
868
+ #
869
+ # Examples:
870
+ #
871
+ # # Generates: my_string = "This is mine!";
872
+ # page.assign 'my_string', 'This is mine!'
873
+ #
874
+ # # Generates: record_count = 33;
875
+ # page.assign 'record_count', 33
876
+ #
877
+ # # Generates: tabulated_total = 47
878
+ # page.assign 'tabulated_total', @total_from_cart
879
+ #
548
880
  def assign(variable, value)
549
881
  record "#{variable} = #{javascript_object_for(value)}"
550
882
  end
551
883
 
552
884
  # Writes raw JavaScript to the page.
885
+ #
886
+ # Example:
887
+ #
888
+ # page << "alert('JavaScript with Prototype.');"
553
889
  def <<(javascript)
554
890
  @lines << javascript
555
891
  end
556
892
 
557
893
  # Executes the content of the block after a delay of +seconds+. Example:
558
894
  #
895
+ # # Generates:
896
+ # # setTimeout(function() {
897
+ # # ;
898
+ # # new Effect.Fade("notice",{});
899
+ # # }, 20000);
559
900
  # page.delay(20) do
560
901
  # page.visual_effect :fade, 'notice'
561
902
  # end
@@ -609,9 +950,13 @@ module ActionView
609
950
  end
610
951
 
611
952
  def render(*options_for_render)
953
+ old_format = @context && @context.template_format
954
+ @context.template_format = :html if @context
612
955
  Hash === options_for_render.first ?
613
956
  @context.render(*options_for_render) :
614
957
  options_for_render.first.to_s
958
+ ensure
959
+ @context.template_format = old_format if @context
615
960
  end
616
961
 
617
962
  def javascript_object_for(object)
@@ -637,6 +982,12 @@ module ActionView
637
982
  # Yields a JavaScriptGenerator and returns the generated JavaScript code.
638
983
  # Use this to update multiple elements on a page in an Ajax response.
639
984
  # See JavaScriptGenerator for more information.
985
+ #
986
+ # Example:
987
+ #
988
+ # update_page do |page|
989
+ # page.hide 'spinner'
990
+ # end
640
991
  def update_page(&block)
641
992
  JavaScriptGenerator.new(@template, &block).to_s
642
993
  end
@@ -667,6 +1018,15 @@ module ActionView
667
1018
  elsif options[:with]
668
1019
  js_options['parameters'] = options[:with]
669
1020
  end
1021
+
1022
+ if protect_against_forgery?
1023
+ if js_options['parameters']
1024
+ js_options['parameters'] << " + '&"
1025
+ else
1026
+ js_options['parameters'] = "'"
1027
+ end
1028
+ js_options['parameters'] << "#{request_forgery_protection_token}=' + encodeURIComponent('#{escape_javascript form_authenticity_token}')"
1029
+ end
670
1030
 
671
1031
  options_for_javascript(js_options)
672
1032
  end
@@ -676,7 +1036,7 @@ module ActionView
676
1036
  end
677
1037
 
678
1038
  def build_observer(klass, name, options = {})
679
- if options[:with] && (options[:with] !~ /[=(.]/)
1039
+ if options[:with] && (options[:with] !~ /[\{=(.]/)
680
1040
  options[:with] = "'#{options[:with]}=' + value"
681
1041
  else
682
1042
  options[:with] ||= 'value' unless options[:function]
@@ -705,7 +1065,7 @@ module ActionView
705
1065
  end
706
1066
 
707
1067
  # Converts chained method calls on DOM proxy elements into JavaScript chains
708
- class JavaScriptProxy < Builder::BlankSlate #:nodoc:
1068
+ class JavaScriptProxy < BasicObject #:nodoc:
709
1069
  def initialize(generator, root = nil)
710
1070
  @generator = generator
711
1071
  @generator << root if root
@@ -787,7 +1147,7 @@ module ActionView
787
1147
  true
788
1148
  end
789
1149
 
790
- def to_json
1150
+ def to_json(options = nil)
791
1151
  @variable
792
1152
  end
793
1153
 
@@ -800,7 +1160,7 @@ module ActionView
800
1160
  end
801
1161
 
802
1162
  class JavaScriptCollectionProxy < JavaScriptProxy #:nodoc:
803
- ENUMERABLE_METHODS_WITH_RETURN = [:all, :any, :collect, :map, :detect, :find, :find_all, :select, :max, :min, :partition, :reject, :sort_by] unless defined? ENUMERABLE_METHODS_WITH_RETURN
1163
+ ENUMERABLE_METHODS_WITH_RETURN = [:all, :any, :collect, :map, :detect, :find, :find_all, :select, :max, :min, :partition, :reject, :sort_by, :in_groups_of, :each_slice] unless defined? ENUMERABLE_METHODS_WITH_RETURN
804
1164
  ENUMERABLE_METHODS = ENUMERABLE_METHODS_WITH_RETURN + [:each] unless defined? ENUMERABLE_METHODS
805
1165
  attr_reader :generator
806
1166
  delegate :arguments_for_call, :to => :generator
@@ -808,11 +1168,27 @@ module ActionView
808
1168
  def initialize(generator, pattern)
809
1169
  super(generator, @pattern = pattern)
810
1170
  end
811
-
1171
+
1172
+ def each_slice(variable, number, &block)
1173
+ if block
1174
+ enumerate :eachSlice, :variable => variable, :method_args => [number], :yield_args => %w(value index), :return => true, &block
1175
+ else
1176
+ add_variable_assignment!(variable)
1177
+ append_enumerable_function!("eachSlice(#{number.to_json});")
1178
+ end
1179
+ end
1180
+
812
1181
  def grep(variable, pattern, &block)
813
1182
  enumerate :grep, :variable => variable, :return => true, :method_args => [pattern], :yield_args => %w(value index), &block
814
1183
  end
815
-
1184
+
1185
+ def in_groups_of(variable, number, fill_with = nil)
1186
+ arguments = [number]
1187
+ arguments << fill_with unless fill_with.nil?
1188
+ add_variable_assignment!(variable)
1189
+ append_enumerable_function!("inGroupsOf(#{arguments_for_call arguments});")
1190
+ end
1191
+
816
1192
  def inject(variable, memo, &block)
817
1193
  enumerate :inject, :variable => variable, :method_args => [memo], :yield_args => %w(memo value index), :return => true, &block
818
1194
  end
@@ -860,7 +1236,7 @@ module ActionView
860
1236
  add_variable_assignment!(options[:variable]) if options[:variable]
861
1237
  append_enumerable_function!("#{enumerable.to_s.camelize(:lower)}(#{method_args}function(#{yield_args}) {")
862
1238
  # only yield as many params as were passed in the block
863
- yield *options[:yield_args].collect { |p| JavaScriptVariableProxy.new(@generator, p) }[0..block.arity-1]
1239
+ yield(*options[:yield_args].collect { |p| JavaScriptVariableProxy.new(@generator, p) }[0..block.arity-1])
864
1240
  add_return_statement! if options[:return]
865
1241
  @generator << '});'
866
1242
  end
@@ -889,4 +1265,4 @@ module ActionView
889
1265
  end
890
1266
  end
891
1267
 
892
- require File.dirname(__FILE__) + '/javascript_helper'
1268
+ require 'action_view/helpers/javascript_helper'