Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Upgrade to Rails 2.1.1.

  • Loading branch information...
commit 76e46a98ba55e416a4badf36c4696ed34a2fdc8d 1 parent 8982c5e
@jasoncheow jasoncheow authored
Showing with 5,613 additions and 2,877 deletions.
  1. +6 −6 config/boot.rb
  2. +1 −1  config/environment.rb
  3. +1 −1  public/javascripts/controls.js
  4. +1 −1  public/javascripts/dragdrop.js
  5. +1 −1  public/javascripts/effects.js
  6. +3 −0  script/dbconsole
  7. +15 −0 vendor/rails/.gitignore
  8. +5 −0 vendor/rails/actionmailer/CHANGELOG
  9. 0  vendor/rails/actionmailer/README
  10. +7 −4 vendor/rails/actionmailer/Rakefile
  11. 0  vendor/rails/actionmailer/lib/action_mailer.rb
  12. +2 −1  vendor/rails/actionmailer/lib/action_mailer/base.rb
  13. 0  vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb
  14. +1 −1  vendor/rails/actionmailer/lib/action_mailer/version.rb
  15. +13 −6 vendor/rails/actionmailer/test/abstract_unit.rb
  16. 0  vendor/rails/actionmailer/test/mail_service_test.rb
  17. +17 −0 vendor/rails/actionpack/CHANGELOG
  18. +10 −6 vendor/rails/actionpack/Rakefile
  19. 0  vendor/rails/actionpack/lib/action_controller.rb
  20. +1 −1  vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb
  21. +26 −46 vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb
  22. +8 −4 vendor/rails/actionpack/lib/action_controller/base.rb
  23. +1 −1  vendor/rails/actionpack/lib/action_controller/dispatcher.rb
  24. +194 −195 vendor/rails/actionpack/lib/action_controller/filters.rb
  25. +25 −12 vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb
  26. +20 −13 vendor/rails/actionpack/lib/action_controller/record_identifier.rb
  27. +9 −6 vendor/rails/actionpack/lib/action_controller/request.rb
  28. 0  vendor/rails/actionpack/lib/action_controller/request_profiler.rb
  29. 0  vendor/rails/actionpack/lib/action_controller/response.rb
  30. +5 −1 vendor/rails/actionpack/lib/action_controller/routing.rb
  31. +1 −2  vendor/rails/actionpack/lib/action_controller/routing/builder.rb
  32. +1 −1  vendor/rails/actionpack/lib/action_controller/routing/segments.rb
  33. +1 −1  vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb
  34. +4 −2 vendor/rails/actionpack/lib/action_controller/test_process.rb
  35. +1 −1  vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb
  36. +1 −1  vendor/rails/actionpack/lib/action_controller/verification.rb
  37. +1 −1  vendor/rails/actionpack/lib/action_pack/version.rb
  38. +7 −3 vendor/rails/actionpack/lib/action_view/base.rb
  39. +14 −11 vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb
  40. +3 −3 vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb
  41. +5 −1 vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb
  42. +2 −2 vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb
  43. +5 −3 vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb
  44. +4 −4 vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb
  45. +7 −7 vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb
  46. +4 −3 vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb
  47. +1 −1  vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb
  48. +3 −5 vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb
  49. +1 −1  vendor/rails/actionpack/lib/action_view/partial_template.rb
  50. +24 −5 vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb
  51. +6 −1 vendor/rails/actionpack/test/controller/assert_select_test.rb
  52. +37 −1 vendor/rails/actionpack/test/controller/base_test.rb
  53. 0  vendor/rails/actionpack/test/controller/cgi_test.rb
  54. +2 −2 vendor/rails/actionpack/test/controller/dispatcher_test.rb
  55. +25 −0 vendor/rails/actionpack/test/controller/html-scanner/document_test.rb
  56. +1 −1  vendor/rails/actionpack/test/controller/integration_upload_test.rb
  57. +22 −3 vendor/rails/actionpack/test/controller/new_render_test.rb
  58. +33 −0 vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb
  59. 0  vendor/rails/actionpack/test/controller/redirect_test.rb
  60. +1 −1  vendor/rails/actionpack/test/controller/render_test.rb
  61. +6 −0 vendor/rails/actionpack/test/controller/request_test.rb
  62. +15 −17 vendor/rails/actionpack/test/controller/resources_test.rb
  63. +22 −2 vendor/rails/actionpack/test/controller/routing_test.rb
  64. 0  vendor/rails/actionpack/test/controller/session/cookie_store_test.rb
  65. +11 −2 vendor/rails/actionpack/test/controller/test_test.rb
  66. +34 −17 vendor/rails/actionpack/test/controller/verification_test.rb
  67. +1 −0  vendor/rails/actionpack/test/fixtures/layout_tests/layouts/symlinked
  68. +1 −0  vendor/rails/actionpack/test/fixtures/test/render_file_from_template.html.erb
  69. +59 −8 vendor/rails/actionpack/test/template/date_helper_test.rb
  70. +9 −0 vendor/rails/actionpack/test/template/deprecated_erb_variable_test.rb
  71. +505 −514 vendor/rails/actionpack/test/template/form_options_helper_test.rb
  72. +13 −0 vendor/rails/actionpack/test/template/form_tag_helper_test.rb
  73. +7 −4 vendor/rails/actionpack/test/template/javascript_helper_test.rb
  74. +14 −6 vendor/rails/actionpack/test/template/prototype_helper_test.rb
  75. +1 −0  vendor/rails/actionpack/test/template/text_helper_test.rb
  76. +11 −1 vendor/rails/actionpack/test/template/url_helper_test.rb
  77. +12 −0 vendor/rails/activemodel/CHANGES
  78. +21 −0 vendor/rails/activemodel/README
  79. +16 −0 vendor/rails/activemodel/Rakefile
  80. +17 −0 vendor/rails/activemodel/lib/active_model.rb
  81. +4 −0 vendor/rails/activemodel/lib/active_model/base.rb
  82. +5 −0 vendor/rails/activemodel/lib/active_model/callbacks.rb
  83. +38 −0 vendor/rails/activemodel/lib/active_model/deprecated_error_methods.rb
  84. +80 −0 vendor/rails/activemodel/lib/active_model/errors.rb
  85. +100 −0 vendor/rails/activemodel/lib/active_model/observing.rb
  86. +124 −0 vendor/rails/activemodel/lib/active_model/validations.rb
  87. +45 −0 vendor/rails/activemodel/lib/active_model/validations/acceptance.rb
  88. +46 −0 vendor/rails/activemodel/lib/active_model/validations/associated.rb
  89. +44 −0 vendor/rails/activemodel/lib/active_model/validations/confirmation.rb
  90. +37 −0 vendor/rails/activemodel/lib/active_model/validations/exclusion.rb
  91. +39 −0 vendor/rails/activemodel/lib/active_model/validations/format.rb
  92. +37 −0 vendor/rails/activemodel/lib/active_model/validations/inclusion.rb
  93. +95 −0 vendor/rails/activemodel/lib/active_model/validations/length.rb
  94. +80 −0 vendor/rails/activemodel/lib/active_model/validations/numericality.rb
  95. +42 −0 vendor/rails/activemodel/lib/active_model/validations/presence.rb
  96. +104 −0 vendor/rails/activemodel/lib/active_model/validations/uniqueness.rb
  97. +120 −0 vendor/rails/activemodel/spec/observing_spec.rb
  98. +17 −0 vendor/rails/activemodel/spec/spec_helper.rb
  99. +34 −0 vendor/rails/activerecord/CHANGELOG
  100. +20 −0 vendor/rails/activerecord/MIT-LICENSE
  101. 0  vendor/rails/activerecord/README
  102. +6 −5 vendor/rails/activerecord/Rakefile
  103. +8 −10 vendor/rails/activerecord/lib/active_record.rb
  104. +17 −12 vendor/rails/activerecord/lib/active_record/association_preload.rb
  105. +45 −27 vendor/rails/activerecord/lib/active_record/associations.rb
  106. +8 −5 vendor/rails/activerecord/lib/active_record/associations/association_collection.rb
  107. +2 −6 vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb
  108. 0  vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb
  109. 0  vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
  110. +2 −3 vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
  111. +16 −4 vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb
  112. +1 −1  vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb
  113. +2 −2 vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb
  114. +4 −0 vendor/rails/activerecord/lib/active_record/associations/has_one_through_association.rb
  115. +33 −15 vendor/rails/activerecord/lib/active_record/base.rb
  116. +20 −7 vendor/rails/activerecord/lib/active_record/calculations.rb
  117. 0  vendor/rails/activerecord/lib/active_record/callbacks.rb
  118. +9 −6 vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
  119. +17 −10 vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
  120. 0  vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
  121. +53 −24 vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
  122. +66 −20 vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
  123. +12 −0 vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
  124. +10 −3 vendor/rails/activerecord/lib/active_record/dirty.rb
  125. 0  vendor/rails/activerecord/lib/active_record/fixtures.rb
  126. +1 −0  vendor/rails/activerecord/lib/active_record/locking/optimistic.rb
  127. +35 −8 vendor/rails/activerecord/lib/active_record/migration.rb
  128. +6 −1 vendor/rails/activerecord/lib/active_record/named_scope.rb
  129. +7 −5 vendor/rails/activerecord/lib/active_record/observer.rb
  130. +13 −2 vendor/rails/activerecord/lib/active_record/test_case.rb
  131. +19 −9 vendor/rails/activerecord/lib/active_record/validations.rb
  132. +0 −362 vendor/rails/activerecord/lib/active_record/vendor/db2.rb
  133. +1 −1  vendor/rails/activerecord/lib/active_record/version.rb
  134. +2 −2 vendor/rails/activerecord/test/cases/active_schema_test_postgresql.rb
  135. +1 −1  vendor/rails/activerecord/test/cases/adapter_test.rb
  136. +19 −0 vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb
  137. +13 −1 vendor/rails/activerecord/test/cases/associations/cascaded_eager_loading_test.rb
  138. +36 −0 vendor/rails/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb
  139. +25 −1 vendor/rails/activerecord/test/cases/associations/eager_test.rb
  140. +27 −5 vendor/rails/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
  141. +106 −4 vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb
  142. +10 −0 vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb
  143. +22 −0 vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb
  144. +44 −5 vendor/rails/activerecord/test/cases/associations/has_one_through_associations_test.rb
  145. +7 −0 vendor/rails/activerecord/test/cases/associations/join_model_test.rb
  146. +2 −2 vendor/rails/activerecord/test/cases/associations_test.rb
  147. +10 −10 vendor/rails/activerecord/test/cases/attribute_methods_test.rb
  148. +39 −16 vendor/rails/activerecord/test/cases/base_test.rb
  149. +53 −1 vendor/rails/activerecord/test/cases/calculations_test.rb
  150. +36 −0 vendor/rails/activerecord/test/cases/column_definition_test.rb
  151. +12 −0 vendor/rails/activerecord/test/cases/database_statements_test.rb
  152. +1 −1  vendor/rails/activerecord/test/cases/defaults_test.rb
  153. 0  vendor/rails/activerecord/test/cases/deprecated_finder_test.rb
  154. +94 −0 vendor/rails/activerecord/test/cases/dirty_test.rb
  155. +7 −0 vendor/rails/activerecord/test/cases/finder_test.rb
  156. 0  vendor/rails/activerecord/test/cases/fixtures_test.rb
  157. +5 −5 vendor/rails/activerecord/test/cases/helper.rb
  158. +9 −2 vendor/rails/activerecord/test/cases/inheritance_test.rb
  159. +54 −1 vendor/rails/activerecord/test/cases/lifecycle_test.rb
  160. +20 −0 vendor/rails/activerecord/test/cases/locking_test.rb
  161. +11 −1 vendor/rails/activerecord/test/cases/method_scoping_test.rb
  162. +147 −22 vendor/rails/activerecord/test/cases/migration_test.rb
  163. +1 −1  vendor/rails/activerecord/test/cases/multiple_db_test.rb
  164. +50 −1 vendor/rails/activerecord/test/cases/named_scope_test.rb
  165. +4 −3 vendor/rails/activerecord/test/cases/query_cache_test.rb
  166. 0  vendor/rails/activerecord/test/cases/readonly_test.rb
  167. +3 −3 vendor/rails/activerecord/test/cases/reflection_test.rb
  168. +46 −0 vendor/rails/activerecord/test/cases/schema_dumper_test.rb
  169. 0  vendor/rails/activerecord/test/cases/unconnected_test.rb
  170. +30 −5 vendor/rails/activerecord/test/cases/validations_test.rb
  171. +1 −0  vendor/rails/activerecord/test/fixtures/.gitignore
  172. +4 −0 vendor/rails/activerecord/test/models/author.rb
  173. +1 −0  vendor/rails/activerecord/test/models/category.rb
  174. +10 −1 vendor/rails/activerecord/test/models/company.rb
  175. +4 −1 vendor/rails/activerecord/test/models/developer.rb
  176. +1 −1  vendor/rails/activerecord/test/models/person.rb
  177. +6 −1 vendor/rails/activerecord/test/models/post.rb
  178. +1 −1  vendor/rails/activerecord/test/models/project.rb
  179. 0  vendor/rails/activerecord/test/models/reply.rb
  180. +1 −0  vendor/rails/activerecord/test/models/topic.rb
  181. +2 −2 vendor/rails/activerecord/test/schema/mysql_specific_schema.rb
  182. +8 −0 vendor/rails/activerecord/test/schema/schema.rb
  183. +5 −0 vendor/rails/activeresource/CHANGELOG
  184. +20 −0 vendor/rails/activeresource/MIT-LICENSE
  185. +7 −5 vendor/rails/activeresource/Rakefile
  186. +18 −6 vendor/rails/activeresource/lib/active_resource/base.rb
  187. +18 −7 vendor/rails/activeresource/lib/active_resource/connection.rb
  188. +10 −9 vendor/rails/activeresource/lib/active_resource/custom_methods.rb
  189. +6 −6 vendor/rails/activeresource/lib/active_resource/formats/json_format.rb
  190. +9 −9 vendor/rails/activeresource/lib/active_resource/formats/xml_format.rb
  191. +1 −1  vendor/rails/activeresource/lib/active_resource/http_mock.rb
  192. +1 −1  vendor/rails/activeresource/lib/active_resource/version.rb
  193. +13 −9 vendor/rails/activeresource/test/abstract_unit.rb
  194. +1 −2  vendor/rails/activeresource/test/base/custom_methods_test.rb
  195. +59 −2 vendor/rails/activeresource/test/base_test.rb
  196. +3 −0  vendor/rails/activeresource/test/fixtures/customer.rb
  197. +23 −11 vendor/rails/activeresource/test/format_test.rb
  198. +13 −1 vendor/rails/activesupport/CHANGELOG
  199. +20 −0 vendor/rails/activesupport/MIT-LICENSE
  200. +176 −0 vendor/rails/activesupport/Rakefile
  201. +30 −0 vendor/rails/activesupport/install.rb
  202. +6 −0 vendor/rails/activesupport/lib/active_support.rb
  203. +3 −1 vendor/rails/activesupport/lib/active_support/cache.rb
  204. +4 −4 vendor/rails/activesupport/lib/active_support/cache/compressed_mem_cache_store.rb
  205. +26 −0 vendor/rails/activesupport/lib/active_support/core_ext/date/behavior.rb
  206. +1 −1  vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb
  207. +4 −3 vendor/rails/activesupport/lib/active_support/core_ext/hash/except.rb
  208. +3 −1 vendor/rails/activesupport/lib/active_support/core_ext/hash/slice.rb
  209. +5 −0 vendor/rails/activesupport/lib/active_support/core_ext/module.rb
  210. +22 −0 vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb
  211. +9 −8 vendor/rails/activesupport/lib/active_support/core_ext/object/extending.rb
  212. +2 −2 vendor/rails/activesupport/lib/active_support/core_ext/range/blockless_step.rb
  213. +35 −0 vendor/rails/activesupport/lib/active_support/core_ext/rexml.rb
  214. +11 −13 vendor/rails/activesupport/lib/active_support/core_ext/string/unicode.rb
  215. +22 −1 vendor/rails/activesupport/lib/active_support/core_ext/time.rb
  216. +393 −392 vendor/rails/activesupport/lib/active_support/dependencies.rb
  217. +27 −9 vendor/rails/activesupport/lib/active_support/deprecation.rb
  218. +51 −49 vendor/rails/activesupport/lib/active_support/inflections.rb
  219. +267 −262 vendor/rails/activesupport/lib/active_support/inflector.rb
  220. +1 −1  vendor/rails/activesupport/lib/active_support/json/encoders/date_time.rb
  221. +14 −12 vendor/rails/activesupport/lib/active_support/ordered_options.rb
  222. +11 −0 vendor/rails/activesupport/lib/active_support/string_inquirer.rb
  223. +34 −13 vendor/rails/activesupport/lib/active_support/time_with_zone.rb
  224. +348 −346 vendor/rails/activesupport/lib/active_support/values/time_zone.rb
  225. +2 −2 vendor/rails/activesupport/lib/active_support/vendor.rb
  226. +0 −95 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/offset_rationals.rb
  227. 0  vendor/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo.rb
  228. 0  ...or/rails/activesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/data_timezone.rb
  229. +2 −0  ...ils/activesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/data_timezone_info.rb
  230. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Algiers.rb
  231. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Cairo.rb
  232. +2 −0  ...upport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Casablanca.rb
  233. 0  ...ivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Harare.rb
  234. 0  ...port/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Johannesburg.rb
  235. 0  ...esupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Monrovia.rb
  236. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Africa/Nairobi.rb
  237. 0  ...tive_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Argentina/Buenos_Aires.rb
  238. 0  ...b/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Argentina/San_Juan.rb
  239. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Bogota.rb
  240. 0  ...esupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Caracas.rb
  241. 0  ...esupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Chicago.rb
  242. 0  ...upport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Chihuahua.rb
  243. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Denver.rb
  244. 0  ...esupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Godthab.rb
  245. 0  ...upport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Guatemala.rb
  246. 0  ...esupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Halifax.rb
  247. 0  ...active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Indiana/Indianapolis.rb
  248. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Juneau.rb
  249. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/La_Paz.rb
  250. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Lima.rb
  251. 0  ...port/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Los_Angeles.rb
  252. 0  ...support/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Mazatlan.rb
  253. 0  ...port/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Mexico_City.rb
  254. 0  ...upport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Monterrey.rb
  255. 0  ...support/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/New_York.rb
  256. 0  ...esupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Phoenix.rb
  257. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Regina.rb
  258. 0  ...support/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Santiago.rb
  259. 0  ...support/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/St_Johns.rb
  260. 0  ...esupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/America/Tijuana.rb
  261. 0  ...ctivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Almaty.rb
  262. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Baghdad.rb
  263. 0  .../activesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Baku.rb
  264. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Bangkok.rb
  265. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Chongqing.rb
  266. 0  ...activesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Dhaka.rb
  267. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Hong_Kong.rb
  268. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Irkutsk.rb
  269. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Jakarta.rb
  270. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Jerusalem.rb
  271. 0  ...activesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kabul.rb
  272. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kamchatka.rb
  273. +2 −0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Karachi.rb
  274. 0  ...ivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Katmandu.rb
  275. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kolkata.rb
  276. 0  ...support/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Krasnoyarsk.rb
  277. 0  ...upport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kuala_Lumpur.rb
  278. 0  ...ctivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Kuwait.rb
  279. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Magadan.rb
  280. 0  ...ctivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Muscat.rb
  281. 0  ...support/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Novosibirsk.rb
  282. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Rangoon.rb
  283. 0  ...ctivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Riyadh.rb
  284. 0  ...activesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Seoul.rb
  285. 0  ...ivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Shanghai.rb
  286. 0  ...vesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Singapore.rb
  287. 0  ...ctivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Taipei.rb
  288. 0  ...ivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Tashkent.rb
  289. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Tbilisi.rb
  290. 0  ...ctivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Tehran.rb
  291. 0  ...activesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Tokyo.rb
  292. 0  ...support/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Ulaanbaatar.rb
  293. 0  ...ctivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Urumqi.rb
  294. 0  ...support/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Vladivostok.rb
  295. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Yakutsk.rb
  296. 0  ...pport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Yekaterinburg.rb
  297. 0  ...tivesupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Asia/Yerevan.rb
  298. 0  ...esupport/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Atlantic/Azores.rb
  299. 0  ...port/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Atlantic/Cape_Verde.rb
  300. 0  ...t/lib/active_support/vendor/{tzinfo-0.3.8 → tzinfo-0.3.9}/tzinfo/definitions/Atlantic/South_Georgia.rb
