Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of git://github.com/rails/rails into rails

  • Loading branch information...
commit b79da0db54a20f26bc233c5df83be315a7d61415 2 parents c181416 + e61e0c0
@sandeepr-sourcebits sandeepr-sourcebits authored
Showing with 7,268 additions and 4,808 deletions.
  1. +8 −3 .travis.yml
  2. +40 −41 Gemfile
  3. +1 −1  RAILS_VERSION
  4. +5 −2 README.rdoc
  5. +1 −9 RELEASING_RAILS.rdoc
  6. +7 −12 Rakefile
  7. +59 −1 actionmailer/CHANGELOG.md
  8. +1 −1  actionmailer/MIT-LICENSE
  9. +7 −5 actionmailer/README.rdoc
  10. +1 −0  actionmailer/Rakefile
  11. +2 −2 actionmailer/actionmailer.gemspec
  12. +1 −2  actionmailer/lib/action_mailer.rb
  13. +41 −17 actionmailer/lib/action_mailer/base.rb
  14. +2 −2 actionmailer/lib/action_mailer/collector.rb
  15. +2 −4 actionmailer/lib/action_mailer/log_subscriber.rb
  16. +4 −5 actionmailer/lib/action_mailer/mail_helper.rb
  17. +3 −2 actionmailer/lib/action_mailer/railtie.rb
  18. +1 −0  actionmailer/lib/action_mailer/test_case.rb
  19. +0 −2  actionmailer/lib/action_mailer/test_helper.rb
  20. +2 −2 actionmailer/lib/action_mailer/version.rb
  21. +1 −1  actionmailer/lib/rails/generators/mailer/USAGE
  22. +2 −2 actionmailer/lib/rails/generators/mailer/templates/mailer.rb
  23. +6 −9 actionmailer/test/abstract_unit.rb
  24. +1 −1  actionmailer/test/asset_host_test.rb
  25. +51 −3 actionmailer/test/base_test.rb
  26. +44 −0 actionmailer/test/mail_helper_test.rb
  27. +1 −1  actionmailer/test/mail_layout_test.rb
  28. +470 −123 actionpack/CHANGELOG.md
  29. +1 −1  actionpack/MIT-LICENSE
  30. +5 −3 actionpack/README.rdoc
  31. +9 −9 actionpack/Rakefile
  32. +4 −6 actionpack/actionpack.gemspec
  33. +185 −0 actionpack/examples/performance.rb
  34. +3 −0  actionpack/examples/views/_collection.erb
  35. +1 −0  actionpack/examples/views/_hello.erb
  36. +3 −0  actionpack/examples/views/_hundred_partials.erb
  37. +10 −0 actionpack/examples/views/_partial.erb
  38. +10 −0 actionpack/examples/views/_ten_partials.erb
  39. +3 −0  actionpack/examples/views/hashes/_hash.erb
  40. +3 −0  actionpack/examples/views/my_hashes/_my_hash.erb
  41. +1 −0  actionpack/examples/views/template.html.erb
  42. +1 −1  actionpack/lib/abstract_controller/asset_paths.rb
  43. +6 −5 actionpack/lib/abstract_controller/base.rb
  44. +12 −16 actionpack/lib/abstract_controller/callbacks.rb
  45. +113 −60 actionpack/lib/abstract_controller/layouts.rb
  46. +1 −2  actionpack/lib/abstract_controller/logger.rb
  47. +8 −20 actionpack/lib/abstract_controller/rendering.rb
  48. +6 −6 actionpack/lib/abstract_controller/url_for.rb
  49. +2 −2 actionpack/lib/abstract_controller/view_paths.rb
  50. +0 −2  actionpack/lib/action_controller.rb
  51. +18 −6 actionpack/lib/action_controller/base.rb
  52. +8 −5 actionpack/lib/action_controller/caching/actions.rb
  53. +39 −12 actionpack/lib/action_controller/caching/pages.rb
  54. +1 −1  actionpack/lib/action_controller/caching/sweeping.rb
  55. +5 −1 actionpack/lib/action_controller/deprecated.rb
  56. +3 −0  actionpack/lib/action_controller/deprecated/integration_test.rb
  57. +2 −0  actionpack/lib/action_controller/deprecated/performance_test.rb
  58. +0 −1  actionpack/lib/action_controller/log_subscriber.rb
  59. +7 −9 actionpack/lib/action_controller/metal.rb
  60. +0 −58 actionpack/lib/action_controller/metal/compatibility.rb
  61. +9 −2 actionpack/lib/action_controller/metal/conditional_get.rb
  62. +1 −2  actionpack/lib/action_controller/metal/data_streaming.rb
  63. +1 −1  actionpack/lib/action_controller/metal/exceptions.rb
  64. +18 −2 actionpack/lib/action_controller/metal/force_ssl.rb
  65. +3 −3 actionpack/lib/action_controller/metal/helpers.rb
  66. +17 −14 actionpack/lib/action_controller/metal/http_authentication.rb
  67. +1 −1  actionpack/lib/action_controller/metal/implicit_render.rb
  68. +52 −20 actionpack/lib/action_controller/metal/mime_responds.rb
  69. +11 −5 actionpack/lib/action_controller/metal/params_wrapper.rb
  70. +1 −1  actionpack/lib/action_controller/metal/redirecting.rb
  71. +9 −1 actionpack/lib/action_controller/metal/rendering.rb
  72. +19 −3 actionpack/lib/action_controller/metal/request_forgery_protection.rb
  73. +10 −7 actionpack/lib/action_controller/metal/rescue.rb
  74. +18 −9 actionpack/lib/action_controller/metal/responder.rb
  75. +0 −9 actionpack/lib/action_controller/metal/session_management.rb
  76. +2 −3 actionpack/lib/action_controller/metal/streaming.rb
  77. +21 −22 actionpack/lib/action_controller/metal/url_for.rb
  78. +20 −11 actionpack/lib/action_controller/railtie.rb
  79. +22 −0 actionpack/lib/action_controller/railties/helpers.rb
  80. +0 −25 actionpack/lib/action_controller/railties/paths.rb
  81. +2 −2 actionpack/lib/action_controller/record_identifier.rb
  82. +90 −51 actionpack/lib/action_controller/test_case.rb
  83. +1 −1  actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
  84. +1 −1  actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb
  85. +5 −3 actionpack/lib/action_dispatch.rb
  86. +41 −15 actionpack/lib/action_dispatch/http/cache.rb
  87. +1 −1  actionpack/lib/action_dispatch/http/filter_parameters.rb
  88. +4 −2 actionpack/lib/action_dispatch/http/mime_type.rb
  89. +1 −1  actionpack/lib/action_dispatch/http/mime_types.rb
  90. +3 −1 actionpack/lib/action_dispatch/http/parameter_filter.rb
  91. +0 −2  actionpack/lib/action_dispatch/http/parameters.rb
  92. +2 −3 actionpack/lib/action_dispatch/http/rack_cache.rb
  93. +18 −11 actionpack/lib/action_dispatch/http/request.rb
  94. +20 −20 actionpack/lib/action_dispatch/http/response.rb
  95. +7 −9 actionpack/lib/action_dispatch/http/upload.rb
  96. +9 −5 actionpack/lib/action_dispatch/http/url.rb
  97. +9 −3 actionpack/lib/action_dispatch/middleware/callbacks.rb
  98. +0 −7 actionpack/lib/action_dispatch/middleware/closed_error.rb
  99. +9 −10 actionpack/lib/action_dispatch/middleware/cookies.rb
  100. +7 −3 actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
  101. +15 −39 actionpack/lib/action_dispatch/middleware/flash.rb
  102. +1 −1  actionpack/lib/action_dispatch/middleware/params_parser.rb
  103. +30 −0 actionpack/lib/action_dispatch/middleware/public_exceptions.rb
  104. +27 −14 actionpack/lib/action_dispatch/middleware/reloader.rb
  105. +9 −7 actionpack/lib/action_dispatch/middleware/remote_ip.rb
  106. +2 −5 actionpack/lib/action_dispatch/middleware/request_id.rb
  107. +0 −26 actionpack/lib/action_dispatch/middleware/rescue.rb
  108. +1 −5 actionpack/lib/action_dispatch/middleware/session/abstract_store.rb
  109. +0 −1  actionpack/lib/action_dispatch/middleware/session/cache_store.rb
  110. +23 −52 actionpack/lib/action_dispatch/middleware/show_exceptions.rb
  111. +3 −2 actionpack/lib/action_dispatch/middleware/stack.rb
  112. +12 −2 actionpack/lib/action_dispatch/middleware/static.rb
  113. +13 −8 actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb
  114. +5 −1 actionpack/lib/action_dispatch/railtie.rb
  115. +11 −14 actionpack/lib/action_dispatch/routing.rb
  116. +119 −75 actionpack/lib/action_dispatch/routing/mapper.rb
  117. +6 −4 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
  118. +0 −9 actionpack/lib/action_dispatch/routing/redirection.rb
  119. +133 −67 actionpack/lib/action_dispatch/routing/route_set.rb
  120. +4 −0 actionpack/lib/action_dispatch/routing/routes_proxy.rb
  121. +22 −14 actionpack/lib/action_dispatch/routing/url_for.rb
  122. +2 −6 actionpack/lib/action_dispatch/testing/assertions/dom.rb
  123. +12 −18 actionpack/lib/action_dispatch/testing/assertions/response.rb
  124. +9 −8 actionpack/lib/action_dispatch/testing/assertions/routing.rb
  125. +13 −10 actionpack/lib/action_dispatch/testing/assertions/selector.rb
  126. +32 −12 actionpack/lib/action_dispatch/testing/integration.rb
  127. +2 −1  actionpack/lib/action_dispatch/testing/test_process.rb
  128. +1 −1  actionpack/lib/action_pack.rb
  129. +2 −2 actionpack/lib/action_pack/version.rb
  130. +1 −1  actionpack/lib/action_view.rb
  131. +4 −2 actionpack/lib/action_view/asset_paths.rb
  132. +1 −9 actionpack/lib/action_view/base.rb
  133. +1 −1  actionpack/lib/action_view/buffers.rb
  134. +0 −88 actionpack/lib/action_view/data/encoding_conversions.txt
  135. +1 −4 actionpack/lib/action_view/flows.rb
  136. +2 −3 actionpack/lib/action_view/helpers.rb
  137. +3 −8 actionpack/lib/action_view/helpers/active_model_helper.rb
  138. +0 −7 actionpack/lib/action_view/helpers/asset_paths.rb
  139. +87 −33 actionpack/lib/action_view/helpers/asset_tag_helper.rb
  140. +7 −0 actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb
  141. +7 −0 actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
  142. +13 −0 actionpack/lib/action_view/helpers/benchmark_helper.rb
  143. +31 −10 actionpack/lib/action_view/helpers/capture_helper.rb
  144. +0 −2  actionpack/lib/action_view/helpers/csrf_helper.rb
  145. +54 −80 actionpack/lib/action_view/helpers/date_helper.rb
  146. +237 −405 actionpack/lib/action_view/helpers/form_helper.rb
  147. +187 −115 actionpack/lib/action_view/helpers/form_options_helper.rb
  148. +34 −31 actionpack/lib/action_view/helpers/form_tag_helper.rb
  149. +4 −7 actionpack/lib/action_view/helpers/javascript_helper.rb
  150. +109 −97 actionpack/lib/action_view/helpers/number_helper.rb
  151. +1 −2  actionpack/lib/action_view/helpers/output_safety_helper.rb
  152. +10 −15 actionpack/lib/action_view/helpers/record_tag_helper.rb
  153. +0 −1  actionpack/lib/action_view/helpers/sanitize_helper.rb
  154. +31 −20 actionpack/lib/action_view/helpers/tag_helper.rb
  155. +33 −0 actionpack/lib/action_view/helpers/tags.rb
  156. +146 −0 actionpack/lib/action_view/helpers/tags/base.rb
  157. +64 −0 actionpack/lib/action_view/helpers/tags/check_box.rb
  158. +16 −0 actionpack/lib/action_view/helpers/tags/checkable.rb
  159. +37 −0 actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
  160. +82 −0 actionpack/lib/action_view/helpers/tags/collection_helpers.rb
  161. +30 −0 actionpack/lib/action_view/helpers/tags/collection_radio_buttons.rb
  162. +28 −0 actionpack/lib/action_view/helpers/tags/collection_select.rb
  163. +15 −0 actionpack/lib/action_view/helpers/tags/date_field.rb
  164. +70 −0 actionpack/lib/action_view/helpers/tags/date_select.rb
  165. +8 −0 actionpack/lib/action_view/helpers/tags/datetime_select.rb
  166. +8 −0 actionpack/lib/action_view/helpers/tags/email_field.rb
  167. +12 −0 actionpack/lib/action_view/helpers/tags/file_field.rb
  168. +29 −0 actionpack/lib/action_view/helpers/tags/grouped_collection_select.rb
  169. +12 −0 actionpack/lib/action_view/helpers/tags/hidden_field.rb
  170. +65 −0 actionpack/lib/action_view/helpers/tags/label.rb
  171. +19 −0 actionpack/lib/action_view/helpers/tags/number_field.rb
  172. +12 −0 actionpack/lib/action_view/helpers/tags/password_field.rb
  173. +31 −0 actionpack/lib/action_view/helpers/tags/radio_button.rb
  174. +8 −0 actionpack/lib/action_view/helpers/tags/range_field.rb
  175. +24 −0 actionpack/lib/action_view/helpers/tags/search_field.rb
  176. +41 −0 actionpack/lib/action_view/helpers/tags/select.rb
  177. +8 −0 actionpack/lib/action_view/helpers/tags/tel_field.rb
  178. +18 −0 actionpack/lib/action_view/helpers/tags/text_area.rb
  179. +29 −0 actionpack/lib/action_view/helpers/tags/text_field.rb
  180. +8 −0 actionpack/lib/action_view/helpers/tags/time_select.rb
  181. +20 −0 actionpack/lib/action_view/helpers/tags/time_zone_select.rb
  182. +8 −0 actionpack/lib/action_view/helpers/tags/url_field.rb
  183. +9 −9 actionpack/lib/action_view/helpers/text_helper.rb
  184. +52 −63 actionpack/lib/action_view/helpers/url_helper.rb
  185. +2 −2 actionpack/lib/action_view/locale/en.yml
  186. +1 −2  actionpack/lib/action_view/log_subscriber.rb
  187. +21 −36 actionpack/lib/action_view/lookup_context.rb
  188. +4 −0 actionpack/lib/action_view/railtie.rb
  189. +3 −15 actionpack/lib/action_view/renderer/abstract_renderer.rb
  190. +69 −27 actionpack/lib/action_view/renderer/partial_renderer.rb
  191. +1 −4 actionpack/lib/action_view/renderer/streaming_template_renderer.rb
  192. +30 −10 actionpack/lib/action_view/renderer/template_renderer.rb
  193. +64 −87 actionpack/lib/action_view/template.rb
  194. +4 −9 actionpack/lib/action_view/template/error.rb
  195. +6 −8 actionpack/lib/action_view/template/handlers.rb
  196. +10 −18 actionpack/lib/action_view/template/handlers/erb.rb
  197. +0 −1  actionpack/lib/action_view/template/resolver.rb
  198. +29 −29 actionpack/lib/action_view/test_case.rb
  199. +0 −95 actionpack/lib/sprockets/assets.rake
  200. +0 −37 actionpack/lib/sprockets/bootstrap.rb
  201. +0 −83 actionpack/lib/sprockets/compressors.rb
  202. +0 −6 actionpack/lib/sprockets/helpers.rb
  203. +0 −13 actionpack/lib/sprockets/helpers/isolated_helper.rb
  204. +0 −167 actionpack/lib/sprockets/helpers/rails_helper.rb
  205. +0 −59 actionpack/lib/sprockets/railtie.rb
  206. +0 −61 actionpack/lib/sprockets/static_compiler.rb
  207. +2 −1  actionpack/test/abstract/abstract_controller_test.rb
  208. +95 −11 actionpack/test/abstract/layouts_test.rb
  209. +2 −2 actionpack/test/abstract/translation_test.rb
  210. +24 −20 actionpack/test/abstract_unit.rb
  211. +4 −6 actionpack/test/activerecord/active_record_store_test.rb
  212. +55 −0 actionpack/test/assertions/response_assertions_test.rb
  213. +18 −15 actionpack/test/controller/action_pack_assertions_test.rb
  214. +0 −35 actionpack/test/controller/addresses_render_test.rb
  215. +0 −4 actionpack/test/controller/assert_select_test.rb
  216. +31 −60 actionpack/test/controller/base_test.rb
  217. +56 −10 actionpack/test/controller/caching_test.rb
  218. +2 −4 actionpack/test/controller/capture_test.rb
  219. +5 −7 actionpack/test/controller/content_type_test.rb
  220. +1 −1  actionpack/test/controller/default_url_options_with_filter_test.rb
  221. +1 −17 actionpack/test/controller/filters_test.rb
  222. +81 −0 actionpack/test/controller/flash_hash_test.rb
  223. +0 −44 actionpack/test/controller/flash_test.rb
  224. +35 −10 actionpack/test/controller/force_ssl_test.rb
  225. +0 −7 actionpack/test/controller/helper_test.rb
  226. +1 −1  actionpack/test/controller/http_basic_authentication_test.rb
  227. +43 −2 actionpack/test/controller/http_digest_authentication_test.rb
  228. +74 −3 actionpack/test/controller/integration_test.rb
  229. +14 −1 actionpack/test/controller/layout_test.rb
  230. +103 −7 actionpack/test/controller/mime_responds_test.rb
  231. +30 −6 actionpack/test/controller/new_base/render_layout_test.rb
  232. +2 −2 actionpack/test/controller/new_base/render_streaming_test.rb
  233. +6 −0 actionpack/test/controller/new_base/render_template_test.rb
  234. +27 −0 actionpack/test/controller/params_wrapper_test.rb
  235. +1 −1  actionpack/test/controller/record_identifier_test.rb
  236. +20 −2 actionpack/test/controller/redirect_test.rb
  237. +2 −1  actionpack/test/controller/render_json_test.rb
  238. +53 −26 actionpack/test/controller/render_test.rb
  239. +1 −1  actionpack/test/controller/render_xml_test.rb
  240. +38 −10 actionpack/test/controller/request_forgery_protection_test.rb
  241. +3 −18 actionpack/test/controller/rescue_test.rb
  242. +16 −10 actionpack/test/controller/resources_test.rb
  243. +226 −42 actionpack/test/controller/routing_test.rb
  244. +1 −1  actionpack/test/controller/runner_test.rb
  245. +1 −1  actionpack/test/controller/selector_test.rb
  246. +1 −5 actionpack/test/controller/send_file_test.rb
  247. +16 −5 actionpack/test/controller/show_exceptions_test.rb
  248. +16 −0 actionpack/test/controller/sweeper_test.rb
  249. +57 −30 actionpack/test/controller/{test_test.rb → test_case_test.rb}
  250. +8 −0 actionpack/test/controller/url_for_test.rb
  251. +5 −11 actionpack/test/controller/view_paths_test.rb
  252. +0 −2  actionpack/test/controller/webservice_test.rb
  253. +9 −2 actionpack/test/dispatch/callbacks_test.rb
  254. +12 −97 actionpack/test/dispatch/cookies_test.rb
  255. +38 −6 actionpack/test/dispatch/debug_exceptions_test.rb
  256. +6 −0 actionpack/test/dispatch/middleware_stack_test.rb
  257. +43 −0 actionpack/test/dispatch/mime_type_test.rb
  258. +1 −1  actionpack/test/dispatch/mount_test.rb
  259. +7 −0 actionpack/test/dispatch/prefix_generation_test.rb
  260. +35 −2 actionpack/test/dispatch/reloader_test.rb
  261. +1 −1  actionpack/test/dispatch/request/json_params_parsing_test.rb
  262. +1 −1  actionpack/test/dispatch/request/multipart_params_parsing_test.rb
  263. +0 −2  actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
  264. +5 −5 actionpack/test/dispatch/request/xml_params_parsing_test.rb
  265. +1 −1  actionpack/test/dispatch/request_id_test.rb
  266. +52 −10 actionpack/test/dispatch/request_test.rb
  267. +17 −0 actionpack/test/dispatch/response_test.rb
  268. +12 −0 actionpack/test/dispatch/routing_assertions_test.rb
  269. +1,065 −1,168 actionpack/test/dispatch/routing_test.rb
  270. +0 −2  actionpack/test/dispatch/session/cache_store_test.rb
  271. +0 −2  actionpack/test/dispatch/session/cookie_store_test.rb
  272. +0 −2  actionpack/test/dispatch/session/mem_cache_store_test.rb
  273. +28 −4 actionpack/test/dispatch/show_exceptions_test.rb
  274. +100 −1 actionpack/test/dispatch/static_test.rb
  275. +4 −6 actionpack/test/dispatch/uploaded_file_test.rb
  276. +0 −1  actionpack/test/fixtures/addresses/list.erb
  277. +1 −1  actionpack/test/fixtures/developers.yml
  278. +1 −0  actionpack/test/fixtures/public/foo/こんにちは.html
  279. +0 −1  actionpack/test/fixtures/sprockets/alternate/stylesheets/style.css
  280. BIN  actionpack/test/fixtures/sprockets/app/images/logo.png
  281. +0 −1  actionpack/test/fixtures/sprockets/app/javascripts/application.js
  282. 0  actionpack/test/fixtures/sprockets/app/javascripts/dir/xmlhr.js
  283. 0  actionpack/test/fixtures/sprockets/app/javascripts/extra.js
  284. 0  actionpack/test/fixtures/sprockets/app/javascripts/xmlhr.js
  285. +0 −1  actionpack/test/fixtures/sprockets/app/stylesheets/application.css
  286. 0  actionpack/test/fixtures/sprockets/app/stylesheets/dir/style.css
  287. 0  actionpack/test/fixtures/sprockets/app/stylesheets/extra.css
  288. 0  actionpack/test/fixtures/sprockets/app/stylesheets/style.css
  289. +1 −0  actionpack/test/fixtures/test/_b_layout_for_partial.html.erb
  290. +1 −0  actionpack/test/fixtures/test/one.html.erb
  291. +1 −0  actionpack/test/fixtures/with_format.json.erb
  292. +2 −29 actionpack/test/lib/controller/fake_controllers.rb
  293. +10 −0 actionpack/test/lib/controller/fake_models.rb
  294. +0 −15 actionpack/test/lib/testing_sandbox.rb
  295. +31 −0 actionpack/test/routing/helper_test.rb
  296. +27 −4 actionpack/test/template/active_model_helper_test.rb
  297. +267 −20 actionpack/test/template/asset_tag_helper_test.rb
  298. +1 −6 actionpack/test/template/atom_feed_helper_test.rb
  299. +24 −0 actionpack/test/template/benchmark_helper_test.rb
  300. +68 −17 actionpack/test/template/capture_helper_test.rb
Sorry, we could not display the entire diff because too many files (1,143) changed.
View
11 .travis.yml
@@ -1,11 +1,11 @@
script: 'ci/travis.rb'
+before_install:
+ - gem install bundler
rvm:
- - 1.8.7
- - 1.9.2
- 1.9.3
env:
- "GEM=railties"
- - "GEM=ap,am,amo,ares,as"
+ - "GEM=ap,am,amo,as"
- "GEM=ar:mysql"
- "GEM=ar:mysql2"
- "GEM=ar:sqlite3"
@@ -17,4 +17,9 @@ notifications:
on_failure: always
channels:
- "irc.freenode.org#rails-contrib"
+ campfire:
+ on_success: change
+ on_failure: always
+ rooms:
+ - secure: "CGWvthGkBKNnTnk9YSmf9AXKoiRI33fCl5D3jU4nx3cOPu6kv2R9nMjt9EAo\nOuS4Q85qNSf4VNQ2cUPNiNYSWQ+XiTfivKvDUw/QW9r1FejYyeWarMsSBWA+\n0fADjF1M2dkDIVLgYPfwoXEv7l+j654F1KLKB69F0F/netwP9CQ="
bundler_args: --path vendor/bundle
View
81 Gemfile
@@ -1,97 +1,96 @@
-source "http://rubygems.org"
+source 'https://rubygems.org'
gemspec
if ENV['AREL']
- gem "arel", :path => ENV['AREL']
+ gem 'arel', :path => ENV['AREL']
else
- gem "arel", :git => "git://github.com/rails/arel"
+ gem 'arel'
end
-gem "bcrypt-ruby", "~> 3.0.0"
-gem "jquery-rails"
+gem 'rack-test', :git => "https://github.com/brynary/rack-test.git"
+gem 'bcrypt-ruby', '~> 3.0.0'
+gem 'jquery-rails'
if ENV['JOURNEY']
- gem "journey", :path => ENV['JOURNEY']
+ gem 'journey', :path => ENV['JOURNEY']
else
- gem "journey", :git => "git://github.com/rails/journey"
+ gem 'journey', :git => "git://github.com/rails/journey"
end
# This needs to be with require false to avoid
# it being automatically loaded by sprockets
-gem "uglifier", ">= 1.0.3", :require => false
+gem 'uglifier', '>= 1.0.3', :require => false
-gem "rake", ">= 0.8.7"
-gem "mocha", ">= 0.9.8"
+gem 'sprockets-rails', :git => "git://github.com/rails/sprockets-rails.git"
+
+gem 'rake', '>= 0.8.7'
+gem 'mocha', '>= 0.9.8'
group :doc do
- gem "rdoc", "~> 3.4"
- gem "sdoc", "~> 0.3"
- gem "RedCloth", "~> 4.2" if RUBY_VERSION < "1.9.3"
- gem "w3c_validators"
+ # The current sdoc cannot generate GitHub links due
+ # to a bug, but the PR that fixes it has been there
+ # for some weeks unapplied. As a temporary solution
+ # this is our own fork with the fix.
+ gem 'sdoc', :git => 'git://github.com/fxn/sdoc.git'
+ gem 'RedCloth', '~> 4.2'
+ gem 'w3c_validators'
end
# AS
-gem "memcache-client", ">= 1.8.5"
-
-platforms :mri_18 do
- gem "system_timer"
- gem "json"
-end
+gem 'memcache-client', '>= 1.8.5'
# Add your own local bundler stuff
-instance_eval File.read ".Gemfile" if File.exists? ".Gemfile"
+local_gemfile = File.dirname(__FILE__) + "/.Gemfile"
+instance_eval File.read local_gemfile if File.exists? local_gemfile
platforms :mri do
group :test do
- gem "ruby-prof" if RUBY_VERSION < "1.9.3"
+ gem 'ruby-prof'
end
end
platforms :ruby do
- if ENV["RB_FSEVENT"]
- gem "rb-fsevent"
- end
- gem "json"
- gem "yajl-ruby"
- gem "nokogiri", ">= 1.4.5"
+ gem 'json'
+ gem 'yajl-ruby'
+ gem 'nokogiri', '>= 1.4.5'
# AR
- gem "sqlite3", "~> 1.3.5"
+ gem 'sqlite3', '~> 1.3.5'
group :db do
- gem "pg", ">= 0.11.0"
- gem "mysql", ">= 2.8.1"
- gem "mysql2", ">= 0.3.10"
+ gem 'pg', '>= 0.11.0'
+ gem 'mysql', '>= 2.8.1'
+ gem 'mysql2', '>= 0.3.10'
end
end
platforms :jruby do
- gem "json"
- gem "activerecord-jdbcsqlite3-adapter", ">= 1.2.0"
+ gem 'json'
+ gem 'activerecord-jdbcsqlite3-adapter', '>= 1.2.0'
# This is needed by now to let tests work on JRuby
# TODO: When the JRuby guys merge jruby-openssl in
# jruby this will be removed
- gem "jruby-openssl"
+ gem 'jruby-openssl'
group :db do
- gem "activerecord-jdbcmysql-adapter", ">= 1.2.0"
- gem "activerecord-jdbcpostgresql-adapter", ">= 1.2.0"
+ gem 'activerecord-jdbcmysql-adapter', '>= 1.2.0'
+ gem 'activerecord-jdbcpostgresql-adapter', '>= 1.2.0'
end
end
# gems that are necessary for ActiveRecord tests with Oracle database
if ENV['ORACLE_ENHANCED_PATH'] || ENV['ORACLE_ENHANCED']
platforms :ruby do
- gem "ruby-oci8", ">= 2.0.4"
+ gem 'ruby-oci8', '>= 2.0.4'
end
if ENV['ORACLE_ENHANCED_PATH']
- gem "activerecord-oracle_enhanced-adapter", :path => ENV['ORACLE_ENHANCED_PATH']
+ gem 'activerecord-oracle_enhanced-adapter', :path => ENV['ORACLE_ENHANCED_PATH']
else
- gem "activerecord-oracle_enhanced-adapter", :git => "git://github.com/rsim/oracle-enhanced.git"
+ gem 'activerecord-oracle_enhanced-adapter', :git => 'git://github.com/rsim/oracle-enhanced.git'
end
end
# A gem necessary for ActiveRecord tests with IBM DB
-gem "ibm_db" if ENV['IBM_DB']
+gem 'ibm_db' if ENV['IBM_DB']
View
2  RAILS_VERSION
@@ -1 +1 @@
-3.2.0.beta
+4.0.0.beta
View
7 README.rdoc
@@ -67,9 +67,12 @@ We encourage you to contribute to Ruby on Rails! Please check out the {Contribut
guide}[http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how
to proceed. {Join us}[http://contributors.rubyonrails.org]!
-== Travis Build Status {<img src="https://secure.travis-ci.org/rails/rails.png"/>}[http://travis-ci.org/rails/rails]
+== Build Status {<img src="https://secure.travis-ci.org/rails/rails.png"/>}[http://travis-ci.org/rails/rails]
+
+== Dependency Status {<img src="https://gemnasium.com/rails/rails.png?travis"/>}[https://gemnasium.com/rails/rails]
== License
-Ruby on Rails is released under the MIT license.
+Ruby on Rails is released under the MIT license:
+* http://www.opensource.org/licenses/MIT
View
10 RELEASING_RAILS.rdoc
@@ -25,12 +25,6 @@ for Rails. You can check the status of his tests here:
Do not release with Red AWDwR tests.
-=== Are the postgres tests green? If not, make them green
-
-Currently Travis CI doesn't run the Active Record postgres tests. They are
-working to resolve this, but in the mean time, it is crucial to ensure that
-the tests are still green before release.
-
=== Do we have any git dependencies? If so, contact those authors.
Having git dependencies indicates that we depend on unreleased code.
@@ -66,8 +60,6 @@ for today:
=== Is Sam Ruby happy? If not, make him happy.
-=== Are the postgres tests green? If not, make them green
-
=== Contact the security team. CVE emails must be sent on this day.
=== Create a release branch.
@@ -215,7 +207,7 @@ and generates and publishes stable docs if a new stable tag is detected.
The hook unfortunately is not invoked by tag pushing, so once the new stable
tag has been pushed to origin, please run
- curl -X POST -d '' http://rails-hooks.hashref.com/rails-master-hook
+ rake publish_docs
You should see something like this:
View
19 Rakefile
@@ -13,7 +13,7 @@ task :build => "all:build"
desc "Release all gems to gemcutter and create a tag"
task :release => "all:release"
-PROJECTS = %w(activesupport activemodel actionpack actionmailer activeresource activerecord railties)
+PROJECTS = %w(activesupport activemodel actionpack actionmailer activerecord railties)
desc 'Run all tests by default'
task :default => %w(test test:isolated)
@@ -77,9 +77,10 @@ RDoc::Task.new do |rdoc|
rdoc_main.gsub!(/^(?=\S).*?\b(?=Rails)\b/) { "#$&\\" }
rdoc_main.gsub!(%r{link:/rails/rails/blob/master/(\w+)/README\.rdoc}, "link:files/\\1/README_rdoc.html")
- # Remove Travis build status image from API pages. Only GitHub README page gets this image
- # https build image is used to avoid GitHub caching: http://about.travis-ci.org/docs/user/status-images
- rdoc_main.gsub!(%r{^== Travis.*}, '')
+ # Remove Travis and Gemnasium status images from API pages. Only GitHub
+ # README page gets these images. Travis' https build image is used to avoid
+ # GitHub caching: http://about.travis-ci.org/docs/user/status-images
+ rdoc_main.gsub!(%r{^== (Build|Dependency) Status.*}, '')
File.open(RDOC_MAIN, 'w') do |f|
f.write(rdoc_main)
@@ -93,7 +94,7 @@ RDoc::Task.new do |rdoc|
rdoc.options << '-f' << 'sdoc'
rdoc.options << '-T' << 'rails'
- rdoc.options << '-c' << 'utf-8'
+ rdoc.options << '-e' << 'UTF-8'
rdoc.options << '-g' # SDoc flag, link methods to GitHub
rdoc.options << '-m' << RDOC_MAIN
@@ -108,11 +109,6 @@ RDoc::Task.new do |rdoc|
rdoc.rdoc_files.include('activerecord/lib/active_record/**/*.rb')
rdoc.rdoc_files.exclude('activerecord/lib/active_record/vendor/*')
- rdoc.rdoc_files.include('activeresource/README.rdoc')
- rdoc.rdoc_files.include('activeresource/CHANGELOG.md')
- rdoc.rdoc_files.include('activeresource/lib/active_resource.rb')
- rdoc.rdoc_files.include('activeresource/lib/active_resource/*')
-
rdoc.rdoc_files.include('actionpack/README.rdoc')
rdoc.rdoc_files.include('actionpack/CHANGELOG.md')
rdoc.rdoc_files.include('actionpack/lib/abstract_controller/**/*.rb')
@@ -156,7 +152,6 @@ task :update_versions do
"activemodel" => "ActiveModel",
"actionpack" => "ActionPack",
"actionmailer" => "ActionMailer",
- "activeresource" => "ActiveResource",
"activerecord" => "ActiveRecord",
"railties" => "Rails"
}
@@ -189,7 +184,7 @@ end
#
desc 'Publishes docs, run this AFTER a new stable tag has been pushed'
task :publish_docs do
- Net::HTTP.new('rails-hooks.hashref.com').start do |http|
+ Net::HTTP.new('api.rubyonrails.org', 8080).start do |http|
request = Net::HTTP::Post.new('/rails-master-hook')
response = http.request(request)
puts response.body
View
60 actionmailer/CHANGELOG.md
@@ -1,14 +1,71 @@
+## Rails 3.2.3 (unreleased) ##
+
+* Upgrade mail version to 2.4.3 *ML*
+
+
+## Rails 3.2.2 (March 1, 2012) ##
+
+* No changes.
+
+
+## Rails 3.2.1 (January 26, 2012) ##
+
+* No changes.
+
+
+## Rails 3.2.0 (January 20, 2012) ##
+
+* Upgrade mail version to 2.4.0 *ML*
+
+* Remove Old ActionMailer API *Josh Kalderimis*
+
+
+## Rails 3.1.3 (November 20, 2011) ##
+
+* No changes
+
+
+## Rails 3.1.2 (November 18, 2011) ##
+
+* No changes
+
+
+## Rails 3.1.1 (October 7, 2011) ##
+
+* No changes
+
+
## Rails 3.1.0 (August 30, 2011) ##
* No changes
+## Rails 3.0.11 (November 18, 2011) ##
+
+* No changes.
+
+
+## Rails 3.0.10 (August 16, 2011) ##
+
+* No changes.
+
+
+## Rails 3.0.9 (June 16, 2011) ##
+
+* No changes.
+
+
+## Rails 3.0.8 (June 7, 2011) ##
+
+* Mail dependency increased to 2.2.19
+
+
## Rails 3.0.7 (April 18, 2011) ##
* remove AM delegating register_observer and register_interceptor to Mail *Josh Kalderimis*
-* Rails 3.0.6 (April 5, 2011)
+## Rails 3.0.6 (April 5, 2011) ##
* Don't allow i18n to change the minor version, version now set to ~> 0.5.0 *Santiago Pastorino*
@@ -76,6 +133,7 @@
* Mail does not have "quoted_body", "quoted_subject" etc. All of these are accessed via body.encoded, subject.encoded etc
* Every object in a Mail object returns an object, never a string. So Mail.body returns a Mail::Body class object, need to call #encoded or #decoded to get the string you want.
+
* Mail::Message#set_content_type does not exist, it is simply Mail::Message#content_type
* Every mail message gets a unique message_id unless you specify one, had to change all the tests that check for equality with expected.encoded == actual.encoded to first replace their message_ids with control values
View
2  actionmailer/MIT-LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2011 David Heinemeier Hansson
+Copyright (c) 2004-2012 David Heinemeier Hansson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
12 actionmailer/README.rdoc
@@ -42,7 +42,7 @@ So the corresponding body template for the method above could look like this:
Thank you for signing up!
-And if the recipient was given as "david@loudthinking.com", the email
+If the recipient was given as "david@loudthinking.com", the email
generated would look like this:
Date: Mon, 25 Jan 2010 22:48:09 +1100
@@ -62,7 +62,7 @@ generated would look like this:
Thank you for signing up!
In previous version of Rails you would call <tt>create_method_name</tt> and
-<tt>deliver_method_name</tt>. Rails 3.0 has a much simpler interface, you
+<tt>deliver_method_name</tt>. Rails 3.0 has a much simpler interface - you
simply call the method and optionally call +deliver+ on the return value.
Calling the method returns a Mail Message object:
@@ -76,13 +76,13 @@ Or you can just chain the methods together like:
== Setting defaults
-It is possible to set default values that will be used in every method in your Action Mailer class. To implement this functionality, you just call the public class method <tt>default</tt> which you get for free from ActionMailer::Base. This method accepts a Hash as the parameter. You can use any of the headers e-mail messages has, like <tt>:from</tt> as the key. You can also pass in a string as the key, like "Content-Type", but Action Mailer does this out of the box for you, so you won't need to worry about that. Finally it is also possible to pass in a Proc that will get evaluated when it is needed.
+It is possible to set default values that will be used in every method in your Action Mailer class. To implement this functionality, you just call the public class method <tt>default</tt> which you get for free from ActionMailer::Base. This method accepts a Hash as the parameter. You can use any of the headers e-mail messages has, like <tt>:from</tt> as the key. You can also pass in a string as the key, like "Content-Type", but Action Mailer does this out of the box for you, so you won't need to worry about that. Finally, it is also possible to pass in a Proc that will get evaluated when it is needed.
Note that every value you set with this method will get over written if you use the same key in your mailer method.
Example:
- class Authenticationmailer < ActionMailer::Base
+ class AuthenticationMailer < ActionMailer::Base
default :from => "awesome@application.com", :subject => Proc.new { "E-mail was generated at #{Time.now}" }
.....
end
@@ -148,7 +148,9 @@ Source code can be downloaded as part of the Rails project on GitHub
== License
-Action Mailer is released under the MIT license.
+Action Mailer is released under the MIT license:
+
+* http://www.opensource.org/licenses/MIT
== Support
View
1  actionmailer/Rakefile
@@ -11,6 +11,7 @@ Rake::TestTask.new { |t|
t.libs << "test"
t.pattern = 'test/**/*_test.rb'
t.warning = true
+ t.verbose = true
}
namespace :test do
View
4 actionmailer/actionmailer.gemspec
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
s.version = version
s.summary = 'Email composition, delivery, and receiving framework (part of Rails).'
s.description = 'Email on Rails. Compose, deliver, receive, and test emails using the familiar controller/view pattern. First-class support for multipart email and attachments.'
- s.required_ruby_version = '>= 1.8.7'
+ s.required_ruby_version = '>= 1.9.3'
s.author = 'David Heinemeier Hansson'
s.email = 'david@loudthinking.com'
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
s.requirements << 'none'
s.add_dependency('actionpack', version)
- s.add_dependency('mail', '~> 2.3.0')
+ s.add_dependency('mail', '~> 2.4.3')
end
View
3  actionmailer/lib/action_mailer.rb
@@ -1,5 +1,5 @@
#--
-# Copyright (c) 2004-2011 David Heinemeier Hansson
+# Copyright (c) 2004-2012 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,7 +31,6 @@
# Common Active Support usage in Action Mailer
require 'active_support/core_ext/class'
require 'active_support/core_ext/object/blank'
-require 'active_support/core_ext/array/uniq_by'
require 'active_support/core_ext/module/attr_internal'
require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/string/inflections'
View
58 actionmailer/lib/action_mailer/base.rb
@@ -1,8 +1,6 @@
require 'mail'
require 'action_mailer/collector'
-require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/object/blank'
-require 'active_support/core_ext/proc'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/hash/except'
require 'action_mailer/log_subscriber'
@@ -122,8 +120,8 @@ module ActionMailer #:nodoc:
#
# <%= users_url(:host => "example.com") %>
#
- # You should use the <tt>named_route_url</tt> style (which generates absolute URLs) and avoid using the
- # <tt>named_route_path</tt> style (which generates relative URLs), since clients reading the mail will
+ # You should use the <tt>named_route_url</tt> style (which generates absolute URLs) and avoid using the
+ # <tt>named_route_path</tt> style (which generates relative URLs), since clients reading the mail will
# have no concept of a current URL from which to determine a relative path.
#
# It is also possible to set a default host that will be used in all mailers by setting the <tt>:host</tt>
@@ -132,7 +130,7 @@ module ActionMailer #:nodoc:
# config.action_mailer.default_url_options = { :host => "example.com" }
#
# When you decide to set a default <tt>:host</tt> for your mailers, then you need to make sure to use the
- # <tt>:only_path => false</tt> option when using <tt>url_for</tt>. Since the <tt>url_for</tt> view helper
+ # <tt>:only_path => false</tt> option when using <tt>url_for</tt>. Since the <tt>url_for</tt> view helper
# will generate relative URLs by default when a <tt>:host</tt> option isn't explicitly provided, passing
# <tt>:only_path => false</tt> will ensure that absolute URLs are generated.
#
@@ -149,8 +147,8 @@ module ActionMailer #:nodoc:
#
# = Multipart Emails
#
- # Multipart messages can also be used implicitly because Action Mailer will automatically detect and use
- # multipart templates, where each template is named after the name of the action, followed by the content
+ # Multipart messages can also be used implicitly because Action Mailer will automatically detect and use
+ # multipart templates, where each template is named after the name of the action, followed by the content
# type. Each such detected template will be added as a separate part to the message.
#
# For example, if the following templates exist:
@@ -269,6 +267,33 @@ module ActionMailer #:nodoc:
# set something in the defaults using a proc, and then set the same thing inside of your
# mailer method, it will get over written by the mailer method.
#
+ # = Callbacks
+ #
+ # You can specify callbacks using before_filter and after_filter for configuring your messages.
+ # This may be useful, for example, when you want to add default inline attachments for all
+ # messages sent out by a certain mailer class:
+ #
+ # class Notifier < ActionMailer::Base
+ # before_filter :add_inline_attachment!
+ #
+ # def welcome
+ # mail
+ # end
+ #
+ # private
+ #
+ # def add_inline_attachment!
+ # attachments.inline["footer.jpg"] = File.read('/path/to/filename.jpg')
+ # end
+ # end
+ #
+ # Callbacks in ActionMailer are implemented using AbstractController::Callbacks, so you
+ # can define and configure callbacks in the same manner that you would use callbacks in
+ # classes that inherit from ActionController::Base.
+ #
+ # Note that unless you have a specific reason to do so, you should prefer using before_filter
+ # rather than after_filter in your ActionMailer classes so that headers are parsed properly.
+ #
# = Configuration options
#
# These options are specified on the class level, like
@@ -332,8 +357,9 @@ class Base < AbstractController::Base
include AbstractController::Helpers
include AbstractController::Translation
include AbstractController::AssetPaths
+ include AbstractController::Callbacks
- self.protected_instance_variables = %w(@_action_has_layout)
+ self.protected_instance_variables = [:@_action_has_layout]
helper ActionMailer::MailHelper
@@ -410,7 +436,7 @@ def receive(raw_mail)
# and passing a Mail::Message will do nothing except tell the logger you sent the email.
def deliver_mail(mail) #:nodoc:
ActiveSupport::Notifications.instrument("deliver.action_mailer") do |payload|
- self.set_payload_for_mail(payload, mail)
+ set_payload_for_mail(payload, mail)
yield # Let Mail do the delivery actions
end
end
@@ -603,9 +629,6 @@ def attachments
# end
#
def mail(headers={}, &block)
- # Guard flag to prevent both the old and the new API from firing
- # Should be removed when old API is removed
- @mail_was_called = true
m = @_message
# At the beginning, do not consider class default for parts order neither content_type
@@ -613,8 +636,9 @@ def mail(headers={}, &block)
parts_order = headers[:parts_order]
# Call all the procs (if any)
- default_values = self.class.default.merge(self.class.default) do |k,v|
- v.respond_to?(:call) ? v.bind(self).call : v
+ class_default = self.class.default
+ default_values = class_default.merge(class_default) do |k,v|
+ v.respond_to?(:to_proc) ? instance_eval(&v) : v
end
# Handle defaults
@@ -668,7 +692,7 @@ def set_content_type(m, user_content_type, class_default)
end
end
- # Translates the +subject+ using Rails I18n class under <tt>[:actionmailer, mailer_scope, action_name]</tt> scope.
+ # Translates the +subject+ using Rails I18n class under <tt>[mailer_scope, action_name]</tt> scope.
# If it does not find a translation for the +subject+ under the specified scope it will default to a
# humanized version of the <tt>action_name</tt>.
def default_i18n_subject #:nodoc:
@@ -707,8 +731,8 @@ def collect_responses_and_parts_order(headers) #:nodoc:
end
def each_template(paths, name, &block) #:nodoc:
- templates = lookup_context.find_all(name, Array.wrap(paths))
- templates.uniq_by { |t| t.formats }.each(&block)
+ templates = lookup_context.find_all(name, Array(paths))
+ templates.uniq { |t| t.formats }.each(&block)
end
def create_parts_from_responses(m, responses) #:nodoc:
View
4 actionmailer/lib/action_mailer/collector.rb
@@ -22,9 +22,9 @@ def any(*args, &block)
def custom(mime, options={})
options.reverse_merge!(:content_type => mime.to_s)
- @context.freeze_formats([mime.to_sym])
+ @context.formats = [mime.to_sym]
options[:body] = block_given? ? yield : @default_render.call
@responses << options
end
end
-end
+end
View
6 actionmailer/lib/action_mailer/log_subscriber.rb
@@ -1,9 +1,7 @@
-require 'active_support/core_ext/array/wrap'
-
module ActionMailer
class LogSubscriber < ActiveSupport::LogSubscriber
def deliver(event)
- recipients = Array.wrap(event.payload[:to]).join(', ')
+ recipients = Array(event.payload[:to]).join(', ')
info("\nSent mail to #{recipients} (%1.fms)" % event.duration)
debug(event.payload[:mail])
end
@@ -19,4 +17,4 @@ def logger
end
end
-ActionMailer::LogSubscriber.attach_to :action_mailer
+ActionMailer::LogSubscriber.attach_to :action_mailer
View
9 actionmailer/lib/action_mailer/mail_helper.rb
@@ -1,11 +1,10 @@
module ActionMailer
module MailHelper
- # Uses Text::Format to take the text and format it, indented two spaces for
- # each line, and wrapped at 72 columns.
+ # Take the text and format it, indented two spaces for each line, and wrapped at 72 columns.
def block_format(text)
- formatted = text.split(/\n\r\n/).collect { |paragraph|
+ formatted = text.split(/\n\r?\n/).collect { |paragraph|
format_paragraph(paragraph)
- }.join("\n")
+ }.join("\n\n")
# Make list points stand on their own line
formatted.gsub!(/[ ]*([*]+) ([^*]*)/) { |s| " #{$1} #{$2.strip}\n" }
@@ -41,7 +40,7 @@ def format_paragraph(text, len = 72, indent = 2)
sentences = [[]]
text.split.each do |word|
- if (sentences.last + [word]).join(' ').length > len
+ if sentences.first.present? && (sentences.last + [word]).join(' ').length > len
sentences << [word]
else
sentences.last << word
View
5 actionmailer/lib/action_mailer/railtie.rb
@@ -19,8 +19,9 @@ class Railtie < Rails::Railtie
options.stylesheets_dir ||= paths["public/stylesheets"].first
# make sure readers methods get compiled
- options.asset_path ||= app.config.asset_path
- options.asset_host ||= app.config.asset_host
+ options.asset_path ||= app.config.asset_path
+ options.asset_host ||= app.config.asset_host
+ options.relative_url_root ||= app.config.relative_url_root
ActiveSupport.on_load(:action_mailer) do
include AbstractController::UrlFor
View
1  actionmailer/lib/action_mailer/test_case.rb
@@ -1,3 +1,4 @@
+require 'active_support/test_case'
require 'active_support/core_ext/class/attribute'
module ActionMailer
View
2  actionmailer/lib/action_mailer/test_helper.rb
@@ -1,7 +1,5 @@
module ActionMailer
module TestHelper
- extend ActiveSupport::Concern
-
# Asserts that the number of emails sent matches the given number.
#
# def test_emails
View
4 actionmailer/lib/action_mailer/version.rb
@@ -1,7 +1,7 @@
module ActionMailer
module VERSION #:nodoc:
- MAJOR = 3
- MINOR = 2
+ MAJOR = 4
+ MINOR = 0
TINY = 0
PRE = "beta"
View
2  actionmailer/lib/rails/generators/mailer/USAGE
@@ -1,6 +1,6 @@
Description:
============
- Stubs out a new mailer and its views. Pass the mailer name, either
+ Stubs out a new mailer and its views. Passes the mailer name, either
CamelCased or under_scored, and an optional list of emails as arguments.
This generates a mailer class in app/mailers and invokes your template
View
4 actionmailer/lib/rails/generators/mailer/templates/mailer.rb
@@ -1,6 +1,6 @@
<% module_namespacing do -%>
class <%= class_name %> < ActionMailer::Base
- default <%= key_value :from, '"from@example.com"' %>
+ default from: "from@example.com"
<% actions.each do |action| -%>
# Subject can be set in your I18n file at config/locales/en.yml
@@ -11,7 +11,7 @@ class <%= class_name %> < ActionMailer::Base
def <%= action %>
@greeting = "Hi"
- mail <%= key_value :to, '"to@example.org"' %>
+ mail to: "to@example.org"
end
<% end -%>
end
View
15 actionmailer/test/abstract_unit.rb
@@ -13,20 +13,17 @@
require 'active_support/core_ext/kernel/reporting'
-require 'active_support/core_ext/string/encoding'
-if "ruby".encoding_aware?
- # These are the normal settings that will be set up by Railties
- # TODO: Have these tests support other combinations of these values
- silence_warnings do
- Encoding.default_internal = "UTF-8"
- Encoding.default_external = "UTF-8"
- end
+# These are the normal settings that will be set up by Railties
+# TODO: Have these tests support other combinations of these values
+silence_warnings do
+ Encoding.default_internal = "UTF-8"
+ Encoding.default_external = "UTF-8"
end
lib = File.expand_path("#{File.dirname(__FILE__)}/../lib")
$:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
-require 'test/unit'
+require 'minitest/autorun'
require 'action_mailer'
require 'action_mailer/test_case'
View
2  actionmailer/test/asset_host_test.rb
@@ -9,7 +9,7 @@ def email_with_asset
end
end
-class AssetHostTest < Test::Unit::TestCase
+class AssetHostTest < ActiveSupport::TestCase
def setup
set_delivery_method :test
ActionMailer::Base.perform_deliveries = true
View
54 actionmailer/test/base_test.rb
@@ -1,5 +1,7 @@
# encoding: utf-8
require 'abstract_unit'
+require 'set'
+
require 'active_support/time'
require 'mailers/base_mailer'
@@ -107,7 +109,7 @@ def teardown
assert_equal(1, email.attachments.length)
assert_equal('invoice.jpg', email.attachments[0].filename)
expected = "\312\213\254\232)b"
- expected.force_encoding(Encoding::BINARY) if '1.9'.respond_to?(:force_encoding)
+ expected.force_encoding(Encoding::BINARY)
assert_equal expected, email.attachments['invoice.jpg'].decoded
end
@@ -116,7 +118,7 @@ def teardown
assert_equal(1, email.attachments.length)
assert_equal('invoice.jpg', email.attachments[0].filename)
expected = "\312\213\254\232)b"
- expected.force_encoding(Encoding::BINARY) if '1.9'.respond_to?(:force_encoding)
+ expected.force_encoding(Encoding::BINARY)
assert_equal expected, email.attachments['invoice.jpg'].decoded
end
@@ -550,6 +552,52 @@ def self.delivering_email(mail)
assert_equal("Thanks for signing up this afternoon", mail.subject)
end
+ test "modifying the mail message with a before_filter" do
+ class BeforeFilterMailer < ActionMailer::Base
+ before_filter :add_special_header!
+
+ def welcome ; mail ; end
+
+ private
+ def add_special_header!
+ headers('X-Special-Header' => 'Wow, so special')
+ end
+ end
+
+ assert_equal('Wow, so special', BeforeFilterMailer.welcome['X-Special-Header'].to_s)
+ end
+
+ test "modifying the mail message with an after_filter" do
+ class AfterFilterMailer < ActionMailer::Base
+ after_filter :add_special_header!
+
+ def welcome ; mail ; end
+
+ private
+ def add_special_header!
+ headers('X-Special-Header' => 'Testing')
+ end
+ end
+
+ assert_equal('Testing', AfterFilterMailer.welcome['X-Special-Header'].to_s)
+ end
+
+ test "adding an inline attachment using a before_filter" do
+ class DefaultInlineAttachmentMailer < ActionMailer::Base
+ before_filter :add_inline_attachment!
+
+ def welcome ; mail ; end
+
+ private
+ def add_inline_attachment!
+ attachments.inline["footer.jpg"] = 'hey there'
+ end
+ end
+
+ mail = DefaultInlineAttachmentMailer.welcome
+ assert_equal('image/jpeg; filename=footer.jpg', mail.attachments.inline.first['Content-Type'].to_s)
+ end
+
test "action methods should be refreshed after defining new method" do
class FooMailer < ActionMailer::Base
# this triggers action_methods
@@ -559,7 +607,7 @@ def notify
end
end
- assert_equal ["notify"], FooMailer.action_methods
+ assert_equal Set.new(["notify"]), FooMailer.action_methods
end
protected
View
44 actionmailer/test/mail_helper_test.rb
@@ -22,6 +22,14 @@ def use_format_paragraph
end
end
+ def use_format_paragraph_with_long_first_word
+ @text = "Antidisestablishmentarianism is very long."
+
+ mail_with_defaults do |format|
+ format.html { render(:inline => "<%= format_paragraph @text, 10, 1 %>") }
+ end
+ end
+
def use_mailer
mail_with_defaults do |format|
format.html { render(:inline => "<%= mailer.message.subject %>") }
@@ -34,6 +42,23 @@ def use_message
end
end
+ def use_block_format
+ @text = <<-TEXT
+This is the
+first paragraph.
+
+The second
+ paragraph.
+
+* item1 * item2
+ * item3
+ TEXT
+
+ mail_with_defaults do |format|
+ format.html { render(:inline => "<%= block_format @text %>") }
+ end
+ end
+
protected
def mail_with_defaults(&block)
@@ -63,5 +88,24 @@ def test_use_format_paragraph
mail = HelperMailer.use_format_paragraph
assert_match " But soft! What\r\n light through\r\n yonder window\r\n breaks?", mail.body.encoded
end
+
+ def test_use_format_paragraph_with_long_first_word
+ mail = HelperMailer.use_format_paragraph_with_long_first_word
+ assert_equal " Antidisestablishmentarianism\r\n is very\r\n long.", mail.body.encoded
+ end
+
+ def test_use_block_format
+ mail = HelperMailer.use_block_format
+ expected = <<-TEXT
+ This is the first paragraph.
+
+ The second paragraph.
+
+ * item1
+ * item2
+ * item3
+ TEXT
+ assert_equal expected.gsub("\n", "\r\n"), mail.body.encoded
+ end
end
View
2  actionmailer/test/mail_layout_test.rb
@@ -43,7 +43,7 @@ def logout
end
end
-class LayoutMailerTest < Test::Unit::TestCase
+class LayoutMailerTest < ActiveSupport::TestCase
def setup
set_delivery_method :test
ActionMailer::Base.perform_deliveries = true
View
593 actionpack/CHANGELOG.md
@@ -1,4 +1,234 @@
-## Rails 3.2.0 (unreleased) ##
+## Rails 4.0.0 (unreleased) ##
+
+* Add `include_hidden` option to select tag. With `:include_hidden => false` select with `multiple` attribute doesn't generate hidden input with blank value. *Vasiliy Ermolovich*
+
+* Removed default `size` option from the `text_field`, `search_field`, `telephone_field`, `url_field`, `email_field` helpers. *Philip Arndt*
+
+* Removed default `cols` and `rows` options from the `text_area` helper. *Philip Arndt*
+
+* Adds support for layouts when rendering a partial with a given collection. *serabe*
+
+* Allows the route helper `root` to take a string argument. For example, `root 'pages#main'`. *bcardarella*
+
+* Forms of persisted records use always PATCH (via the `_method` hack). *fxn*
+
+* For resources, both PATCH and PUT are routed to the `update` action. *fxn*
+
+* Don't ignore `force_ssl` in development. This is a change of behavior - use a `:if` condition to recreate the old behavior.
+
+ class AccountsController < ApplicationController
+ force_ssl :if => :ssl_configured?
+
+ def ssl_configured?
+ !Rails.env.development?
+ end
+ end
+
+ *Pat Allan*
+
+* Adds support for the PATCH verb:
+ * Request objects respond to `patch?`.
+ * Routes have a new `patch` method, and understand `:patch` in the
+ existing places where a verb is configured, like `:via`.
+ * New method `patch` available in functional tests.
+ * If `:patch` is the default verb for updates, edits are
+ tunneled as PATCH rather than as PUT, and routing acts accordingly.
+ * New method `patch_via_redirect` available in integration tests.
+
+ *dlee*
+
+* Integration tests support the `OPTIONS` method. *Jeremy Kemper*
+
+* `expires_in` accepts a `must_revalidate` flag. If true, "must-revalidate"
+ is added to the Cache-Control header. *fxn*
+
+* Add `date_field` and `date_field_tag` helpers which render an `input[type="date"]` tag *Olek Janiszewski*
+
+* Adds `image_url`, `javascript_url`, `stylesheet_url`, `audio_url`, `video_url`, and `font_url`
+ to assets tag helper. These URL helpers will return the full path to your assets. This is useful
+ when you are going to reference this asset from external host. *Prem Sichanugrist*
+
+* Default responder will now always use your overridden block in `respond_with` to render your response. *Prem Sichanugrist*
+
+* Allow `value_method` and `text_method` arguments from `collection_select` and
+ `options_from_collection_for_select` to receive an object that responds to `:call`,
+ such as a `proc`, to evaluate the option in the current element context. This works
+ the same way with `collection_radio_buttons` and `collection_check_boxes`.
+
+ *Carlos Antonio da Silva + Rafael Mendonça França*
+
+* Add `collection_check_boxes` form helper, similar to `collection_select`:
+ Example:
+
+ collection_check_boxes :post, :author_ids, Author.all, :id, :name
+ # Outputs something like:
+ <input id="post_author_ids_1" name="post[author_ids][]" type="checkbox" value="1" />
+ <label for="post_author_ids_1">D. Heinemeier Hansson</label>
+ <input id="post_author_ids_2" name="post[author_ids][]" type="checkbox" value="2" />
+ <label for="post_author_ids_2">D. Thomas</label>
+ <input name="post[author_ids][]" type="hidden" value="" />
+
+ The label/check_box pairs can be customized with a block.
+
+ *Carlos Antonio da Silva + Rafael Mendonça França*
+
+* Add `collection_radio_buttons` form helper, similar to `collection_select`:
+ Example:
+
+ collection_radio_buttons :post, :author_id, Author.all, :id, :name
+ # Outputs something like:
+ <input id="post_author_id_1" name="post[author_id]" type="radio" value="1" />
+ <label for="post_author_id_1">D. Heinemeier Hansson</label>
+ <input id="post_author_id_2" name="post[author_id]" type="radio" value="2" />
+ <label for="post_author_id_2">D. Thomas</label>
+
+ The label/radio_button pairs can be customized with a block.
+
+ *Carlos Antonio da Silva + Rafael Mendonça França*
+
+* check_box with `:form` html5 attribute will now replicate the `:form`
+ attribute to the hidden field as well. *Carlos Antonio da Silva*
+
+* Turn off verbose mode of rack-cache, we still have X-Rack-Cache to
+ check that info. Closes #5245. *Santiago Pastorino*
+
+* `label` form helper accepts :for => nil to not generate the attribute. *Carlos Antonio da Silva*
+
+* Add `:format` option to number_to_percentage *Rodrigo Flores*
+
+* Add `config.action_view.logger` to configure logger for ActionView. *Rafael Mendonça França*
+
+* Deprecated ActionController::Integration in favour of ActionDispatch::Integration
+
+* Deprecated ActionController::IntegrationTest in favour of ActionDispatch::IntegrationTest
+
+* Deprecated ActionController::PerformanceTest in favour of ActionDispatch::PerformanceTest
+
+* Deprecated ActionController::AbstractRequest in favour of ActionDispatch::Request
+
+* Deprecated ActionController::Request in favour of ActionDispatch::Request
+
+* Deprecated ActionController::AbstractResponse in favour of ActionDispatch::Response
+
+* Deprecated ActionController::Response in favour of ActionDispatch::Response
+
+* Deprecated ActionController::Routing in favour of ActionDispatch::Routing
+
+* check_box helper with :disabled => true will generate a disabled hidden field to conform with the HTML convention where disabled fields are not submitted with the form.
+ This is a behavior change, previously the hidden tag had a value of the disabled checkbox.
+ *Tadas Tamosauskas*
+
+* `favicon_link_tag` helper will now use the favicon in app/assets by default. *Lucas Caton*
+
+* `ActionView::Helpers::TextHelper#highlight` now defaults to the
+ HTML5 `mark` element. *Brian Cardarella*
+
+
+## Rails 3.2.3 (unreleased) ##
+
+* Do not include the authenticity token in forms where remote: true as ajax forms use the meta-tag value *DHH*
+
+* Upgrade rack-cache to 1.2. *José Valim*
+
+* ActionController::SessionManagement is removed. *Santiago Pastorino*
+
+* Since the router holds references to many parts of the system like engines, controllers and the application itself, inspecting the route set can actually be really slow, therefore we default alias inspect to to_s. *José Valim*
+
+* Add a new line after the textarea opening tag. Closes #393 *Rafael Mendonça França*
+
+* Always pass a respond block from to responder. We should let the responder decide what to do with the given overridden response block, and not short circuit it. *Prem Sichanugrist*
+
+* Fixes layout rendering regression from 3.2.2. *José Valim*
+
+
+## Rails 3.2.2 (March 1, 2012) ##
+
+* Format lookup for partials is derived from the format in which the template is being rendered. Closes #5025 part 2 *Santiago Pastorino*
+
+* Use the right format when a partial is missing. Closes #5025. *Santiago Pastorino*
+
+* Default responder will now always use your overridden block in `respond_with` to render your response. *Prem Sichanugrist*
+
+* check_box helper with :disabled => true will generate a disabled hidden field to conform with the HTML convention where disabled fields are not submitted with the form.
+ This is a behavior change, previously the hidden tag had a value of the disabled checkbox.
+ *Tadas Tamosauskas*
+
+
+## Rails 3.2.1 (January 26, 2012) ##
+
+* Documentation improvements.
+
+* Allow `form.select` to accept ranges (regression). *Jeremy Walker*
+
+* `datetime_select` works with -/+ infinity dates. *Joe Van Dyk*
+
+
+## Rails 3.2.0 (January 20, 2012) ##
+
+* Add `config.action_dispatch.default_charset` to configure default charset for ActionDispatch::Response. *Carlos Antonio da Silva*
+
+* Deprecate setting default charset at controller level, use the new `config.action_dispatch.default_charset` instead. *Carlos Antonio da Silva*
+
+* Deprecate ActionController::UnknownAction in favour of AbstractController::ActionNotFound. *Carlos Antonio da Silva*
+
+* Deprecate ActionController::DoubleRenderError in favour of AbstractController::DoubleRenderError. *Carlos Antonio da Silva*
+
+* Deprecate method_missing handling for not found actions, use action_missing instead. *Carlos Antonio da Silva*
+
+* Deprecate ActionController#rescue_action, ActionController#initialize_template_class, and ActionController#assign_shortcuts.
+ These methods were not being used internally anymore and are going to be removed in Rails 4. *Carlos Antonio da Silva*
+
+* Use a BodyProxy instead of including a Module that responds to
+ close. Closes #4441 if Active Record is disabled assets are delivered
+ correctly *Santiago Pastorino*
+
+* Rails initialization with initialize_on_precompile = false should set assets_dir *Santiago Pastorino*
+
+* Add font_path helper method *Santiago Pastorino*
+
+* Depends on rack ~> 1.4.0 *Santiago Pastorino*
+
+* Add :gzip option to `caches_page`. The default option can be configured globally using `page_cache_compression` *Andrey Sitnik*
+
+* The ShowExceptions middleware now accepts a exceptions application that is responsible to render an exception when the application fails. The application is invoked with a copy of the exception in `env["action_dispatch.exception"]` and with the PATH_INFO rewritten to the status code. *José Valim*
+
+* Add `button_tag` support to ActionView::Helpers::FormBuilder.
+
+ This support mimics the default behavior of `submit_tag`.
+
+ Example:
+
+ <%= form_for @post do |f| %>
+ <%= f.button %>
+ <% end %>
+
+* Date helpers accept a new option, `:use_two_digit_numbers = true`, that renders select boxes for months and days with a leading zero without changing the respective values.
+ For example, this is useful for displaying ISO8601-style dates such as '2011-08-01'. *Lennart Fridén and Kim Persson*
+
+* Make ActiveSupport::Benchmarkable a default module for ActionController::Base, so the #benchmark method is once again available in the controller context like it used to be *DHH*
+
+* Deprecated implied layout lookup in controllers whose parent had a explicit layout set:
+
+ class ApplicationController
+ layout "application"
+ end
+
+ class PostsController < ApplicationController
+ end
+
+ In the example above, Posts controller will no longer automatically look up for a posts layout.
+
+ If you need this functionality you could either remove `layout "application"` from ApplicationController or explicitly set it to nil in PostsController. *José Valim*
+
+* Rails will now use your default layout (such as "layouts/application") when you specify a layout with `:only` and `:except` condition, and those conditions fail. *Prem Sichanugrist*
+
+ For example, consider this snippet:
+
+ class CarsController
+ layout 'single_car', :only => :show
+ end
+
+ Rails will use 'layouts/single_car' when a request comes in `:show` action, and use 'layouts/application' (or 'layouts/cars', if exists) when a request comes in for any other actions.
* form_for with +:as+ option uses "#{action}_#{as}" as css class and id:
@@ -30,9 +260,9 @@
<%= f.text_field :version %>
<% end %>
-* Refactor ActionDispatch::ShowExceptions. Controller is responsible for choice to show exceptions. *Sergey Nartimov*
+* Refactor ActionDispatch::ShowExceptions. The controller is responsible for choosing to show exceptions when `consider_all_requests_local` is false.
- It's possible to override +show_detailed_exceptions?+ in controllers to specify which requests should provide debugging information on errors.
+ It's possible to override `show_detailed_exceptions?` in controllers to specify which requests should provide debugging information on errors. The default value is now false, meaning local requests in production will no longer show the detailed exceptions page unless `show_detailed_exceptions?` is overridden and set to `request.local?`.
* Responders now return 204 No Content for API requests without a response body (as in the new scaffold) *José Valim*
@@ -96,22 +326,40 @@
persistent between requests so if you need to manipulate the environment
for your test you need to do it before the cookie jar is created.
-## Rails 3.1.4 (unreleased) ##
+* ActionController::ParamsWrapper on ActiveRecord models now only wrap
+ attr_accessible attributes if they were set, if not, only the attributes
+ returned by the class method attribute_names will be wrapped. This fixes
+ the wrapping of nested attributes by adding them to attr_accessible.
+
+
+## Rails 3.1.4 (March 1, 2012) ##
+
+* Skip assets group in Gemfile and all assets configurations options
+ when the application is generated with --skip-sprockets option.
+
+ *Guillermo Iguaran*
+
+* Use ProcessedAsset#pathname in Sprockets helpers when debugging is on. Closes #3333 #3348 #3361.
+
+ *Guillermo Iguaran*
* Allow to use asset_path on named_routes aliasing RailsHelper's
asset_path to path_to_asset *Adrian Pike*
-* Assets should use the request protocol by default or default to
- relative if no request is available *Jonathan del Strother*
+* Assets should use the request protocol by default or default to relative if no request is available *Jonathan del Strother*
-## Rails 3.1.3 (unreleased) ##
-* Fix using `tranlate` helper with a html translation which uses the `:count` option for
+## Rails 3.1.3 (November 20, 2011) ##
+
+* Downgrade sprockets to ~> 2.0.3. Using 2.1.0 caused regressions.
+
+* Fix using `translate` helper with a html translation which uses the `:count` option for
pluralization.
*Jon Leighton*
-## Rails 3.1.2 (unreleased) ##
+
+## Rails 3.1.2 (November 18, 2011) ##
* Fix XSS security vulnerability in the `translate` helper method. When using interpolation
in combination with HTML-safe translations, the interpolated input would not get HTML
@@ -152,26 +400,34 @@
* Ensure users upgrading from 3.0.x to 3.1.x will properly upgrade their flash object in session (issues #3298 and #2509)
-## Rails 3.1.1 (unreleased) ##
+
+## Rails 3.1.1 (October 07, 2011) ##
* javascript_path and stylesheet_path now refer to /assets if asset pipelining
- is on. [Santiago Pastorino]
+ is on. *Santiago Pastorino*
+
* button_to support form option. Now you're able to pass for example
- 'data-type' => 'json'. [ihower]
+ 'data-type' => 'json'. *ihower*
+
* image_path and image_tag should use /assets if asset pipelining is turned
- on. Closes #3126 [Santiago Pastorino and christos]
+ on. Closes #3126 *Santiago Pastorino and christos*
+
* Avoid use of existing precompiled assets during rake assets:precompile run.
- Closes #3119 [Guillermo Iguaran]
+ Closes #3119 *Guillermo Iguaran*
+
* Copy assets to nondigested filenames too *Santiago Pastorino*
* Give precedence to `config.digest = false` over the existence of
- manifest.yml asset digests [christos]
+ manifest.yml asset digests *christos*
+
* escape options for the stylesheet_link_tag method *Alexey Vakhov*
* Re-launch assets:precompile task using (Rake.)ruby instead of Kernel.exec so
- it works on Windows [cablegram]
-* env var passed to process shouldn't be modified in process method. [Santiago
- Pastorino]
+ it works on Windows *cablegram*
+
+* env var passed to process shouldn't be modified in process method. *Santiago
+ Pastorino*
+
* `rake assets:precompile` loads the application but does not initialize
it.
To the app developer, this means configuration add in
@@ -186,7 +442,8 @@
* Fix Hash#to_query edge case with html_safe strings. *brainopia*
* Allow asset tag helper methods to accept :digest => false option in order to completely avoid the digest generation.
- Useful for linking assets from static html files or from emails when the user could probably look at an older html email with an older asset. [Santiago Pastorino]
+ Useful for linking assets from static html files or from emails when the user could probably look at an older html email with an older asset. *Santiago Pastorino*
+
* Don't mount Sprockets server at config.assets.prefix if config.assets.compile is false. *Mark J. Titorenko*
* Set relative url root in assets when controller isn't available for Sprockets (eg. Sass files using asset_path). Fixes #2435 *Guillermo Iguaran*
@@ -343,6 +600,7 @@
* ActionDispatch::MiddlewareStack now uses composition over inheritance. It is
no longer an array which means there may be methods missing that were not tested.
+
* Add an :authenticity_token option to form_tag for custom handling or to omit the token (pass :authenticity_token => false). *Jakub Kuźma, Igor Wiedler*
* HTML5 button_tag helper. *Rizwan Reza*
@@ -379,12 +637,102 @@
* Add Rack::Cache to the default stack. Create a Rails store that delegates to the Rails cache, so by default, whatever caching layer you are using will be used for HTTP caching. Note that Rack::Cache will be used if you use #expires_in, #fresh_when or #stale with :public => true. Otherwise, the caching rules will apply to the browser only. *Yehuda Katz, Carl Lerche*
+## Rails 3.0.12 (March 1, 2012) ##
+
+* Fix using `tranlate` helper with a html translation which uses the `:count` option for
+ pluralization.
+
+ *Jon Leighton*
+
+
+## Rails 3.0.11 (November 18, 2011) ##
+
+* Fix XSS security vulnerability in the `translate` helper method. When using interpolation
+ in combination with HTML-safe translations, the interpolated input would not get HTML
+ escaped. *GH 3664*
+
+ Before:
+
+ translate('foo_html', :something => '<script>') # => "...<script>..."
+
+ After:
+
+ translate('foo_html', :something => '<script>') # => "...&lt;script&gt;..."
+
+ *Sergey Nartimov*
+
+* Implement a workaround for a bug in ruby-1.9.3p0 where an error would be
+ raised while attempting to convert a template from one encoding to another.
+
+ Please see http://redmine.ruby-lang.org/issues/5564 for details of the bug.
+
+ The workaround is to load all conversions into memory ahead of time, and will
+ only happen if the ruby version is exactly 1.9.3p0. The hope is obviously
+ that the underlying problem will be resolved in the next patchlevel release
+ of 1.9.3.
+
+* Fix assert_select_email to work on multipart and non-multipart emails as the method stopped working correctly in Rails 3.x due to changes in the new mail gem.
+
+* Fix url_for when passed a hash to prevent additional options (eg. :host, :protocol) from being added to the hash after calling it.
+
+
+## Rails 3.0.10 (August 16, 2011) ##
+
+* Fixes an issue where cache sweepers with only after filters would have no
+ controller object, it would raise undefined method controller_name for nil [jeroenj]
+
+* Ensure status codes are logged when exceptions are raised.
+
+* Subclasses of OutputBuffer are respected.
+
+* Fixed ActionView::FormOptionsHelper#select with :multiple => false
+
+* Avoid extra call to Cache#read in case of a fragment cache hit
+
+
+## Rails 3.0.9 (June 16, 2011) ##
+
+* json_escape will now return a SafeBuffer string if it receives SafeBuffer string [tenderlove]
+
+* Make sure escape_js returns SafeBuffer string if it receives SafeBuffer string [Prem Sichanugrist]
+
+* Fix text helpers to work correctly with the new SafeBuffer restriction [Paul Gallagher, Arun Agrawal, Prem Sichanugrist]
+
+
+## Rails 3.0.8 (June 7, 2011) ##
+
+* It is prohibited to perform a in-place SafeBuffer mutation [tenderlove]
+
+ The old behavior of SafeBuffer allowed you to mutate string in place via
+ method like `sub!`. These methods can add unsafe strings to a safe buffer,
+ and the safe buffer will continue to be marked as safe.
+
+ An example problem would be something like this:
+
+ <%= link_to('hello world', @user).sub!(/hello/, params[:xss]) %>
+
+ In the above example, an untrusted string (`params[:xss]`) is added to the
+ safe buffer returned by `link_to`, and the untrusted content is successfully
+ sent to the client without being escaped. To prevent this from happening
+ `sub!` and other similar methods will now raise an exception when they are called on a safe buffer.
+
+ In addition to the in-place versions, some of the versions of these methods which return a copy of the string will incorrectly mark strings as safe. For example:
+
+ <%= link_to('hello world', @user).sub(/hello/, params[:xss]) %>
+
+ The new versions will now ensure that *all* strings returned by these methods on safe buffers are marked unsafe.
+
+ You can read more about this change in http://groups.google.com/group/rubyonrails-security/browse_thread/thread/2e516e7acc96c4fb
+
+* Fixed github issue #342 with asset paths and relative roots.
+
+
## Rails 3.0.7 (April 18, 2011) ##
* No changes.
-* Rails 3.0.6 (April 5, 2011)
+## Rails 3.0.6 (April 5, 2011) ##
* Fixed XSS vulnerability in `auto_link`. `auto_link` no longer marks input as
html safe. Please make sure that calls to auto_link() are wrapped in a
@@ -573,7 +921,7 @@
* Added ActionDispatch::Request#authorization to access the http authentication header regardless of its proxy hiding *DHH*
-* Added :alert, :notice, and :flash as options to ActionController::Base#redirect_to that'll automatically set the proper flash before the redirection [DHH]. Examples:
+* Added :alert, :notice, and :flash as options to ActionController::Base#redirect_to that'll automatically set the proper flash before the redirection *DHH*. Examples:
flash[:notice] = 'Post was created'
redirect_to(@post)
@@ -584,7 +932,6 @@
* Added ActionController::Base#notice/= and ActionController::Base#alert/= as a convenience accessors in both the controller and the view for flash[:notice]/= and flash[:alert]/= *DHH*
-
* Introduce grouped_collection_select helper. #1249 *Dan Codeape, Erik Ostrom*
* Make sure javascript_include_tag/stylesheet_link_tag does not append ".js" or ".css" onto external urls. #1664 *Matthew Rudy Jacobs*
@@ -624,19 +971,19 @@
* Make the form_for and fields_for helpers support the new Active Record nested update options. #1202 *Eloy Duran*
- <% form_for @person do |person_form| %>
+ <% form_for @person do |person_form| %>
...
<% person_form.fields_for :projects do |project_fields| %>
<% if project_fields.object.active? %>
Name: <%= project_fields.text_field :name %>
<% end %>
<% end %>
- <% end %>
+ <% end %>
* Added grouped_options_for_select helper method for wrapping option tags in optgroups. #977 *Jon Crawford*
-* Implement HTTP Digest authentication. #1230 [Gregg Kellogg, Pratik Naik] Example :
+* Implement HTTP Digest authentication. #1230 *Gregg Kellogg, Pratik Naik* Example :
class DummyDigestController < ActionController::Base
USERS = { "lifo" => 'world' }
@@ -674,7 +1021,7 @@
* Fixed the AssetTagHelper cache to use the computed asset host as part of the cache key instead of just assuming the its a string #1299 *DHH*
-* Make ActionController#render(string) work as a shortcut for render :file/:template/:action => string. [#1435] [Pratik Naik] Examples:
+* Make ActionController#render(string) work as a shortcut for render :file/:template/:action => string. #1435 *Pratik Naik* Examples:
\# Instead of render(:action => 'other_action')
render('other_action') # argument has no '/'
@@ -706,7 +1053,7 @@
* Remove deprecated ActionController::Base#assign_default_content_type_and_charset
-* Changed the default of ActionView#render to assume partials instead of files when not given an options hash [David Heinemeier Hansson]. Examples:
+* Changed the default of ActionView#render to assume partials instead of files when not given an options hash *DHH*. Examples:
# Instead of <%= render :partial => "account" %>
<%= render "account" %>
@@ -764,7 +1111,7 @@
* Fix incorrect closing CDATA delimiter and that HTML::Node.parse would blow up on unclosed CDATA sections *packagethief*
-* Added stale? and fresh_when methods to provide a layer of abstraction above request.fresh? and friends [David Heinemeier Hansson]. Example:
+* Added stale? and fresh_when methods to provide a layer of abstraction above request.fresh? and friends *DHH*. Example:
class ArticlesController < ApplicationController
def show_with_respond_to_block
@@ -798,7 +1145,7 @@
end
-* Added inline builder yield to atom_feed_helper tags where appropriate [Sam Ruby]. Example:
+* Added inline builder yield to atom_feed_helper tags where appropriate *Sam Ruby*. Example:
entry.summary :type => 'xhtml' do |xhtml|
xhtml.p pluralize(order.line_items.count, "line item")
@@ -820,7 +1167,7 @@
* Changed BenchmarkHelper#benchmark to report in milliseconds *David Heinemeier Hansson*
-* Changed logging format to be millisecond based and skip misleading stats [David Heinemeier Hansson]. Went from:
+* Changed logging format to be millisecond based and skip misleading stats *DHH*. Went from:
Completed in 0.10000 (4 reqs/sec) | Rendering: 0.04000 (40%) | DB: 0.00400 (4%) | 200 OK [http://example.com]
@@ -904,7 +1251,7 @@
* Deprecated TemplateHandler line offset *Josh Peek*
-* Allow caches_action to accept cache store options. #416. [José Valim]. Example:
+* Allow caches_action to accept cache store options. #416. *José Valim*. Example:
caches_action :index, :redirected, :if => Proc.new { |c| !c.request.format.json? }, :expires_in => 1.hour
@@ -934,7 +1281,7 @@
* Replaced TemplateFinder abstraction with ViewLoadPaths *Josh Peek*
-* Added block-call style to link_to [Sam Stephenson/David Heinemeier Hansson]. Example:
+* Added block-call style to link_to *Sam Stephenson/David Heinemeier Hansson*. Example:
<% link_to(@profile) do %>
<strong><%= @profile.name %></strong> -- <span>Check it out!!</span>
@@ -1157,7 +1504,7 @@
* Added OPTIONS to list of default accepted HTTP methods #10449 *holoway*
-* Added option to pass proc to ActionController::Base.asset_host for maximum configurability #10521 [Cheah Chu Yeow]. Example:
+* Added option to pass proc to ActionController::Base.asset_host for maximum configurability #10521 *Cheah Chu Yeow*. Example:
ActionController::Base.asset_host = Proc.new { |source|
if source.starts_with?('/images')
@@ -1202,7 +1549,7 @@
* Update to Prototype -r8232. *sam*
-* Make sure the optimisation code for routes doesn't get used if :host, :anchor or :port are provided in the hash arguments. [pager, Michael Koziarski] #10292
+* Make sure the optimisation code for routes doesn't get used if :host, :anchor or :port are provided in the hash arguments. *pager, Michael Koziarski* #10292
* Added protection from trailing slashes on page caching #10229 *devrieda*
@@ -1374,9 +1721,9 @@
* Don't warn when a path segment precedes a required segment. Closes #9615. *Nicholas Seckar*
-* Fixed CaptureHelper#content_for to work with the optional content parameter instead of just the block #9434 [sandofsky/wildchild].
+* Fixed CaptureHelper#content_for to work with the optional content parameter instead of just the block #9434 *sandofsky/wildchild*.
-* Added Mime::Type.register_alias for dealing with different formats using the same mime type [David Heinemeier Hansson]. Example:
+* Added Mime::Type.register_alias for dealing with different formats using the same mime type *DHH*. Example:
class PostsController < ApplicationController
before_filter :adjust_format_for_iphone
@@ -1399,7 +1746,7 @@
end
end
-* Added that render :json will automatically call .to_json unless it's being passed a string [David Heinemeier Hansson].
+* Added that render :json will automatically call .to_json unless it's being passed a string *DHH*.
* Autolink behaves well with emails embedded in URLs. #7313 *Jeremy McAnally, Tarmo Tänav*
@@ -1423,7 +1770,7 @@
* Removed deprecated form of calling xml_http_request/xhr without the first argument being the http verb *David Heinemeier Hansson*
-* Removed deprecated methods [David Heinemeier Hansson]:
+* Removed deprecated methods *DHH*:
- ActionController::Base#keep_flash (use flash.keep instead)
- ActionController::Base#expire_matched_fragments (just call expire_fragment with a regular expression)
@@ -1539,7 +1886,7 @@
* Reduce file stat calls when checking for template changes. #7736 *alex*
-* Added custom path cache_page/expire_page parameters in addition to the options hashes [David Heinemeier Hansson]. Example:
+* Added custom path cache_page/expire_page parameters in addition to the options hashes *DHH*. Example:
def index
caches_page(response.body, "/index.html")
@@ -1577,7 +1924,7 @@
* Update to Prototype 1.5.1. *Sam Stephenson*
-* Allow routes to be decalred under namespaces [Tobias Lütke]:
+* Allow routes to be decalred under namespaces *Tobias Lütke*:
map.namespace :admin do |admin|
admin.root :controller => "products"
@@ -1592,7 +1939,7 @@
* select :include_blank option can be set to a string instead of true, which just uses an empty string. #7664 *Wizard*
-* Added url_for usage on render :location, which allows for record identification [David Heinemeier Hansson]. Example:
+* Added url_for usage on render :location, which allows for record identification *DHH*. Example:
render :xml => person, :status => :created, :location => person
@@ -1618,7 +1965,7 @@
end
end
-* Added record identifications to FormHelper#form_for and PrototypeHelper#remote_form_for [David Heinemeier Hansson]. Examples:
+* Added record identifications to FormHelper#form_for and PrototypeHelper#remote_form_for *DHH*. Examples:
<% form_for(@post) do |f| %>
...
@@ -1644,7 +1991,7 @@
* Rationalize route path escaping according to RFC 2396 section 3.3. #7544, #8307. *Jeremy Kemper, Chris Roos, begemot, jugend*
-* Added record identification with polymorphic routes for ActionController::Base#url_for and ActionView::Base#url_for [David Heinemeier Hansson]. Examples:
+* Added record identification with polymorphic routes for ActionController::Base#url_for and ActionView::Base#url_for *DHH*. Examples:
redirect_to(post) # => redirect_to(posts_url(post)) => Location: http://example.com/posts/1
link_to(post.title, post) # => link_to(post.title, posts_url(post)) => <a href="/posts/1">Hello world</a>
@@ -1675,13 +2022,13 @@
* Update UrlWriter to accept :anchor parameter. Closes #6771. *Chris McGrath*
-* Added RecordTagHelper for using RecordIdentifier conventions on divs and other container elements [David Heinemeier Hansson]. Example:
+* Added RecordTagHelper for using RecordIdentifier conventions on divs and other container elements *DHH*. Example:
<% div_for(post) do %> <div id="post_45" class="post">
<%= post.body %> What a wonderful world!
<% end %> </div>
-* Added page[record] accessor to JavaScriptGenerator that relies on RecordIdentifier to find the right dom id [David Heinemeier Hansson]. Example:
+* Added page[record] accessor to JavaScriptGenerator that relies on RecordIdentifier to find the right dom id