Sorry, we could not display the entire diff because too many files (587) changed.
View
12 config/boot.rb
@@ -24,9 +24,8 @@ def vendor_rails?
File.exist?("#{RAILS_ROOT}/vendor/rails")
end
- # FIXME : Ruby 1.9
def preinitialize
- load(preinitializer_path) if File.exists?(preinitializer_path)
+ load(preinitializer_path) if File.exist?(preinitializer_path)
end
def preinitializer_path
@@ -44,6 +43,7 @@ def run
class VendorBoot < Boot
def load_initializer
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
+ Rails::Initializer.run(:install_gem_spec_stubs)
end
end
@@ -82,14 +82,14 @@ def gem_version
def load_rubygems
require 'rubygems'
-
- unless rubygems_version >= '0.9.4'
- $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
+ min_version = '1.1.1'
+ unless rubygems_version >= min_version
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
exit 1
end
rescue LoadError
- $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
exit 1
end
View
2  config/environment.rb
@@ -5,7 +5,7 @@
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.1.1' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
View
2  public/javascripts/controls.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
// (c) 2005-2007 Jon Tirsen (http://www.tirsen.com)
// Contributors:
View
2  public/javascripts/dragdrop.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
View
2  public/javascripts/effects.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
// Justin Palmer (http://encytemedia.com/)
// Mark Pilgrim (http://diveintomark.org/)
View
3  script/dbconsole
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/dbconsole'
View
15 vendor/rails/.gitignore
@@ -0,0 +1,15 @@
+debug.log
+doc/rdoc
+activeresource/doc
+activerecord/doc
+actionpack/doc
+actionmailer/doc
+activesupport/doc
+railties/doc
+activeresource/pkg
+activerecord/pkg
+actionpack/pkg
+actionmailer/pkg
+activesupport/pkg
+railties/pkg
+*.rbc
View
5 vendor/rails/actionmailer/CHANGELOG
@@ -1,3 +1,8 @@
+*2.1.1 (September 4th, 2008)*
+
+* Included in Rails 2.1.1
+
+
*2.1.0 (May 31st, 2008)*
* Fixed that a return-path header would be ignored #7572 [joost]
View
0  vendor/rails/actionmailer/README 100644 → 100755
File mode changed
View
11 vendor/rails/actionmailer/Rakefile 100644 → 100755
@@ -5,6 +5,8 @@ require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/contrib/sshpublisher'
+require 'rake/contrib/rubyforgepublisher'
+
require File.join(File.dirname(__FILE__), 'lib', 'action_mailer', 'version')
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -35,7 +37,7 @@ Rake::RDocTask.new { |rdoc|
rdoc.title = "Action Mailer -- Easy email delivery and testing"
rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
rdoc.options << '--charset' << 'utf-8'
- rdoc.template = "#{ENV['template']}.rb" if ENV['template']
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
rdoc.rdoc_files.include('README', 'CHANGELOG')
rdoc.rdoc_files.include('lib/action_mailer.rb')
rdoc.rdoc_files.include('lib/action_mailer/*.rb')
@@ -55,7 +57,7 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "actionmailer"
s.homepage = "http://www.rubyonrails.org"
- s.add_dependency('actionpack', '= 2.1.0' + PKG_BUILD)
+ s.add_dependency('actionpack', '= 2.1.1' + PKG_BUILD)
s.has_rdoc = true
s.requirements << 'none'
@@ -76,12 +78,13 @@ end
desc "Publish the API documentation"
task :pgem => [:package] do
- Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
+ Rake::SshFilePublisher.new("david@greed.loudthinking.com", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
+ `ssh david@greed.loudthinking.com '/u/sites/gems/gemupdate.sh'`
end
desc "Publish the API documentation"
task :pdoc => [:rdoc] do
- Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/am", "doc").upload
+ Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload
end
desc "Publish the release files to RubyForge."
View
0  vendor/rails/actionmailer/lib/action_mailer.rb 100644 → 100755
File mode changed
View
3  vendor/rails/actionmailer/lib/action_mailer/base.rb
@@ -530,7 +530,7 @@ def initialize_defaults(method_name)
end
def render_message(method_name, body)
- render :file => method_name, :body => body
+ render :file => method_name, :body => body, :use_full_path => true
end
def render(opts)
@@ -538,6 +538,7 @@ def render(opts)
if opts[:file] && opts[:file] !~ /\//
opts[:file] = "#{mailer_name}/#{opts[:file]}"
end
+ opts[:use_full_path] = true
initialize_template_class(body).render(opts)
end
View
0  vendor/rails/actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb 100644 → 100755
File mode changed
View
2  vendor/rails/actionmailer/lib/action_mailer/version.rb
@@ -2,7 +2,7 @@ module ActionMailer
module VERSION #:nodoc:
MAJOR = 2
MINOR = 1
- TINY = 0
+ TINY = 1
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
19 vendor/rails/actionmailer/test/abstract_unit.rb
@@ -30,13 +30,20 @@ def self.start(*args)
end
end
-# Wrap tests that use Mocha and skip if unavailable.
-def uses_mocha(test_name)
- gem 'mocha', ">=0.5"
- require 'stubba'
+def uses_gem(gem_name, test_name, version = '> 0')
+ require 'rubygems'
+ gem gem_name.to_s, version
+ require gem_name.to_s
yield
-rescue Gem::LoadError
- $stderr.puts "Skipping #{test_name} tests (Mocha >= 0.5 is required). `gem install mocha` and try again."
+rescue LoadError
+ $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again."
+end
+
+# Wrap tests that use Mocha and skip if unavailable.
+unless defined? uses_mocha
+ def uses_mocha(test_name, &block)
+ uses_gem('mocha', test_name, '>= 0.5.5', &block)
+ end
end
def set_delivery_method(delivery_method)
View
0  vendor/rails/actionmailer/test/mail_service_test.rb 100644 → 100755
File mode changed
View
17 vendor/rails/actionpack/CHANGELOG
@@ -1,3 +1,20 @@
+*2.1.1 (September 4th, 2008)*
+
+* All 2xx requests are considered successful [Josh Peek]
+
+* Deprecate the limited follow_redirect in functional tests. If you wish to follow redirects, use integration tests. [Michael Koziarski]
+
+* Fixed that AssetTagHelper#compute_public_path shouldn't cache the asset_host along with the source or per-request proc's won't run [DHH]
+
+* Deprecate define_javascript_functions, javascript_include_tag and friends are much better [Michael Koziarski]
+
+* Fix polymorphic_url with singleton resources. #461 [Tammer Saleh]
+
+* Deprecate ActionView::Base.erb_variable. Use the concat helper method instead of appending to it directly. [Jeremy Kemper]
+
+* Fixed Request#remote_ip to only raise hell if the HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR doesn't match (not just if they're both present) [Mark Imbriaco, Bradford Folkens]
+
+
*2.1.0 (May 31st, 2008)*
* InstanceTag#default_time_from_options overflows to DateTime [Geoff Buesing]
View
16 vendor/rails/actionpack/Rakefile
@@ -5,6 +5,8 @@ require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/contrib/sshpublisher'
+require 'rake/contrib/rubyforgepublisher'
+
require File.join(File.dirname(__FILE__), 'lib', 'action_pack', 'version')
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
@@ -49,12 +51,14 @@ Rake::RDocTask.new { |rdoc|
rdoc.title = "Action Pack -- On rails from request to response"
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.options << '--charset' << 'utf-8'
- rdoc.template = "#{ENV['template']}.rb" if ENV['template']
+ rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
if ENV['DOC_FILES']
rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
else
rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG')
- rdoc.rdoc_files.include('lib/**/*.rb')
+ rdoc.rdoc_files.include(Dir['lib/**/*.rb'] -
+ Dir['lib/*/vendor/**/*.rb'])
+ rdoc.rdoc_files.exclude('lib/actionpack.rb')
end
}
@@ -76,7 +80,7 @@ spec = Gem::Specification.new do |s|
s.has_rdoc = true
s.requirements << 'none'
- s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.1.1' + PKG_BUILD)
s.require_path = 'lib'
s.autorequire = 'action_controller'
@@ -132,13 +136,13 @@ task :update_js => [ :update_scriptaculous ]
desc "Publish the API documentation"
task :pgem => [:package] do
- Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
- `ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
+ Rake::SshFilePublisher.new("david@greed.loudthinking.com", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
+ `ssh david@greed.loudthinking.com '/u/sites/gems/gemupdate.sh'`
end
desc "Publish the API documentation"
task :pdoc => [:rdoc] do
- Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/ap", "doc").upload
+ Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ap", "doc").upload
end
desc "Publish the release files to RubyForge."
View
0  vendor/rails/actionpack/lib/action_controller.rb 100644 → 100755
File mode changed
View
2  vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb
@@ -97,7 +97,7 @@ def assert_redirected_to(options = {}, message=nil)
value['controller'] = value['controller'].to_s
if key == :actual && value['controller'].first != '/' && !value['controller'].include?('/')
new_controller_path = ActionController::Routing.controller_relative_to(value['controller'], @controller.class.controller_path)
- value['controller'] = new_controller_path if value['controller'] != new_controller_path && ActionController::Routing.possible_controllers.include?(new_controller_path)
+ value['controller'] = new_controller_path if value['controller'] != new_controller_path && ActionController::Routing.possible_controllers.include?(new_controller_path) && @response.redirected_to.is_a?(Hash)
end
value['controller'] = value['controller'][1..-1] if value['controller'].first == '/' # strip leading hash
end
View
72 vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb
@@ -398,47 +398,31 @@ def count_description(min, max) #:nodoc:
# # The same, but shorter.
# assert_select "ol>li", 4
def assert_select_rjs(*args, &block)
- rjs_type = nil
- arg = args.shift
+ rjs_type = args.first.is_a?(Symbol) ? args.shift : nil
+ id = args.first.is_a?(String) ? args.shift : nil
# If the first argument is a symbol, it's the type of RJS statement we're looking
# for (update, replace, insertion, etc). Otherwise, we're looking for just about
# any RJS statement.
- if arg.is_a?(Symbol)
- rjs_type = arg
-
+ if rjs_type
if rjs_type == :insert
- arg = args.shift
- insertion = "insert_#{arg}".to_sym
- raise ArgumentError, "Unknown RJS insertion type #{arg}" unless RJS_STATEMENTS[insertion]
+ position = args.shift
+ insertion = "insert_#{position}".to_sym
+ raise ArgumentError, "Unknown RJS insertion type #{position}" unless RJS_STATEMENTS[insertion]
statement = "(#{RJS_STATEMENTS[insertion]})"
else
raise ArgumentError, "Unknown RJS statement type #{rjs_type}" unless RJS_STATEMENTS[rjs_type]
statement = "(#{RJS_STATEMENTS[rjs_type]})"
end
- arg = args.shift
else
statement = "#{RJS_STATEMENTS[:any]}"
end
# Next argument we're looking for is the element identifier. If missing, we pick
- # any element.
- if arg.is_a?(String)
- id = Regexp.quote(arg)
- arg = args.shift
- else
- id = "[^\"]*"
- end
-
- pattern =
- case rjs_type
- when :chained_replace, :chained_replace_html
- Regexp.new("\\$\\(\"#{id}\"\\)#{statement}\\(#{RJS_PATTERN_HTML}\\)", Regexp::MULTILINE)
- when :remove, :show, :hide, :toggle
- Regexp.new("#{statement}\\(\"#{id}\"\\)")
- else
- Regexp.new("#{statement}\\(\"#{id}\", #{RJS_PATTERN_HTML}\\)", Regexp::MULTILINE)
- end
+ # any element, otherwise we replace it in the statement.
+ pattern = Regexp.new(
+ id ? statement.gsub(RJS_ANY_ID, "\"#{id}\"") : statement
+ )
# Duplicate the body since the next step involves destroying it.
matches = nil
@@ -447,7 +431,7 @@ def assert_select_rjs(*args, &block)
matches = @response.body.match(pattern)
else
@response.body.gsub(pattern) do |match|
- html = unescape_rjs($2)
+ html = unescape_rjs(match)
matches ||= []
matches.concat HTML::Document.new(html).root.children.select { |n| n.tag? }
""
@@ -577,27 +561,23 @@ def assert_select_email(&block)
protected
unless const_defined?(:RJS_STATEMENTS)
- RJS_STATEMENTS = {
- :replace => /Element\.replace/,
- :replace_html => /Element\.update/,
- :chained_replace => /\.replace/,
- :chained_replace_html => /\.update/,
- :remove => /Element\.remove/,
- :show => /Element\.show/,
- :hide => /Element\.hide/,
- :toggle => /Element\.toggle/
+ RJS_PATTERN_HTML = "\"((\\\\\"|[^\"])*)\""
+ RJS_ANY_ID = "\"([^\"])*\""
+ RJS_STATEMENTS = {
+ :chained_replace => "\\$\\(#{RJS_ANY_ID}\\)\\.replace\\(#{RJS_PATTERN_HTML}\\)",
+ :chained_replace_html => "\\$\\(#{RJS_ANY_ID}\\)\\.update\\(#{RJS_PATTERN_HTML}\\)",
+ :replace_html => "Element\\.update\\(#{RJS_ANY_ID}, #{RJS_PATTERN_HTML}\\)",
+ :replace => "Element\\.replace\\(#{RJS_ANY_ID}, #{RJS_PATTERN_HTML}\\)"
}
- RJS_INSERTIONS = [:top, :bottom, :before, :after]
+ [:remove, :show, :hide, :toggle].each do |action|
+ RJS_STATEMENTS[action] = "Element\\.#{action}\\(#{RJS_ANY_ID}\\)"
+ end
+ RJS_INSERTIONS = ["top", "bottom", "before", "after"]
RJS_INSERTIONS.each do |insertion|
- RJS_STATEMENTS["insert_#{insertion}".to_sym] = Regexp.new(Regexp.quote("new Insertion.#{insertion.to_s.camelize}"))
+ RJS_STATEMENTS["insert_#{insertion}".to_sym] = "Element.insert\\(#{RJS_ANY_ID}, \\{ #{insertion}: #{RJS_PATTERN_HTML} \\}\\)"
end
+ RJS_STATEMENTS[:insert_html] = "Element.insert\\(#{RJS_ANY_ID}, \\{ (#{RJS_INSERTIONS.join('|')}): #{RJS_PATTERN_HTML} \\}\\)"
RJS_STATEMENTS[:any] = Regexp.new("(#{RJS_STATEMENTS.values.join('|')})")
- RJS_STATEMENTS[:insert_html] = Regexp.new(RJS_INSERTIONS.collect do |insertion|
- Regexp.quote("new Insertion.#{insertion.to_s.camelize}")
- end.join('|'))
- RJS_PATTERN_HTML = /"((\\"|[^"])*)"/
- RJS_PATTERN_EVERYTHING = Regexp.new("#{RJS_STATEMENTS[:any]}\\(\"([^\"]*)\", #{RJS_PATTERN_HTML}\\)",
- Regexp::MULTILINE)
RJS_PATTERN_UNICODE_ESCAPED_CHAR = /\\u([0-9a-zA-Z]{4})/
end
@@ -611,8 +591,8 @@ def response_from_page_or_rjs()
root = HTML::Node.new(nil)
while true
- next if body.sub!(RJS_PATTERN_EVERYTHING) do |match|
- html = unescape_rjs($3)
+ next if body.sub!(RJS_STATEMENTS[:any]) do |match|
+ html = unescape_rjs(match)
matches = HTML::Document.new(html).root.children.select { |n| n.tag? }
root.children.concat matches
""
View
12 vendor/rails/actionpack/lib/action_controller/base.rb 100644 → 100755
@@ -613,8 +613,9 @@ def process(request, response, method = :perform_action, *arguments) #:nodoc:
#
# This takes the current URL as is and only exchanges the action. In contrast, <tt>url_for :action => 'print'</tt>
# would have slashed-off the path components after the changed action.
- def url_for(options = nil) #:doc:
- case options || {}
+ def url_for(options = {})
+ options ||= {}
+ case options
when String
options
when Hash
@@ -743,6 +744,9 @@ def append_view_path(path)
# # Renders the template located in [TEMPLATE_ROOT]/weblog/show.r(html|xml) (in Rails, app/views/weblog/show.erb)
# render :template => "weblog/show"
#
+ # # Renders the template with a local variable
+ # render :template => "weblog/show", :locals => {:customer => Customer.new}
+ #
# === Rendering a file
#
# File rendering works just like action rendering except that it takes a filesystem path. By default, the path
@@ -865,7 +869,7 @@ def render(options = nil, extra_options = {}, &block) #:doc:
render_for_file(file, options[:status], options[:use_full_path], options[:locals] || {})
elsif template = options[:template]
- render_for_file(template, options[:status], true)
+ render_for_file(template, options[:status], true, options[:locals] || {})
elsif inline = options[:inline]
add_variables_to_assigns
@@ -1147,7 +1151,7 @@ def initialize_current_url
def log_processing
if logger && logger.info?
- logger.info "\n\nProcessing #{controller_class_name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]"
+ logger.info "\n\nProcessing #{self.class.name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]"
logger.info " Session ID: #{@_session.session_id}" if @_session and @_session.respond_to?(:session_id)
logger.info " Parameters: #{respond_to?(:filter_parameters) ? filter_parameters(params).inspect : params.inspect}"
end
View
2  vendor/rails/actionpack/lib/action_controller/dispatcher.rb
@@ -135,7 +135,7 @@ def reload_application
# be reloaded on the next request without restarting the server.
def cleanup_application
ActiveRecord::Base.reset_subclasses if defined?(ActiveRecord)
- Dependencies.clear
+ ActiveSupport::Dependencies.clear
ActiveRecord::Base.clear_reloadable_connections! if defined?(ActiveRecord)
end
View
389 vendor/rails/actionpack/lib/action_controller/filters.rb
@@ -7,6 +7,200 @@ def self.included(base)
end
end
+ class FilterChain < ActiveSupport::Callbacks::CallbackChain #:nodoc:
+ def append_filter_to_chain(filters, filter_type, &block)
+ pos = find_filter_append_position(filters, filter_type)
+ update_filter_chain(filters, filter_type, pos, &block)
+ end
+
+ def prepend_filter_to_chain(filters, filter_type, &block)
+ pos = find_filter_prepend_position(filters, filter_type)
+ update_filter_chain(filters, filter_type, pos, &block)
+ end
+
+ def create_filters(filters, filter_type, &block)
+ filters, conditions = extract_options(filters, &block)
+ filters.map! { |filter| find_or_create_filter(filter, filter_type, conditions) }
+ filters
+ end
+
+ def skip_filter_in_chain(*filters, &test)
+ filters, conditions = extract_options(filters)
+ filters.each do |filter|
+ if callback = find(filter) then delete(callback) end
+ end if conditions.empty?
+ update_filter_in_chain(filters, :skip => conditions, &test)
+ end
+
+ private
+ def update_filter_chain(filters, filter_type, pos, &block)
+ new_filters = create_filters(filters, filter_type, &block)
+ insert(pos, new_filters).flatten!
+ end
+
+ def find_filter_append_position(filters, filter_type)
+ # appending an after filter puts it at the end of the call chain
+ # before and around filters go before the first after filter in the chain
+ unless filter_type == :after
+ each_with_index do |f,i|
+ return i if f.after?
+ end
+ end
+ return -1
+ end
+
+ def find_filter_prepend_position(filters, filter_type)
+ # prepending a before or around filter puts it at the front of the call chain
+ # after filters go before the first after filter in the chain
+ if filter_type == :after
+ each_with_index do |f,i|
+ return i if f.after?
+ end
+ return -1
+ end
+ return 0
+ end
+
+ def find_or_create_filter(filter, filter_type, options = {})
+ update_filter_in_chain([filter], options)
+
+ if found_filter = find(filter) { |f| f.type == filter_type }
+ found_filter
+ else
+ filter_kind = case
+ when filter.respond_to?(:before) && filter_type == :before
+ :before
+ when filter.respond_to?(:after) && filter_type == :after
+ :after
+ else
+ :filter
+ end
+
+ case filter_type
+ when :before
+ BeforeFilter.new(filter_kind, filter, options)
+ when :after
+ AfterFilter.new(filter_kind, filter, options)
+ else
+ AroundFilter.new(filter_kind, filter, options)
+ end
+ end
+ end
+
+ def update_filter_in_chain(filters, options, &test)
+ filters.map! { |f| block_given? ? find(f, &test) : find(f) }
+ filters.compact!
+
+ map! do |filter|
+ if filters.include?(filter)
+ new_filter = filter.dup
+ new_filter.options.merge!(options)
+ new_filter
+ else
+ filter
+ end
+ end
+ end
+ end
+
+ class Filter < ActiveSupport::Callbacks::Callback #:nodoc:
+ def before?
+ self.class == BeforeFilter
+ end
+
+ def after?
+ self.class == AfterFilter
+ end
+
+ def around?
+ self.class == AroundFilter
+ end
+
+ private
+ def should_not_skip?(controller)
+ if options[:skip]
+ !included_in_action?(controller, options[:skip])
+ else
+ true
+ end
+ end
+
+ def included_in_action?(controller, options)
+ if options[:only]
+ Array(options[:only]).map(&:to_s).include?(controller.action_name)
+ elsif options[:except]
+ !Array(options[:except]).map(&:to_s).include?(controller.action_name)
+ else
+ true
+ end
+ end
+
+ def should_run_callback?(controller)
+ should_not_skip?(controller) && included_in_action?(controller, options) && super
+ end
+ end
+
+ class AroundFilter < Filter #:nodoc:
+ def type
+ :around
+ end
+
+ def call(controller, &block)
+ if should_run_callback?(controller)
+ method = filter_responds_to_before_and_after? ? around_proc : self.method
+
+ # For around_filter do |controller, action|
+ if method.is_a?(Proc) && method.arity == 2
+ evaluate_method(method, controller, block)
+ else
+ evaluate_method(method, controller, &block)
+ end
+ else
+ block.call
+ end
+ end
+
+ private
+ def filter_responds_to_before_and_after?
+ method.respond_to?(:before) && method.respond_to?(:after)
+ end
+
+ def around_proc
+ Proc.new do |controller, action|
+ method.before(controller)
+
+ if controller.send!(:performed?)
+ controller.send!(:halt_filter_chain, method, :rendered_or_redirected)
+ else
+ begin
+ action.call
+ ensure
+ method.after(controller)
+ end
+ end
+ end
+ end
+ end
+
+ class BeforeFilter < Filter #:nodoc:
+ def type
+ :before
+ end
+
+ def call(controller, &block)
+ super
+ if controller.send!(:performed?)
+ controller.send!(:halt_filter_chain, method, :rendered_or_redirected)
+ end
+ end
+ end
+
+ class AfterFilter < Filter #:nodoc:
+ def type
+ :after
+ end
+ end
+
# Filters enable controllers to run shared pre- and post-processing code for its actions. These filters can be used to do
# authentication, caching, or auditing before the intended action is performed. Or to do localization or output
# compression after the action has been performed. Filters have access to the request, response, and all the instance
@@ -245,201 +439,6 @@ def self.included(base)
# filter and controller action will not be run. If +before+ renders or redirects,
# the second half of +around+ and will still run but +after+ and the
# action will not. If +around+ fails to yield, +after+ will not be run.
-
- class FilterChain < ActiveSupport::Callbacks::CallbackChain #:nodoc:
- def append_filter_to_chain(filters, filter_type, &block)
- pos = find_filter_append_position(filters, filter_type)
- update_filter_chain(filters, filter_type, pos, &block)
- end
-
- def prepend_filter_to_chain(filters, filter_type, &block)
- pos = find_filter_prepend_position(filters, filter_type)
- update_filter_chain(filters, filter_type, pos, &block)
- end
-
- def create_filters(filters, filter_type, &block)
- filters, conditions = extract_options(filters, &block)
- filters.map! { |filter| find_or_create_filter(filter, filter_type, conditions) }
- filters
- end
-
- def skip_filter_in_chain(*filters, &test)
- filters, conditions = extract_options(filters)
- filters.each do |filter|
- if callback = find(filter) then delete(callback) end
- end if conditions.empty?
- update_filter_in_chain(filters, :skip => conditions, &test)
- end
-
- private
- def update_filter_chain(filters, filter_type, pos, &block)
- new_filters = create_filters(filters, filter_type, &block)
- insert(pos, new_filters).flatten!
- end
-
- def find_filter_append_position(filters, filter_type)
- # appending an after filter puts it at the end of the call chain
- # before and around filters go before the first after filter in the chain
- unless filter_type == :after
- each_with_index do |f,i|
- return i if f.after?
- end
- end
- return -1
- end
-
- def find_filter_prepend_position(filters, filter_type)
- # prepending a before or around filter puts it at the front of the call chain
- # after filters go before the first after filter in the chain
- if filter_type == :after
- each_with_index do |f,i|
- return i if f.after?
- end
- return -1
- end
- return 0
- end
-
- def find_or_create_filter(filter, filter_type, options = {})
- update_filter_in_chain([filter], options)
-
- if found_filter = find(filter) { |f| f.type == filter_type }
- found_filter
- else
- filter_kind = case
- when filter.respond_to?(:before) && filter_type == :before
- :before
- when filter.respond_to?(:after) && filter_type == :after
- :after
- else
- :filter
- end
-
- case filter_type
- when :before
- BeforeFilter.new(filter_kind, filter, options)
- when :after
- AfterFilter.new(filter_kind, filter, options)
- else
- AroundFilter.new(filter_kind, filter, options)
- end
- end
- end
-
- def update_filter_in_chain(filters, options, &test)
- filters.map! { |f| block_given? ? find(f, &test) : find(f) }
- filters.compact!
-
- map! do |filter|
- if filters.include?(filter)
- new_filter = filter.dup
- new_filter.options.merge!(options)
- new_filter
- else
- filter
- end
- end
- end
- end
-
- class Filter < ActiveSupport::Callbacks::Callback #:nodoc:
- def before?
- self.class == BeforeFilter
- end
-
- def after?
- self.class == AfterFilter
- end
-
- def around?
- self.class == AroundFilter
- end
-
- private
- def should_not_skip?(controller)
- if options[:skip]
- !included_in_action?(controller, options[:skip])
- else
- true
- end
- end
-
- def included_in_action?(controller, options)
- if options[:only]
- Array(options[:only]).map(&:to_s).include?(controller.action_name)
- elsif options[:except]
- !Array(options[:except]).map(&:to_s).include?(controller.action_name)
- else
- true
- end
- end
-
- def should_run_callback?(controller)
- should_not_skip?(controller) && included_in_action?(controller, options) && super
- end
- end
-
- class AroundFilter < Filter #:nodoc:
- def type
- :around
- end
-
- def call(controller, &block)
- if should_run_callback?(controller)
- method = filter_responds_to_before_and_after? ? around_proc : self.method
-
- # For around_filter do |controller, action|
- if method.is_a?(Proc) && method.arity == 2
- evaluate_method(method, controller, block)
- else
- evaluate_method(method, controller, &block)
- end
- else
- block.call
- end
- end
-
- private
- def filter_responds_to_before_and_after?
- method.respond_to?(:before) && method.respond_to?(:after)
- end
-
- def around_proc
- Proc.new do |controller, action|
- method.before(controller)
-
- if controller.send!(:performed?)
- controller.send!(:halt_filter_chain, method, :rendered_or_redirected)
- else
- begin
- action.call
- ensure
- method.after(controller)
- end
- end
- end
- end
- end
-
- class BeforeFilter < Filter #:nodoc:
- def type
- :before
- end
-
- def call(controller, &block)
- super
- if controller.send!(:performed?)
- controller.send!(:halt_filter_chain, method, :rendered_or_redirected)
- end
- end
- end
-
- class AfterFilter < Filter #:nodoc:
- def type
- :after
- end
- end
-
module ClassMethods
# The passed <tt>filters</tt> will be appended to the filter_chain and
# will execute before the action on this controller is performed.
View
37 vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb
@@ -48,6 +48,9 @@ module PolymorphicRoutes
#
# # calls post_url(post)
# polymorphic_url(post) # => "http://example.com/posts/1"
+ # polymorphic_url([blog, post]) # => "http://example.com/blogs/1/posts/1"
+ # polymorphic_url([:admin, blog, post]) # => "http://example.com/admin/blogs/1/posts/1"
+ # polymorphic_url([user, :blog, post]) # => "http://example.com/users/1/blog/posts/1"
#
# ==== Options
#
@@ -83,8 +86,6 @@ def polymorphic_url(record_or_hash_or_array, options = {})
else [ record_or_hash_or_array ]
end
- args << format if format
-
inflection =
case
when options[:action].to_s == "new"
@@ -96,6 +97,9 @@ def polymorphic_url(record_or_hash_or_array, options = {})
else
:singular
end
+
+ args.delete_if {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
+ args << format if format
named_route = build_named_route_call(record_or_hash_or_array, namespace, inflection, options)
send!(named_route, *args)
@@ -136,11 +140,19 @@ def build_named_route_call(records, namespace, inflection, options = {})
else
record = records.pop
route = records.inject("") do |string, parent|
- string << "#{RecordIdentifier.send!("singular_class_name", parent)}_"
+ if parent.is_a?(Symbol) || parent.is_a?(String)
+ string << "#{parent}_"
+ else
+ string << "#{RecordIdentifier.send!("singular_class_name", parent)}_"
+ end
end
end
- route << "#{RecordIdentifier.send!("#{inflection}_class_name", record)}_"
+ if record.is_a?(Symbol) || record.is_a?(String)
+ route << "#{record}_"
+ else
+ route << "#{RecordIdentifier.send!("#{inflection}_class_name", record)}_"
+ end
action_prefix(options) + namespace + route + routing_type(options).to_s
end
@@ -163,16 +175,17 @@ def extract_format(record_or_hash_or_array, options)
end
end
+ # Remove the first symbols from the array and return the url prefix
+ # implied by those symbols.
def extract_namespace(record_or_hash_or_array)
- returning "" do |namespace|
- if record_or_hash_or_array.is_a?(Array)
- record_or_hash_or_array.delete_if do |record_or_namespace|
- if record_or_namespace.is_a?(String) || record_or_namespace.is_a?(Symbol)
- namespace << "#{record_or_namespace}_"
- end
- end
- end
+ return "" unless record_or_hash_or_array.is_a?(Array)
+
+ namespace_keys = []
+ while (key = record_or_hash_or_array.first) && key.is_a?(String) || key.is_a?(Symbol)
+ namespace_keys << record_or_hash_or_array.shift
end
+
+ namespace_keys.map {|k| "#{k}_"}.join
end
end
end
View
33 vendor/rails/actionpack/lib/action_controller/record_identifier.rb
@@ -31,18 +31,21 @@ module ActionController
module RecordIdentifier
extend self
+ JOIN = '_'.freeze
+ NEW = 'new'.freeze
+
# Returns plural/singular for a record or class. Example:
#
# partial_path(post) # => "posts/post"
# partial_path(Person) # => "people/person"
# partial_path(Person, "admin/games") # => "admin/people/person"
def partial_path(record_or_class, controller_path = nil)
- klass = class_from_record_or_class(record_or_class)
+ name = model_name_from_record_or_class(record_or_class)
if controller_path && controller_path.include?("/")
- "#{File.dirname(controller_path)}/#{klass.name.tableize}/#{klass.name.demodulize.underscore}"
+ "#{File.dirname(controller_path)}/#{name.partial_path}"
else
- "#{klass.name.tableize}/#{klass.name.demodulize.underscore}"
+ name.partial_path
end
end
@@ -56,21 +59,25 @@ def partial_path(record_or_class, controller_path = nil)
# dom_class(post, :edit) # => "edit_post"
# dom_class(Person, :edit) # => "edit_person"
def dom_class(record_or_class, prefix = nil)
- [ prefix, singular_class_name(record_or_class) ].compact * '_'
+ singular = singular_class_name(record_or_class)
+ prefix ? "#{prefix}#{JOIN}#{singular}" : singular
end
# The DOM id convention is to use the singular form of an object or class with the id following an underscore.
# If no id is found, prefix with "new_" instead. Examples:
#
- # dom_id(Post.new(:id => 45)) # => "post_45"
+ # dom_id(Post.find(45)) # => "post_45"
# dom_id(Post.new) # => "new_post"
#
# If you need to address multiple instances of the same class in the same view, you can prefix the dom_id:
#
- # dom_id(Post.new(:id => 45), :edit) # => "edit_post_45"
+ # dom_id(Post.find(45), :edit) # => "edit_post_45"
def dom_id(record, prefix = nil)
- prefix ||= 'new' unless record.id
- [ prefix, singular_class_name(record), record.id ].compact * '_'
+ if record_id = record.id
+ "#{dom_class(record, prefix)}#{JOIN}#{record_id}"
+ else
+ dom_class(record, prefix || NEW)
+ end
end
# Returns the plural class name of a record or class. Examples:
@@ -78,7 +85,7 @@ def dom_id(record, prefix = nil)
# plural_class_name(post) # => "posts"
# plural_class_name(Highrise::Person) # => "highrise_people"
def plural_class_name(record_or_class)
- singular_class_name(record_or_class).pluralize
+ model_name_from_record_or_class(record_or_class).plural
end
# Returns the singular class name of a record or class. Examples:
@@ -86,12 +93,12 @@ def plural_class_name(record_or_class)
# singular_class_name(post) # => "post"
# singular_class_name(Highrise::Person) # => "highrise_person"
def singular_class_name(record_or_class)
- class_from_record_or_class(record_or_class).name.underscore.tr('/', '_')
+ model_name_from_record_or_class(record_or_class).singular
end
private
- def class_from_record_or_class(record_or_class)
- record_or_class.is_a?(Class) ? record_or_class : record_or_class.class
+ def model_name_from_record_or_class(record_or_class)
+ (record_or_class.is_a?(Class) ? record_or_class : record_or_class.class).model_name
end
end
-end
+end
View
15 vendor/rails/actionpack/lib/action_controller/request.rb 100644 → 100755
@@ -134,14 +134,17 @@ def xml_http_request?
# REMOTE_ADDR is a proxy. HTTP_X_FORWARDED_FOR may be a comma-
# delimited list in the case of multiple chained proxies; the last
# address which is not trusted is the originating IP.
-
def remote_ip
- if TRUSTED_PROXIES !~ @env['REMOTE_ADDR']
- return @env['REMOTE_ADDR']
+ remote_addr_list = @env['REMOTE_ADDR'] && @env['REMOTE_ADDR'].split(',').collect(&:strip)
+
+ unless remote_addr_list.blank?
+ not_trusted_addrs = remote_addr_list.reject {|addr| addr =~ TRUSTED_PROXIES}
+ return not_trusted_addrs.first unless not_trusted_addrs.empty?
end
+ remote_ips = @env['HTTP_X_FORWARDED_FOR'] && @env['HTTP_X_FORWARDED_FOR'].split(',')
if @env.include? 'HTTP_CLIENT_IP'
- if @env.include? 'HTTP_X_FORWARDED_FOR'
+ if remote_ips && !remote_ips.include?(@env['HTTP_CLIENT_IP'])
# We don't know which came from the proxy, and which from the user
raise ActionControllerError.new(<<EOM)
IP spoofing attack?!
@@ -149,11 +152,11 @@ def remote_ip
HTTP_X_FORWARDED_FOR=#{@env['HTTP_X_FORWARDED_FOR'].inspect}
EOM
end
+
return @env['HTTP_CLIENT_IP']
end
- if @env.include? 'HTTP_X_FORWARDED_FOR' then
- remote_ips = @env['HTTP_X_FORWARDED_FOR'].split(',')
+ if remote_ips
while remote_ips.size > 1 && TRUSTED_PROXIES =~ remote_ips.last.strip
remote_ips.pop
end
View
0  vendor/rails/actionpack/lib/action_controller/request_profiler.rb 100644 → 100755
File mode changed
View
0  vendor/rails/actionpack/lib/action_controller/response.rb 100644 → 100755
File mode changed
View
6 vendor/rails/actionpack/lib/action_controller/routing.rb
@@ -88,6 +88,10 @@ module ActionController
#
# map.connect ':controller/:action/:id', :action => 'show', :defaults => { :page => 'Dashboard' }
#
+ # Note: The default routes, as provided by the Rails generator, make all actions in every
+ # controller accessible via GET requests. You should consider removing them or commenting
+ # them out if you're using named routes and resources.
+ #
# == Named routes
#
# Routes can be named with the syntax <tt>map.name_of_route options</tt>,
@@ -369,7 +373,7 @@ def controller_relative_to(controller, previous)
Routes = RouteSet.new
- ::Inflector.module_eval do
+ ActiveSupport::Inflector.module_eval do
# Ensures that routes are reloaded when Rails inflections are updated.
def inflections_with_route_reloading(&block)
returning(inflections_without_route_reloading(&block)) {
View
3  vendor/rails/actionpack/lib/action_controller/routing/builder.rb
@@ -67,10 +67,9 @@ def divide_route_options(segments, options)
options = options.dup
if options[:namespace]
- options[:controller] = "#{options[:path_prefix]}/#{options[:controller]}"
+ options[:controller] = "#{options.delete(:namespace).sub(/\/$/, '')}/#{options[:controller]}"
options.delete(:path_prefix)
options.delete(:name_prefix)
- options.delete(:namespace)
end
requirements = (options.delete(:requirements) || {}).dup
View
2  vendor/rails/actionpack/lib/action_controller/routing/segments.rb
@@ -249,7 +249,7 @@ def interpolation_chunk(value_code = "#{local_name}")
end
def extract_value
- "#{local_name} = hash[:#{key}] && hash[:#{key}].collect { |path_component| URI.escape(path_component.to_param, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{"|| #{default.inspect}" if default}"
+ "#{local_name} = hash[:#{key}] && Array(hash[:#{key}]).collect { |path_component| URI.escape(path_component.to_param, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{"|| #{default.inspect}" if default}"
end
def default
View
2  vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb
@@ -1,4 +1,4 @@
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Action Controller: Exception caught</title>
<style>
View
6 vendor/rails/actionpack/lib/action_controller/test_process.rb
@@ -171,7 +171,7 @@ def message
# Was the response successful?
def success?
- response_code == 200
+ (200..299).include?(response_code)
end
# Was the URL not found?
@@ -333,7 +333,7 @@ class TestUploadedFile
attr_reader :original_filename
# The content type of the "uploaded" file
- attr_reader :content_type
+ attr_accessor :content_type
def initialize(path, content_type = Mime::TEXT, binary = false)
raise "#{path} file does not exist" unless File.exist?(path)
@@ -413,6 +413,8 @@ def follow_redirect
get(@response.redirected_to.delete(:action), @response.redirected_to.stringify_keys)
end
+ deprecate :follow_redirect => "If you wish to follow redirects, you should use integration tests"
+
def assigns(key = nil)
if key.nil?
@response.template.assigns
View
2  vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/document.rb
@@ -17,7 +17,7 @@ def initialize(text, strict=false, xml=false)
@root = Node.new(nil)
node_stack = [ @root ]
while token = tokenizer.next
- node = Node.parse(node_stack.last, tokenizer.line, tokenizer.position, token)
+ node = Node.parse(node_stack.last, tokenizer.line, tokenizer.position, token, strict)
node_stack.last.children << node unless node.tag? && node.closing == :close
if node.tag?
View
2  vendor/rails/actionpack/lib/action_controller/verification.rb
@@ -116,7 +116,7 @@ def verify_request_xhr_status(options) # :nodoc:
end
def apply_redirect_to(redirect_to_option) # :nodoc:
- redirect_to_option.is_a?(Symbol) ? self.send!(redirect_to_option) : redirect_to_option
+ (redirect_to_option.is_a?(Symbol) && redirect_to_option != :back) ? self.send!(redirect_to_option) : redirect_to_option
end
def apply_remaining_actions(options) # :nodoc:
View
2  vendor/rails/actionpack/lib/action_pack/version.rb
@@ -2,7 +2,7 @@ module ActionPack #:nodoc:
module VERSION #:nodoc:
MAJOR = 2
MINOR = 1
- TINY = 0
+ TINY = 1
STRING = [MAJOR, MINOR, TINY].join('.')
end
View
10 vendor/rails/actionpack/lib/action_view/base.rb
@@ -178,10 +178,13 @@ def self.cache_template_extensions=(*args)
# that alert()s the caught exception (and then re-raises it).
@@debug_rjs = false
cattr_accessor :debug_rjs
-
+
@@erb_variable = '_erbout'
cattr_accessor :erb_variable
-
+ class << self
+ deprecate :erb_variable= => 'The erb variable will no longer be configurable. Use the concat helper method instead of appending to it directly.'
+ end
+
attr_internal :request
delegate :request_forgery_protection_token, :template, :params, :session, :cookies, :response, :headers,
@@ -253,6 +256,7 @@ def render(options = {}, local_assigns = {}, &block) #:nodoc:
elsif options == :update
update_page(&block)
elsif options.is_a?(Hash)
+ use_full_path = options[:use_full_path]
options = options.reverse_merge(:locals => {}, :use_full_path => true)
if partial_layout = options.delete(:layout)
@@ -266,7 +270,7 @@ def render(options = {}, local_assigns = {}, &block) #:nodoc:
end
end
elsif options[:file]
- render_file(options[:file], options[:use_full_path], options[:locals])
+ render_file(options[:file], use_full_path || false, options[:locals])
elsif options[:partial] && options[:collection]
render_partial_collection(options[:partial], options[:collection], options[:spacer_template], options[:locals])
elsif options[:partial]
View
25 vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -485,21 +485,24 @@ def compute_public_path(source, dir, ext = nil, include_host = true)
source = "#{@controller.request.relative_url_root}#{source}"
end
end
- source = rewrite_asset_path(source)
- if include_host
- host = compute_asset_host(source)
+ rewrite_asset_path(source)
+ end
+ end
- if has_request && !host.blank? && host !~ %r{^[-a-z]+://}
- host = "#{@controller.request.protocol}#{host}"
- end
+ source = ActionView::Base.computed_public_paths[cache_key]
- "#{host}#{source}"
- else
- source
- end
- end
+ if include_host && source !~ %r{^[-a-z]+://}
+ host = compute_asset_host(source)
+
+ if has_request && !host.blank? && host !~ %r{^[-a-z]+://}
+ host = "#{@controller.request.protocol}#{host}"
end
+
+ "#{host}#{source}"
+ else
+ source
+ end
end
# Pick an asset host for this source. Returns +nil+ if no host is set,
View
6 vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb 100644 → 100755
@@ -696,15 +696,15 @@ def default_time_from_options(default)
class FormBuilder
def date_select(method, options = {}, html_options = {})
- @template.date_select(@object_name, method, options.merge(:object => @object))
+ @template.date_select(@object_name, method, options.merge(:object => @object), html_options)
end
def time_select(method, options = {}, html_options = {})
- @template.time_select(@object_name, method, options.merge(:object => @object))
+ @template.time_select(@object_name, method, options.merge(:object => @object), html_options)
end
def datetime_select(method, options = {}, html_options = {})
- @template.datetime_select(@object_name, method, options.merge(:object => @object))
+ @template.datetime_select(@object_name, method, options.merge(:object => @object), html_options)
end
end
end
View
6 vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb
@@ -601,7 +601,11 @@ def to_content_tag(tag_name, options = {})
end
def object
- @object || (@template_object.instance_variable_get("@#{@object_name}") rescue nil)
+ @object || @template_object.instance_variable_get("@#{@object_name}")
+ rescue NameError
+ # As @object_name may contain the nested syntax (item[subobject]) we
+ # need to fallback to nil.
+ nil
end
def value(object)
View
4 vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -304,7 +304,7 @@ def country_options_for_select(selected = nil, priority_countries = nil)
#
# NOTE: Only the option tags are returned, you have to wrap this call in
# a regular HTML select tag.
- def time_zone_options_for_select(selected = nil, priority_zones = nil, model = TimeZone)
+ def time_zone_options_for_select(selected = nil, priority_zones = nil, model = ::ActiveSupport::TimeZone)
zone_options = ""
zones = model.all
@@ -417,7 +417,7 @@ def to_time_zone_select_tag(priority_zones, options, html_options)
value = value(object)
content_tag("select",
add_options(
- time_zone_options_for_select(value || options[:default], priority_zones, options[:model] || TimeZone),
+ time_zone_options_for_select(value || options[:default], priority_zones, options[:model] || ActiveSupport::TimeZone),
options, value
), html_options
)
View
8 vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -129,7 +129,7 @@ def text_field_tag(name, value = nil, options = {})
# label_tag 'name', nil, :class => 'small_label'
# # => <label for="name" class="small_label">Name</label>
def label_tag(name, text = nil, options = {})
- content_tag :label, text || name.humanize, { "for" => name }.update(options.stringify_keys)
+ content_tag :label, text || name.to_s.humanize, { "for" => name }.update(options.stringify_keys)
end
# Creates a hidden form input field used to transmit data that would be lost due to HTTP's statelessness or
@@ -348,11 +348,13 @@ def submit_tag(value = "Save changes", options = {})
options.stringify_keys!
if disable_with = options.delete("disable_with")
+ disable_with = "this.value='#{disable_with}'"
+ disable_with << ";#{options.delete('onclick')}" if options['onclick']
+
options["onclick"] = [
"this.setAttribute('originalValue', this.value)",
"this.disabled=true",
- "this.value='#{disable_with}'",
- "#{options["onclick"]}",
+ disable_with,
"result = (this.form.onsubmit ? (this.form.onsubmit() ? this.form.submit() : false) : this.form.submit())",
"if (result == false) { this.value = this.getAttribute('originalValue'); this.disabled = false }",
"return result;",
View
8 vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -80,10 +80,9 @@ module JavaScriptHelper
# return false;">Show me more</a>
#
def link_to_function(name, *args, &block)
- html_options = args.extract_options!
+ html_options = args.extract_options!.symbolize_keys
function = args[0] || ''
- html_options.symbolize_keys!
function = update_page(&block) if block_given?
content_tag(
"a", name,
@@ -111,10 +110,9 @@ def link_to_function(name, *args, &block)
# page[:details].visual_effect :toggle_slide
# end
def button_to_function(name, *args, &block)
- html_options = args.extract_options!
+ html_options = args.extract_options!.symbolize_keys
function = args[0] || ''
- html_options.symbolize_keys!
function = update_page(&block) if block_given?
tag(:input, html_options.merge({
:type => "button", :value => name,
@@ -147,6 +145,8 @@ def define_javascript_functions
javascript << '</script>'
end
+ deprecate :define_javascript_functions=>"use javascript_include_tag instead"
+
# Escape carrier returns and single and double quotes for JavaScript segments.
def escape_javascript(javascript)
(javascript || '').gsub('\\','\0\0').gsub('</','<\/').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" }
View
14 vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -111,7 +111,7 @@ module PrototypeHelper
(100..599).to_a)
AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url,
:asynchronous, :method, :insertion, :position,
- :form, :with, :update, :script ]).merge(CALLBACKS)
+ :form, :with, :update, :script, :type ]).merge(CALLBACKS)
end
# Returns a link to a remote action defined by <tt>options[:url]</tt>
@@ -603,7 +603,7 @@ def include_helpers_from_context
# Example:
#
# # Generates:
- # # new Insertion.Bottom("list", "<li>Some item</li>");
+ # # new Element.insert("list", { bottom: <li>Some item</li>" });
# # new Effect.Highlight("list");
# # ["status-indicator", "cancel-link"].each(Element.hide);
# update_page do |page|
@@ -736,16 +736,16 @@ def select(pattern)
#
# # Insert the rendered 'navigation' partial just before the DOM
# # element with ID 'content'.
- # # Generates: new Insertion.Before("content", "-- Contents of 'navigation' partial --");
+ # # Generates: Element.insert("content", { before: "-- Contents of 'navigation' partial --" });
# page.insert_html :before, 'content', :partial => 'navigation'
#
# # Add a list item to the bottom of the <ul> with ID 'list'.
- # # Generates: new Insertion.Bottom("list", "<li>Last item</li>");
+ # # Generates: Element.insert("list", { bottom: "<li>Last item</li>" });
# page.insert_html :bottom, 'list', '<li>Last item</li>'
#
def insert_html(position, id, *options_for_render)
- insertion = position.to_s.camelize
- call "new Insertion.#{insertion}", id, render(*options_for_render)
+ content = javascript_object_for(render(*options_for_render))
+ record "Element.insert(\"#{id}\", { #{position.to_s.downcase}: #{content} });"
end
# Replaces the inner HTML of the DOM element with the given +id+.
@@ -1039,7 +1039,7 @@ def options_for_ajax(options)
js_options['asynchronous'] = options[:type] != :synchronous
js_options['method'] = method_option_to_s(options[:method]) if options[:method]
- js_options['insertion'] = "Insertion.#{options[:position].to_s.camelize}" if options[:position]
+ js_options['insertion'] = "'#{options[:position].to_s.downcase}'" if options[:position]
js_options['evalScripts'] = options[:script].nil? || options[:script]
if options[:form]
View
7 vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -1,5 +1,6 @@
require 'cgi'
require 'erb'
+require 'set'
module ActionView
module Helpers #:nodoc:
@@ -8,7 +9,8 @@ module Helpers #:nodoc:
module TagHelper
include ERB::Util
- BOOLEAN_ATTRIBUTES = Set.new(%w(disabled readonly multiple))
+ BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple).to_set
+ BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map(&:to_sym))
# Returns an empty HTML tag of type +name+ which by default is XHTML
# compliant. Set +open+ to true to create an open tag compatible
@@ -37,7 +39,7 @@ module TagHelper
# tag("img", { :src => "open &amp; shut.png" }, false, false)
# # => <img src="open &amp; shut.png" />
def tag(name, options = nil, open = false, escape = true)
- "<#{name}#{tag_options(options, escape) if options}" + (open ? ">" : " />")
+ "<#{name}#{tag_options(options, escape) if options}#{open ? ">" : " />"}"
end
# Returns an HTML block tag of type +name+ surrounding the +content+. Add
@@ -114,7 +116,6 @@ def tag_options(options, escape = true)
if escape
options.each do |key, value|
next unless value
- key = key.to_s
value = BOOLEAN_ATTRIBUTES.include?(key) ? key : escape_once(value)
attrs << %(#{key}="#{value}")
end
View
2  vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb
@@ -464,7 +464,7 @@ def set_cycle(name, cycle_object)
[-\w]+ # subdomain or domain
(?:\.[-\w]+)* # remaining subdomains or domain
(?::\d+)? # port
- (?:/(?:(?:[~\w\+@%=\(\)-]|(?:[,.;:][^\s$]))+)?)* # path
+ (?:/(?:(?:[~\w\+@%=\(\)-]|(?:[,.;:'][^\s$]))+)?)* # path
(?:\?[\w\+@%&=.;-]+)? # query string
(?:\#[\w\-]*)? # trailing anchor
)