Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Deletes trailing whitespaces (over text files only find * -type f -ex…

…ec sed 's/[ \t]*$//' -i {} \;)
  • Loading branch information...
commit b451de0d6de4df6bc66b274cec73b919f823d5ae 1 parent 1590377
@spastorino spastorino authored
Showing with 1,920 additions and 1,922 deletions.
  1. +2 −2 README.rdoc
  2. +4 −4 actionmailer/CHANGELOG
  3. +11 −11 actionmailer/README.rdoc
  4. +11 −11 actionmailer/lib/action_mailer/base.rb
  5. +2 −2 actionmailer/lib/action_mailer/delivery_methods.rb
  6. +2 −2 actionmailer/lib/action_mailer/mail_helper.rb
  7. +16 −16 actionmailer/lib/action_mailer/old_api.rb
  8. +3 −3 actionmailer/lib/action_mailer/tmail_compat.rb
  9. +8 −8 actionmailer/test/base_test.rb
  10. +3 −3 actionmailer/test/delivery_methods_test.rb
  11. +1 −1  actionmailer/test/fixtures/raw_email10
  12. +1 −1  actionmailer/test/fixtures/raw_email2
  13. +1 −1  actionmailer/test/fixtures/raw_email3
  14. +1 −1  actionmailer/test/fixtures/raw_email5
  15. +1 −1  actionmailer/test/fixtures/raw_email6
  16. +1 −1  actionmailer/test/fixtures/raw_email8
  17. +5 −5 actionmailer/test/fixtures/raw_email9
  18. +1 −1  actionmailer/test/fixtures/templates/signed_up.erb
  19. +2 −2 actionmailer/test/fixtures/test_mailer/custom_templating_extension.html.haml
  20. +2 −2 actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.haml
  21. +1 −1  actionmailer/test/fixtures/test_mailer/signed_up.html.erb
  22. +1 −1  actionmailer/test/fixtures/url_test_mailer/signed_up_with_url.erb
  23. +3 −3 actionmailer/test/mailers/proc_mailer.rb
  24. +15 −15 actionmailer/test/old_base/mail_service_test.rb
  25. +1 −1  actionmailer/test/old_base/tmail_compat_test.rb
  26. +1 −1  actionmailer/test/old_base/url_test.rb
  27. +12 −12 actionmailer/test/test_helper_test.rb
  28. +2 −2 actionpack/CHANGELOG
  29. +2 −2 actionpack/README.rdoc
  30. +2 −2 actionpack/RUNNING_UNIT_TESTS
  31. +1 −1  actionpack/lib/abstract_controller/base.rb
  32. +2 −2 actionpack/lib/action_controller/metal/http_authentication.rb
  33. +1 −1  actionpack/lib/action_controller/middleware.rb
  34. +1 −1  actionpack/lib/action_controller/test_case.rb
  35. +2 −2 actionpack/lib/action_controller/vendor/html-scanner/html/document.rb
  36. +29 −29 actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
  37. +25 −25 actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
  38. +1 −1  actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb
  39. +8 −8 actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb
  40. +10 −10 actionpack/lib/action_dispatch/http/mime_type.rb
  41. +1 −1  actionpack/lib/action_dispatch/middleware/stack.rb
  42. +4 −4 actionpack/lib/action_dispatch/routing.rb
  43. +1 −1  actionpack/lib/action_view/helpers/debug_helper.rb
  44. +8 −8 actionpack/lib/action_view/helpers/form_options_helper.rb
  45. +8 −8 actionpack/lib/action_view/helpers/form_tag_helper.rb
  46. +1 −1  actionpack/lib/action_view/helpers/number_helper.rb
  47. +1 −1  actionpack/lib/action_view/helpers/raw_output_helper.rb
  48. +2 −2 actionpack/lib/action_view/helpers/sanitize_helper.rb
  49. +2 −2 actionpack/lib/action_view/helpers/text_helper.rb
  50. +9 −9 actionpack/lib/action_view/helpers/translation_helper.rb
  51. +1 −1  actionpack/lib/action_view/log_subscriber.rb
  52. +1 −1  actionpack/lib/action_view/template/handler.rb
  53. +1 −1  actionpack/lib/action_view/template/handlers.rb
  54. +1 −1  actionpack/lib/action_view/test_case.rb
  55. +1 −1  actionpack/lib/action_view/testing/resolvers.rb
  56. +46 −46 actionpack/test/abstract/callbacks_test.rb
  57. +4 −4 actionpack/test/abstract/helper_test.rb
  58. +4 −4 actionpack/test/abstract/translation_test.rb
  59. +1 −1  actionpack/test/abstract_unit.rb
  60. +1 −1  actionpack/test/controller/assert_select_test.rb
  61. +6 −6 actionpack/test/controller/base_test.rb
  62. +1 −1  actionpack/test/controller/dispatcher_test.rb
  63. +1 −1  actionpack/test/controller/filters_test.rb
  64. +7 −7 actionpack/test/controller/helper_test.rb
  65. +3 −3 actionpack/test/controller/http_basic_authentication_test.rb
  66. +3 −3 actionpack/test/controller/http_token_authentication_test.rb
  67. +2 −2 actionpack/test/controller/layout_test.rb
  68. +5 −5 actionpack/test/controller/mime_responds_test.rb
  69. +1 −1  actionpack/test/controller/new_base/etag_test.rb
  70. +2 −2 actionpack/test/controller/new_base/render_implicit_action_test.rb
  71. +1 −1  actionpack/test/controller/new_base/render_layout_test.rb
  72. +7 −7 actionpack/test/controller/new_base/render_partial_test.rb
  73. +1 −1  actionpack/test/controller/new_base/render_test.rb
  74. +12 −12 actionpack/test/controller/new_base/render_text_test.rb
  75. +1 −1  actionpack/test/controller/new_base/render_xml_test.rb
  76. +2 −2 actionpack/test/controller/render_test.rb
  77. +1 −1  actionpack/test/controller/rescue_test.rb
  78. +4 −4 actionpack/test/controller/selector_test.rb
  79. +1 −1  actionpack/test/controller/test_test.rb
  80. +2 −2 actionpack/test/controller/view_paths_test.rb
  81. +1 −1  actionpack/test/dispatch/callbacks_test.rb
  82. +1 −1  actionpack/test/dispatch/mount_test.rb
  83. +1 −1  actionpack/test/dispatch/request_test.rb
  84. +4 −4 actionpack/test/dispatch/session/cookie_store_test.rb
  85. +1 −1  actionpack/test/dispatch/session/mem_cache_store_test.rb
  86. +1 −1  actionpack/test/fixtures/companies.yml
  87. +1 −1  actionpack/test/fixtures/company.rb
  88. +10 −10 actionpack/test/fixtures/db_definitions/sqlite.sql
  89. +1 −1  actionpack/test/fixtures/replies.yml
  90. +1 −1  actionpack/test/fixtures/test/hello_xml_world.builder
  91. +1 −1  actionpack/test/fixtures/topics.yml
  92. +1 −1  actionpack/test/template/compiled_templates_test.rb
  93. +1 −1  actionpack/test/template/date_helper_i18n_test.rb
  94. +14 −14 actionpack/test/template/date_helper_test.rb
  95. +1 −1  actionpack/test/template/erb_util_test.rb
  96. +6 −6 actionpack/test/template/form_options_helper_test.rb
  97. +1 −1  actionpack/test/template/html-scanner/document_test.rb
  98. +9 −9 actionpack/test/template/html-scanner/node_test.rb
  99. +17 −17 actionpack/test/template/html-scanner/sanitizer_test.rb
  100. +23 −23 actionpack/test/template/html-scanner/tag_node_test.rb
  101. +5 −5 actionpack/test/template/html-scanner/text_node_test.rb
  102. +10 −10 actionpack/test/template/html-scanner/tokenizer_test.rb
  103. +1 −1  actionpack/test/template/number_helper_test.rb
  104. +3 −3 actionpack/test/template/tag_helper_test.rb
  105. +6 −6 actionpack/test/template/text_helper_test.rb
  106. +4 −4 actionpack/test/template/translation_helper_test.rb
  107. +2 −2 actionpack/test/template/url_helper_test.rb
  108. +1 −1  activemodel/CHANGELOG
  109. +27 −27 activemodel/README.rdoc
  110. +42 −42 activemodel/lib/active_model/attribute_methods.rb
  111. +29 −29 activemodel/lib/active_model/callbacks.rb
  112. +6 −6 activemodel/lib/active_model/conversion.rb
  113. +18 −18 activemodel/lib/active_model/dirty.rb
  114. +30 −30 activemodel/lib/active_model/errors.rb
  115. +1 −1  activemodel/lib/active_model/lint.rb
  116. +5 −5 activemodel/lib/active_model/naming.rb
  117. +7 −7 activemodel/lib/active_model/observing.rb
  118. +22 −22 activemodel/lib/active_model/serialization.rb
  119. +1 −1  activemodel/lib/active_model/serializers/xml.rb
  120. +7 −7 activemodel/lib/active_model/translation.rb
  121. +16 −16 activemodel/lib/active_model/validations.rb
  122. +11 −11 activemodel/lib/active_model/validations/acceptance.rb
  123. +10 −10 activemodel/lib/active_model/validations/confirmation.rb
  124. +1 −1  activemodel/lib/active_model/validations/length.rb
  125. +5 −5 activemodel/lib/active_model/validations/validates.rb
  126. +11 −11 activemodel/lib/active_model/validator.rb
  127. +2 −2 activemodel/test/cases/attribute_methods_test.rb
  128. +5 −5 activemodel/test/cases/serializeration/json_serialization_test.rb
  129. +2 −2 activemodel/test/cases/translation_test.rb
  130. +4 −4 activemodel/test/cases/validations/validates_test.rb
  131. +1 −1  activemodel/test/cases/validations_test.rb
  132. +2 −2 activemodel/test/models/custom_reader.rb
  133. +1 −1  activemodel/test/models/person_with_validator.rb
  134. +0 −1  activemodel/test/models/sheep.rb
  135. +9 −9 activerecord/README.rdoc
  136. +8 −8 activerecord/RUNNING_UNIT_TESTS
  137. +48 −48 activerecord/lib/active_record/aggregations.rb
  138. +4 −4 activerecord/lib/active_record/association_preload.rb
  139. +172 −172 activerecord/lib/active_record/associations.rb
  140. +3 −3 activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
  141. +4 −4 activerecord/lib/active_record/associations/has_many_association.rb
  142. +3 −3 activerecord/lib/active_record/associations/has_many_through_association.rb
  143. +1 −1  activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
  144. +1 −1  activerecord/lib/active_record/attribute_methods/write.rb
  145. +5 −5 activerecord/lib/active_record/autosave_association.rb
  146. +87 −87 activerecord/lib/active_record/base.rb
  147. +24 −24 activerecord/lib/active_record/callbacks.rb
  148. +1 −1  activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
  149. +3 −3 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
  150. +2 −2 activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
  151. +2 −2 activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
  152. +1 −1  activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
  153. +4 −4 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
  154. +1 −1  activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
  155. +1 −1  activerecord/lib/active_record/dynamic_finder_match.rb
  156. +1 −1  activerecord/lib/active_record/dynamic_scope_match.rb
  157. +4 −4 activerecord/lib/active_record/errors.rb
  158. +18 −18 activerecord/lib/active_record/fixtures.rb
  159. +2 −2 activerecord/lib/active_record/locale/en.yml
  160. +33 −33 activerecord/lib/active_record/migration.rb
  161. +12 −12 activerecord/lib/active_record/named_scope.rb
  162. +1 −1  activerecord/lib/active_record/nested_attributes.rb
  163. +1 −1  activerecord/lib/active_record/observer.rb
  164. +13 −13 activerecord/lib/active_record/reflection.rb
  165. +4 −4 activerecord/lib/active_record/relation.rb
  166. +26 −26 activerecord/lib/active_record/relation/calculations.rb
  167. +7 −7 activerecord/lib/active_record/relation/finder_methods.rb
  168. +1 −1  activerecord/lib/active_record/relation/spawn_methods.rb
  169. +2 −2 activerecord/lib/active_record/schema_dumper.rb
  170. +1 −1  activerecord/lib/active_record/serialization.rb
  171. +1 −1  activerecord/lib/active_record/serializers/xml_serializer.rb
  172. +1 −1  activerecord/lib/active_record/session_store.rb
  173. +1 −1  activerecord/lib/active_record/test_case.rb
  174. +2 −2 activerecord/lib/active_record/validations/associated.rb
  175. +10 −10 activerecord/lib/active_record/validations/uniqueness.rb
  176. +2 −2 activerecord/test/cases/associations/has_many_through_associations_test.rb
  177. +7 −7 activerecord/test/cases/associations/has_one_through_associations_test.rb
  178. +5 −5 activerecord/test/cases/associations/join_model_test.rb
  179. +3 −3 activerecord/test/cases/associations_test.rb
  180. +4 −4 activerecord/test/cases/attribute_methods_test.rb
  181. +1 −1  activerecord/test/cases/autosave_association_test.rb
  182. +1 −1  activerecord/test/cases/counter_cache_test.rb
  183. +3 −3 activerecord/test/cases/defaults_test.rb
  184. +7 −7 activerecord/test/cases/dirty_test.rb
  185. +8 −8 activerecord/test/cases/fixtures_test.rb
  186. +2 −2 activerecord/test/cases/i18n_test.rb
  187. +1 −1  activerecord/test/cases/json_serialization_test.rb
  188. +2 −2 activerecord/test/cases/migration_test.rb
  189. +2 −2 activerecord/test/cases/modules_test.rb
  190. +10 −10 activerecord/test/cases/nested_attributes_test.rb
  191. +2 −2 activerecord/test/cases/persistence_test.rb
  192. +1 −1  activerecord/test/cases/reflection_test.rb
  193. +2 −2 activerecord/test/cases/relation_scoping_test.rb
  194. +2 −2 activerecord/test/cases/relations_test.rb
  195. +1 −1  activerecord/test/cases/serialization_test.rb
  196. +14 −14 activerecord/test/cases/timestamp_test.rb
  197. +2 −2 activerecord/test/fixtures/comments.yml
  198. +5 −5 activerecord/test/fixtures/companies.yml
  199. +0 −1  activerecord/test/fixtures/items.yml
  200. +1 −1  activerecord/test/fixtures/memberships.yml
  201. +1 −1  activerecord/test/fixtures/mixins.yml
  202. +1 −1  activerecord/test/fixtures/taggings.yml
  203. +1 −1  activerecord/test/fixtures/tags.yml
  204. +1 −1  activerecord/test/models/developer.rb
  205. +2 −2 activerecord/test/models/minivan.rb
  206. +1 −1  activerecord/test/models/post.rb
  207. +1 −1  activerecord/test/models/shop.rb
  208. +1 −1  activerecord/test/models/topic.rb
  209. +1 −1  activerecord/test/schema/postgresql_specific_schema.rb
  210. +3 −3 activerecord/test/schema/schema.rb
  211. +11 −11 activeresource/CHANGELOG
  212. +4 −4 activeresource/README.rdoc
  213. +4 −4 activeresource/lib/active_resource/http_mock.rb
  214. +8 −8 activeresource/lib/active_resource/validations.rb
  215. +5 −5 activeresource/test/cases/base/custom_methods_test.rb
  216. +1 −1  activeresource/test/cases/validations_test.rb
  217. +2 −2 activeresource/test/connection_test.rb
  218. +34 −34 activesupport/CHANGELOG
  219. +3 −3 activesupport/lib/active_support/base64.rb
  220. +3 −3 activesupport/lib/active_support/benchmarkable.rb
  221. +11 −11 activesupport/lib/active_support/cache.rb
  222. +1 −1  activesupport/lib/active_support/cache/strategy/local_cache.rb
  223. +1 −1  activesupport/lib/active_support/callbacks.rb
  224. +4 −4 activesupport/lib/active_support/core_ext/array/random_access.rb
  225. +1 −1  activesupport/lib/active_support/core_ext/array/wrap.rb
  226. +2 −2 activesupport/lib/active_support/core_ext/date/calculations.rb
  227. +6 −6 activesupport/lib/active_support/core_ext/date_time/conversions.rb
  228. +1 −1  activesupport/lib/active_support/core_ext/date_time/zones.rb
  229. +4 −4 activesupport/lib/active_support/core_ext/enumerable.rb
  230. +11 −11 activesupport/lib/active_support/core_ext/hash/conversions.rb
  231. +2 −2 activesupport/lib/active_support/core_ext/integer/time.rb
  232. +1 −1  activesupport/lib/active_support/core_ext/module/anonymous.rb
  233. +2 −2 activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb
  234. +1 −1  activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
  235. +1 −1  activesupport/lib/active_support/core_ext/module/remove_method.rb
  236. +2 −2 activesupport/lib/active_support/core_ext/module/synchronization.rb
  237. +9 −9 activesupport/lib/active_support/core_ext/numeric/time.rb
  238. +1 −1  activesupport/lib/active_support/core_ext/object/blank.rb
  239. +5 −5 activesupport/lib/active_support/core_ext/object/instance_variables.rb
  240. +2 −2 activesupport/lib/active_support/core_ext/object/returning.rb
  241. +1 −1  activesupport/lib/active_support/core_ext/range/conversions.rb
  242. +7 −7 activesupport/lib/active_support/core_ext/string/access.rb
  243. +6 −6 activesupport/lib/active_support/core_ext/string/inflections.rb
  244. +2 −2 activesupport/lib/active_support/core_ext/time/calculations.rb
  245. +1 −1  activesupport/lib/active_support/core_ext/time/conversions.rb
  246. +3 −3 activesupport/lib/active_support/core_ext/time/zones.rb
  247. +1 −1  activesupport/lib/active_support/duration.rb
  248. +1 −1  activesupport/lib/active_support/i18n_railtie.rb
  249. +2 −2 activesupport/lib/active_support/lazy_load_hooks.rb
  250. +3 −3 activesupport/lib/active_support/locale/en.yml
  251. +1 −1  activesupport/lib/active_support/log_subscriber.rb
  252. +1 −1  activesupport/lib/active_support/log_subscriber/test_helper.rb
  253. +17 −17 activesupport/lib/active_support/message_encryptor.rb
  254. +7 −7 activesupport/lib/active_support/message_verifier.rb
  255. +1 −1  activesupport/lib/active_support/multibyte.rb
  256. +2 −2 activesupport/lib/active_support/ordered_hash.rb
  257. +3 −3 activesupport/lib/active_support/ordered_options.rb
  258. +2 −2 activesupport/lib/active_support/testing/assertions.rb
  259. +4 −4 activesupport/lib/active_support/testing/declarative.rb
  260. +3 −3 activesupport/lib/active_support/testing/pending.rb
  261. +2 −2 activesupport/lib/active_support/time_with_zone.rb
  262. +1 −1  activesupport/lib/active_support/xml_mini/rexml.rb
  263. +1 −1  activesupport/test/autoloading_fixtures/class_folder/nested_class.rb
  264. +7 −7 activesupport/test/clean_backtrace_test.rb
  265. +2 −2 activesupport/test/clean_logger_test.rb
  266. +6 −6 activesupport/test/core_ext/array_ext_test.rb
  267. +5 −5 activesupport/test/core_ext/class/attribute_accessor_test.rb
  268. +11 −11 activesupport/test/core_ext/class/class_inheritable_attributes_test.rb
  269. +8 −8 activesupport/test/core_ext/date_ext_test.rb
  270. +1 −1  activesupport/test/core_ext/date_time_ext_test.rb
  271. +2 −2 activesupport/test/core_ext/duration_test.rb
  272. +1 −1  activesupport/test/core_ext/enumerable_test.rb
  273. +21 −21 activesupport/test/core_ext/hash_ext_test.rb
  274. +1 −1  activesupport/test/core_ext/kernel_test.rb
  275. +1 −1  activesupport/test/core_ext/module/anonymous_test.rb
  276. +4 −4 activesupport/test/core_ext/module/attr_accessor_with_default_test.rb
  277. +1 −1  activesupport/test/core_ext/module/attribute_accessor_test.rb
  278. +3 −3 activesupport/test/core_ext/module/attribute_aliasing_test.rb
  279. +8 −8 activesupport/test/core_ext/module/reachable_test.rb
  280. +12 −12 activesupport/test/core_ext/numeric_ext_test.rb
  281. +1 −1  activesupport/test/core_ext/object_and_class_ext_test.rb
  282. +1 −1  activesupport/test/core_ext/string_ext_test.rb
  283. +10 −10 activesupport/test/core_ext/time_ext_test.rb
  284. +3 −3 activesupport/test/core_ext/time_with_zone_test.rb
  285. +17 −17 activesupport/test/i18n_test.rb
  286. +7 −7 activesupport/test/message_encryptor_test.rb
  287. +15 −15 activesupport/test/multibyte_conformance.rb
  288. +1 −1  activesupport/test/option_merger_test.rb
  289. +4 −4 activesupport/test/rescuable_test.rb
  290. +10 −10 activesupport/test/test_test.rb
  291. +1 −1  activesupport/test/time_zone_test.rb
  292. +3 −3 ci/ci_setup_notes.txt
  293. +6 −6 ci/site_config.rb
  294. +75 −75 railties/CHANGELOG
  295. +1 −1  railties/README.rdoc
  296. +14 −14 railties/guides/assets/stylesheets/main.css
  297. +7 −7 railties/guides/rails_guides/generator.rb
  298. +5 −5 railties/guides/source/2_3_release_notes.textile
  299. +7 −7 railties/guides/source/action_controller_overview.textile
  300. +44 −44 railties/guides/source/action_view_overview.textile
Sorry, we could not display the entire diff because too many files (337) changed.
View
4 README.rdoc
@@ -34,7 +34,7 @@ link:files/vendor/rails/actionpack/README.html.
2. At the command prompt, create a new Rails application:
- rails new myapp
+ rails new myapp
where "myapp" is the application name.
@@ -48,7 +48,7 @@ link:files/vendor/rails/actionpack/README.html.
"Welcome aboard: You're riding Ruby on Rails!"
-5. Follow the guidelines to start developing your application. You can find
+5. Follow the guidelines to start developing your application. You can find
the following resources handy:
* The README file created within your application.
View
8 actionmailer/CHANGELOG
@@ -181,7 +181,7 @@
* ActionMailer::Base documentation rewrite. Closes #4991 [Kevin Clark, Marcel Molina Jr.]
-* Replace alias method chaining with Module#alias_method_chain. [Marcel Molina Jr.]
+* Replace alias method chaining with Module#alias_method_chain. [Marcel Molina Jr.]
* Replace Ruby's deprecated append_features in favor of included. [Marcel Molina Jr.]
@@ -327,7 +327,7 @@
* Added that deliver_* will now return the email that was sent
-* Added that quoting to UTF-8 only happens if the characters used are in that range #955 [Jamis Buck]
+* Added that quoting to UTF-8 only happens if the characters used are in that range #955 [Jamis Buck]
* Fixed quoting for all address headers, not just to #955 [Jamis Buck]
@@ -366,7 +366,7 @@
@body = "Nothing to see here."
@charset = "iso-8859-1"
end
-
+
def unencoded_subject(recipient)
@recipients = recipient
@subject = "testing unencoded subject"
@@ -375,7 +375,7 @@
@encode_subject = false
@charset = "iso-8859-1"
end
-
+
*0.6.1* (January 18th, 2005)
View
22 actionmailer/README.rdoc
@@ -5,7 +5,7 @@ are used to consolidate code for sending out forgotten passwords, welcome
wishes on signup, invoices for billing, and any other use case that requires
a written notification to either a person or another system.
-Action Mailer is in essence a wrapper around Action Controller and the
+Action Mailer is in essence a wrapper around Action Controller and the
Mail gem. It provides a way to make emails using templates in the same
way that Action Controller renders views using templates.
@@ -23,7 +23,7 @@ This can be as simple as:
class Notifier < ActionMailer::Base
delivers_from 'system@loudthinking.com'
-
+
def welcome(recipient)
@recipient = recipient
mail(:to => recipient,
@@ -36,13 +36,13 @@ ERb) that has the instance variables that are declared in the mailer action.
So the corresponding body template for the method above could look like this:
- Hello there,
+ Hello there,
Mr. <%= @recipient %>
Thank you for signing up!
-
-And if the recipient was given as "david@loudthinking.com", the email
+
+And 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
@@ -55,7 +55,7 @@ generated would look like this:
charset="US-ASCII";
Content-Transfer-Encoding: 7bit
- Hello there,
+ Hello there,
Mr. david@loudthinking.com
@@ -75,7 +75,7 @@ Or you can just chain the methods together like:
== Receiving emails
To receive emails, you need to implement a public instance method called <tt>receive</tt> that takes a
-tmail object as its single parameter. The Action Mailer framework has a corresponding class method,
+tmail object as its single parameter. The Action Mailer framework has a corresponding class method,
which is also called <tt>receive</tt>, that accepts a raw, unprocessed email as a string, which it then turns
into the tmail object and calls the receive instance method.
@@ -90,7 +90,7 @@ Example:
if email.has_attachments?
for attachment in email.attachments
- page.attachments.create({
+ page.attachments.create({
:file => attachment, :description => email.subject
})
end
@@ -98,13 +98,13 @@ Example:
end
end
-This Mailman can be the target for Postfix or other MTAs. In Rails, you would use the runner in the
+This Mailman can be the target for Postfix or other MTAs. In Rails, you would use the runner in the
trivial case like this:
rails runner 'Mailman.receive(STDIN.read)'
-However, invoking Rails in the runner for each mail to be received is very resource intensive. A single
-instance of Rails should be run within a daemon if it is going to be utilized to process more than just
+However, invoking Rails in the runner for each mail to be received is very resource intensive. A single
+instance of Rails should be run within a daemon if it is going to be utilized to process more than just
a limited number of email.
== Configuration
View
22 actionmailer/lib/action_mailer/base.rb
@@ -187,31 +187,31 @@ module ActionMailer #:nodoc:
# with the filename +free_book.pdf+.
#
# = Inline Attachments
- #
- # You can also specify that a file should be displayed inline with other HTML. This is useful
+ #
+ # You can also specify that a file should be displayed inline with other HTML. This is useful
# if you want to display a corporate logo or a photo.
- #
+ #
# class ApplicationMailer < ActionMailer::Base
# def welcome(recipient)
# attachments.inline['photo.png'] = File.read('path/to/photo.png')
# mail(:to => recipient, :subject => "Here is what we look like")
# end
# end
- #
+ #
# And then to reference the image in the view, you create a <tt>welcome.html.erb</tt> file and
- # make a call to +image_tag+ passing in the attachment you want to display and then call
+ # make a call to +image_tag+ passing in the attachment you want to display and then call
# +url+ on the attachment to get the relative content id path for the image source:
- #
+ #
# <h1>Please Don't Cringe</h1>
- #
+ #
# <%= image_tag attachments['photo.png'].url -%>
- #
+ #
# As we are using Action View's +image_tag+ method, you can pass in any other options you want:
- #
+ #
# <h1>Please Don't Cringe</h1>
- #
+ #
# <%= image_tag attachments['photo.png'].url, :alt => 'Our Photo', :class => 'photo' -%>
- #
+ #
# = Observing and Intercepting Mails
#
# Action Mailer provides hooks into the Mail observer and interceptor methods. These allow you to
View
4 actionmailer/lib/action_mailer/delivery_methods.rb
@@ -46,11 +46,11 @@ module ClassMethods
# as alias and the default options supplied:
#
# Example:
- #
+ #
# add_delivery_method :sendmail, Mail::Sendmail,
# :location => '/usr/sbin/sendmail',
# :arguments => '-i -t'
- #
+ #
def add_delivery_method(symbol, klass, default_options={})
class_attribute(:"#{symbol}_settings") unless respond_to?(:"#{symbol}_settings")
send(:"#{symbol}_settings=", default_options)
View
4 actionmailer/lib/action_mailer/mail_helper.rb
@@ -15,11 +15,11 @@ def block_format(text)
:columns => 72, :first_indent => 2, :body_indent => 2, :text => paragraph
).format
}.join("\n")
-
+
# Make list points stand on their own line
formatted.gsub!(/[ ]*([*]+) ([^*]*)/) { |s| " #{$1} #{$2.strip}\n" }
formatted.gsub!(/[ ]*([#]+) ([^#]*)/) { |s| " #{$1} #{$2.strip}\n" }
-
+
formatted
end
View
32 actionmailer/lib/action_mailer/old_api.rb
@@ -116,36 +116,36 @@ def attachment(params, &block)
def normalize_nonfile_hash(params)
content_disposition = "attachment;"
-
+
mime_type = params.delete(:mime_type)
-
+
if content_type = params.delete(:content_type)
content_type = "#{mime_type || content_type};"
end
params[:body] = params.delete(:data) if params[:data]
-
+
{ :content_type => content_type,
:content_disposition => content_disposition }.merge(params)
end
-
+
def normalize_file_hash(params)
filename = File.basename(params.delete(:filename))
content_disposition = "attachment; filename=\"#{File.basename(filename)}\""
-
+
mime_type = params.delete(:mime_type)
-
+
if (content_type = params.delete(:content_type)) && (content_type !~ /filename=/)
content_type = "#{mime_type || content_type}; filename=\"#{filename}\""
end
-
+
params[:body] = params.delete(:data) if params[:data]
-
+
{ :content_type => content_type,
:content_disposition => content_disposition }.merge(params)
end
- def create_mail
+ def create_mail
m = @_message
set_fields!({:subject => subject, :to => recipients, :from => from,
@@ -178,14 +178,14 @@ def create_mail
wrap_delivery_behavior!
m.content_transfer_encoding = '8bit' unless m.body.only_us_ascii?
-
+
@_message
end
-
+
# Set up the default values for the various instance variables of this
# mailer. Subclasses may override this method to provide different
# defaults.
- def initialize_defaults(method_name)
+ def initialize_defaults(method_name)
@charset ||= self.class.default[:charset].try(:dup)
@content_type ||= self.class.default[:content_type].try(:dup)
@implicit_parts_order ||= self.class.default[:parts_order].try(:dup)
@@ -201,7 +201,7 @@ def initialize_defaults(method_name)
@body ||= {}
end
- def create_parts
+ def create_parts
if String === @body
@parts.unshift create_inline_part(@body)
elsif @parts.empty? || @parts.all? { |p| p.content_disposition =~ /^attachment/ }
@@ -220,7 +220,7 @@ def create_parts
end
end
- def create_inline_part(body, mime_type=nil)
+ def create_inline_part(body, mime_type=nil)
ct = mime_type || "text/plain"
main_type, sub_type = split_content_type(ct.to_s)
@@ -242,11 +242,11 @@ def set_fields!(headers, charset) #:nodoc:
m.reply_to ||= headers.delete(:reply_to) if headers[:reply_to]
end
- def split_content_type(ct)
+ def split_content_type(ct)
ct.to_s.split("/")
end
- def parse_content_type(defaults=nil)
+ def parse_content_type(defaults=nil)
if @content_type.blank?
[ nil, {} ]
else
View
6 actionmailer/lib/action_mailer/tmail_compat.rb
@@ -1,12 +1,12 @@
module Mail
class Message
-
+
def set_content_type(*args)
ActiveSupport::Deprecation.warn('Message#set_content_type is deprecated, please just call ' <<
'Message#content_type with the same arguments', caller[0,2])
content_type(*args)
end
-
+
alias :old_transfer_encoding :transfer_encoding
def transfer_encoding(value = nil)
if value
@@ -29,6 +29,6 @@ def original_filename
'please call Message#filename', caller[0,2])
filename
end
-
+
end
end
View
16 actionmailer/test/base_test.rb
@@ -148,7 +148,7 @@ def teardown
assert_equal("application/pdf", email.parts[1].mime_type)
assert_equal("VGhpcyBpcyB0ZXN0IEZpbGUgY29udGVudA==\r\n", email.parts[1].body.encoded)
end
-
+
test "can embed an inline attachment" do
email = BaseMailer.inline_attachment
# Need to call #encoded to force the JIT sort on parts
@@ -413,7 +413,7 @@ def teardown
BaseMailer.welcome.deliver
assert_equal(1, BaseMailer.deliveries.length)
end
-
+
test "calling deliver, ActionMailer should yield back to mail to let it call :do_delivery on itself" do
mail = Mail::Message.new
mail.expects(:do_delivery).once
@@ -447,7 +447,7 @@ def teardown
mail = BaseMailer.welcome_from_another_path(['unknown/invalid', 'another.path/base_mailer']).deliver
assert_equal("Welcome from another path", mail.body.encoded)
end
-
+
test "assets tags should use ActionMailer's asset_host settings" do
ActionMailer::Base.config.asset_host = "http://global.com"
ActionMailer::Base.config.assets_dir = "global/"
@@ -456,7 +456,7 @@ def teardown
assert_equal(%{<img alt="Dummy" src="http://global.com/images/dummy.png" />}, mail.body.to_s.strip)
end
-
+
test "assets tags should use a Mailer's asset_host settings when available" do
ActionMailer::Base.config.asset_host = "global.com"
ActionMailer::Base.config.assets_dir = "global/"
@@ -469,12 +469,12 @@ def teardown
end
# Before and After hooks
-
+
class MyObserver
def self.delivered_email(mail)
end
end
-
+
test "you can register an observer to the mail object that gets informed on email delivery" do
ActionMailer::Base.register_observer(MyObserver)
mail = BaseMailer.welcome
@@ -493,7 +493,7 @@ def self.delivering_email(mail)
MyInterceptor.expects(:delivering_email).with(mail)
mail.deliver
end
-
+
test "being able to put proc's into the defaults hash and they get evaluated on mail sending" do
mail1 = ProcMailer.welcome
yesterday = 1.day.ago
@@ -501,7 +501,7 @@ def self.delivering_email(mail)
mail2 = ProcMailer.welcome
assert(mail1['X-Proc-Method'].to_s.to_i > mail2['X-Proc-Method'].to_s.to_i)
end
-
+
test "we can call other defined methods on the class as needed" do
mail = ProcMailer.welcome
assert_equal("Thanks for signing up this afternoon", mail.subject)
View
6 actionmailer/test/delivery_methods_test.rb
@@ -128,7 +128,7 @@ def teardown
Mail::Message.any_instance.expects(:deliver!).never
DeliveryMailer.welcome.deliver
end
-
+
test "does not append the deliveries collection if told not to perform the delivery" do
DeliveryMailer.perform_deliveries = false
DeliveryMailer.deliveries.clear
@@ -160,7 +160,7 @@ def teardown
DeliveryMailer.welcome.deliver
end
end
-
+
test "does not increment the deliveries collection on bogus deliveries" do
DeliveryMailer.delivery_method = BogusDelivery
DeliveryMailer.raise_delivery_errors = false
@@ -168,5 +168,5 @@ def teardown
DeliveryMailer.welcome.deliver
assert_equal(0, DeliveryMailer.deliveries.length)
end
-
+
end
View
2  actionmailer/test/fixtures/raw_email10
@@ -15,6 +15,6 @@ Content-Type: text/plain; charset=X-UNKNOWN
Test test. Hi. Waving. m
----------------------------------------------------------------
-Sent via Bell Mobility's Text Messaging service.
+Sent via Bell Mobility's Text Messaging service.
Envoyé par le service de messagerie texte de Bell Mobilité.
----------------------------------------------------------------
View
2  actionmailer/test/fixtures/raw_email2
@@ -32,7 +32,7 @@ To: xxxxx xxxx <xxxxx@xxxxxxxxx.com>
Subject: Fwd: Signed email causes file attachments
In-Reply-To: <F6E2D0B4-CC35-4A91-BA4C-C7C712B10C13@mac.com>
Mime-Version: 1.0
-Content-Type: multipart/mixed;
+Content-Type: multipart/mixed;
boundary="----=_Part_5028_7368284.1115579351471"
References: <F6E2D0B4-CC35-4A91-BA4C-C7C712B10C13@mac.com>
View
2  actionmailer/test/fixtures/raw_email3
@@ -31,7 +31,7 @@ Reply-To: Test Tester <xxxx@xxxx.com>
To: xxxx@xxxx.com, xxxx@xxxx.com
Subject: Another PDF
Mime-Version: 1.0
-Content-Type: multipart/mixed;
+Content-Type: multipart/mixed;
boundary="----=_Part_2192_32400445.1115745999735"
X-Virus-Scanned: amavisd-new at textdrive.com
View
2  actionmailer/test/fixtures/raw_email5
@@ -14,6 +14,6 @@ Importance: normal
Test test. Hi. Waving. m
----------------------------------------------------------------
-Sent via Bell Mobility's Text Messaging service.
+Sent via Bell Mobility's Text Messaging service.
Envoyé par le service de messagerie texte de Bell Mobilité.
----------------------------------------------------------------
View
2  actionmailer/test/fixtures/raw_email6
@@ -15,6 +15,6 @@ Content-Type: text/plain; charset=us-ascii
Test test. Hi. Waving. m
----------------------------------------------------------------
-Sent via Bell Mobility's Text Messaging service.
+Sent via Bell Mobility's Text Messaging service.
Envoyé par le service de messagerie texte de Bell Mobilité.
----------------------------------------------------------------
View
2  actionmailer/test/fixtures/raw_email8
@@ -8,7 +8,7 @@ To: xxxxx xxxx <xxxxx@xxxxxxxxx.com>
Subject: Fwd: Signed email causes file attachments
In-Reply-To: <F6E2D0B4-CC35-4A91-BA4C-C7C712B10C13@mac.com>
Mime-Version: 1.0
-Content-Type: multipart/mixed;
+Content-Type: multipart/mixed;
boundary="----=_Part_5028_7368284.1115579351471"
References: <F6E2D0B4-CC35-4A91-BA4C-C7C712B10C13@mac.com>
View
10 actionmailer/test/fixtures/raw_email9
@@ -10,19 +10,19 @@ Date: Wed, 23 Feb 2005 18:20:17 -0400
From: "xxx xxx" <xxx@xxx.xxx>
Message-ID: <4D6AA7EB.6490534@xxx.xxx>
To: xxx@xxx.com
-Subject: Stop adware/spyware once and for all.
+Subject: Stop adware/spyware once and for all.
X-Scanned-By: MIMEDefang 2.11 (www dot roaringpenguin dot com slash mimedefang)
-You are infected with:
+You are infected with:
Ad Ware and Spy Ware
-Get your free scan and removal download now,
-before it gets any worse.
+Get your free scan and removal download now,
+before it gets any worse.
http://xxx.xxx.info?aid=3D13&?stat=3D4327kdzt
-no more? (you will still be infected)
+no more? (you will still be infected)
http://xxx.xxx.info/discon/?xxx@xxx.com
View
2  actionmailer/test/fixtures/templates/signed_up.erb
@@ -1,3 +1,3 @@
-Hello there,
+Hello there,
Mr. <%= @recipient %>
View
4 actionmailer/test/fixtures/test_mailer/custom_templating_extension.html.haml
@@ -1,6 +1,6 @@
-%p Hello there,
+%p Hello there,
-%p
+%p
Mr.
= @recipient
from haml
View
4 actionmailer/test/fixtures/test_mailer/custom_templating_extension.text.haml
@@ -1,6 +1,6 @@
-%p Hello there,
+%p Hello there,
-%p
+%p
Mr.
= @recipient
from haml
View
2  actionmailer/test/fixtures/test_mailer/signed_up.html.erb
@@ -1,3 +1,3 @@
-Hello there,
+Hello there,
Mr. <%= @recipient %>
View
2  actionmailer/test/fixtures/url_test_mailer/signed_up_with_url.erb
@@ -1,4 +1,4 @@
-Hello there,
+Hello there,
Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> <%= welcome_url %>
View
6 actionmailer/test/mailers/proc_mailer.rb
@@ -6,11 +6,11 @@ class ProcMailer < ActionMailer::Base
def welcome
mail
end
-
+
private
-
+
def give_a_greeting
"Thanks for signing up this afternoon"
end
-
+
end
View
30 actionmailer/test/old_base/mail_service_test.rb
@@ -106,7 +106,7 @@ def utf8_body(recipient)
cc "Foo áëô îü <extended@example.net>"
bcc "Foo áëô îü <extended@example.net>"
charset "UTF-8"
-
+
body "åœö blah"
end
@@ -359,7 +359,7 @@ def test_nested_parts
assert_equal "text/plain", created.parts[0].parts[0].mime_type
assert_equal "text/html", created.parts[0].parts[1].mime_type
assert_equal "application/octet-stream", created.parts[1].mime_type
-
+
end
def test_nested_parts_with_body
@@ -399,7 +399,7 @@ def test_signed_up
created = nil
assert_nothing_raised { created = TestMailer.signed_up(@recipient) }
assert_not_nil created
-
+
expected.message_id = '<123@456>'
created.message_id = '<123@456>'
@@ -503,7 +503,7 @@ def test_cc_bcc
delivered = ActionMailer::Base.deliveries.first
expected.message_id = '<123@456>'
delivered.message_id = '<123@456>'
-
+
assert_equal expected.encoded, delivered.encoded
end
@@ -546,10 +546,10 @@ def test_reply_to
created = TestMailer.different_reply_to @recipient
end
assert_not_nil created
-
+
expected.message_id = '<123@456>'
created.message_id = '<123@456>'
-
+
assert_equal expected.encoded, created.encoded
assert_nothing_raised do
@@ -558,10 +558,10 @@ def test_reply_to
delivered = ActionMailer::Base.deliveries.first
assert_not_nil delivered
-
+
expected.message_id = '<123@456>'
delivered.message_id = '<123@456>'
-
+
assert_equal expected.encoded, delivered.encoded
end
@@ -581,7 +581,7 @@ def test_iso_charset
created = TestMailer.iso_charset @recipient
end
assert_not_nil created
-
+
expected.message_id = '<123@456>'
created.message_id = '<123@456>'
@@ -596,7 +596,7 @@ def test_iso_charset
expected.message_id = '<123@456>'
delivered.message_id = '<123@456>'
-
+
assert_equal expected.encoded, delivered.encoded
end
@@ -631,7 +631,7 @@ def test_unencoded_subject
expected.message_id = '<123@456>'
delivered.message_id = '<123@456>'
-
+
assert_equal expected.encoded, delivered.encoded
end
@@ -761,10 +761,10 @@ def test_extended_headers
delivered = ActionMailer::Base.deliveries.first
assert_not_nil delivered
-
+
expected.message_id = '<123@456>'
delivered.message_id = '<123@456>'
-
+
assert_equal expected.encoded, delivered.encoded
end
@@ -887,7 +887,7 @@ def test_explicitly_multipart_messages
assert_equal "iso-8859-1", mail.parts[1].charset
assert_equal "image/jpeg", mail.parts[2].mime_type
-
+
assert_equal "attachment", mail.parts[2][:content_disposition].disposition_type
assert_equal "foo.jpg", mail.parts[2][:content_disposition].filename
assert_equal "foo.jpg", mail.parts[2][:content_type].filename
@@ -1005,7 +1005,7 @@ def test_decode_encoded_attachment_filename
attachment = mail.attachments.last
expected = "01 Quien Te Dij\212at. Pitbull.mp3"
-
+
if expected.respond_to?(:force_encoding)
result = attachment.filename.dup
expected.force_encoding(Encoding::ASCII_8BIT)
View
2  actionmailer/test/old_base/tmail_compat_test.rb
@@ -31,5 +31,5 @@ def test_transfer_encoding_setter_raises_deprecation_warning
end
assert_equal mail.content_transfer_encoding, "base64"
end
-
+
end
View
2  actionmailer/test/old_base/url_test.rb
@@ -83,7 +83,7 @@ def test_signed_up_with_url
assert_nothing_raised { UrlTestMailer.signed_up_with_url(@recipient).deliver }
assert_not_nil ActionMailer::Base.deliveries.first
delivered = ActionMailer::Base.deliveries.first
-
+
delivered.message_id = '<123@456>'
assert_equal expected.encoded, delivered.encoded
end
View
24 actionmailer/test/test_helper_test.rb
@@ -32,7 +32,7 @@ def test_determine_default_mailer_raises_correct_error
self.class.determine_default_mailer("NotAMailerTest")
end
end
-
+
def test_charset_is_utf_8
assert_equal "UTF-8", charset
end
@@ -44,14 +44,14 @@ def test_assert_emails
end
end
end
-
+
def test_repeated_assert_emails_calls
assert_nothing_raised do
assert_emails 1 do
TestHelperMailer.test.deliver
end
end
-
+
assert_nothing_raised do
assert_emails 2 do
TestHelperMailer.test.deliver
@@ -59,20 +59,20 @@ def test_repeated_assert_emails_calls
end
end
end
-
+
def test_assert_emails_with_no_block
assert_nothing_raised do
TestHelperMailer.test.deliver
assert_emails 1
end
-
+
assert_nothing_raised do
TestHelperMailer.test.deliver
TestHelperMailer.test.deliver
assert_emails 3
end
end
-
+
def test_assert_no_emails
assert_nothing_raised do
assert_no_emails do
@@ -80,17 +80,17 @@ def test_assert_no_emails
end
end
end
-
+
def test_assert_emails_too_few_sent
error = assert_raise ActiveSupport::TestCase::Assertion do
assert_emails 2 do
TestHelperMailer.test.deliver
end
end
-
+
assert_match(/2 .* but 1/, error.message)
end
-
+
def test_assert_emails_too_many_sent
error = assert_raise ActiveSupport::TestCase::Assertion do
assert_emails 1 do
@@ -98,17 +98,17 @@ def test_assert_emails_too_many_sent
TestHelperMailer.test.deliver
end
end
-
+
assert_match(/1 .* but 2/, error.message)
end
-
+
def test_assert_no_emails_failure
error = assert_raise ActiveSupport::TestCase::Assertion do
assert_no_emails do
TestHelperMailer.test.deliver
end
end
-
+
assert_match(/0 .* but 1/, error.message)
end
end
View
4 actionpack/CHANGELOG
@@ -26,7 +26,7 @@
resources :comments
end
end
-
+
You can now use comment_path for /comments/1 instead of post_comment_path for /posts/1/comments/1.
* Add support for multi-subdomain session by setting cookie host in session cookie so you can share session between www.example.com, example.com and user.example.com. #4818 [Guillermo Álvarez]
@@ -110,7 +110,7 @@
* ActionDispatch::Request#content_type returns a String to be compatible with
Rack::Request. Use #content_mime_type for the Mime::Type instance [YK]
-* Updated Prototype to 1.6.1 and Scriptaculous to 1.8.3 [ML]
+* Updated Prototype to 1.6.1 and Scriptaculous to 1.8.3 [ML]
* Change the preferred way that URL helpers are included into a class[YK & CL]
View
4 actionpack/README.rdoc
@@ -102,10 +102,10 @@ A short rundown of some of the major features:
class WeblogController < ActionController::Base
# filters as methods
before_filter :authenticate, :cache, :audit
-
+
# filter as a proc
after_filter { |c| c.response.body = Gzip::compress(c.response.body) }
-
+
# class filter
after_filter LocalizeFilter
View
4 actionpack/RUNNING_UNIT_TESTS
@@ -1,7 +1,7 @@
== Running with Rake
The easiest way to run the unit tests is through Rake. The default task runs
-the entire test suite for all classes. For more information, checkout the
+the entire test suite for all classes. For more information, checkout the
full array of rake tasks with "rake -T"
Rake can be found at http://rake.rubyforge.org
@@ -16,7 +16,7 @@ you can do so with something like:
== Dependency on ActiveRecord and database setup
Test cases in the test/controller/active_record/ directory depend on having
-activerecord and sqlite installed. If ActiveRecord is not in
+activerecord and sqlite installed. If ActiveRecord is not in
actionpack/../activerecord directory, or the sqlite rubygem is not installed,
these tests are skipped.
View
2  actionpack/lib/abstract_controller/base.rb
@@ -109,7 +109,7 @@ def process(action, *args)
@_action_name = action_name = action.to_s
unless action_name = method_for_action(action_name)
- raise ActionNotFound, "The action '#{action}' could not be found for #{self.class.name}"
+ raise ActionNotFound, "The action '#{action}' could not be found for #{self.class.name}"
end
@_response_body = nil
View
4 actionpack/lib/action_controller/metal/http_authentication.rb
@@ -392,11 +392,11 @@ def request_http_token_authentication(realm = "Application")
end
end
- # If token Authorization header is present, call the login procedure with
+ # If token Authorization header is present, call the login procedure with
# the present token and options.
#
# controller - ActionController::Base instance for the current request.
- # login_procedure - Proc to call if a token is present. The Proc should
+ # login_procedure - Proc to call if a token is present. The Proc should
# take 2 arguments:
# authenticate(controller) { |token, options| ... }
#
View
2  actionpack/lib/action_controller/middleware.rb
@@ -31,7 +31,7 @@ def initialize(app)
super()
@_app = app
end
-
+
def index
call(env)
end
View
2  actionpack/lib/action_controller/test_case.rb
@@ -311,7 +311,7 @@ module ClassMethods
def tests(controller_class)
self.controller_class = controller_class
end
-
+
def controller_class=(new_class)
prepare_controller_class(new_class) if new_class
write_inheritable_attribute(:controller_class, new_class)
View
4 actionpack/lib/action_controller/vendor/html-scanner/html/document.rb
@@ -48,7 +48,7 @@ def initialize(text, strict=false, xml=false)
end
end
end
-
+
# Search the tree for (and return) the first node that matches the given
# conditions. The conditions are interpreted differently for different node
# types, see HTML::Text#find and HTML::Tag#find.
@@ -62,7 +62,7 @@ def find(conditions)
def find_all(conditions)
@root.find_all(conditions)
end
-
+
end
end
View
58 actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
@@ -1,7 +1,7 @@
require 'strscan'
module HTML #:nodoc:
-
+
class Conditions < Hash #:nodoc:
def initialize(hash)
super()
@@ -57,17 +57,17 @@ def keys_to_symbols(hash)
class Node #:nodoc:
# The array of children of this node. Not all nodes have children.
attr_reader :children
-
+
# The parent node of this node. All nodes have a parent, except for the
# root node.
attr_reader :parent
-
+
# The line number of the input where this node was begun
attr_reader :line
-
+
# The byte position in the input where this node was begun
attr_reader :position
-
+
# Create a new node as a child of the given parent.
def initialize(parent, line=0, pos=0)
@parent = parent
@@ -92,7 +92,7 @@ def match(conditions)
# returns non +nil+. Returns the result of the #find call that succeeded.
def find(conditions)
conditions = validate_conditions(conditions)
- @children.each do |child|
+ @children.each do |child|
node = child.find(conditions)
return node if node
end
@@ -133,7 +133,7 @@ def ==(node)
equivalent
end
-
+
class <<self
def parse(parent, line, pos, content, strict=true)
if content !~ /^<\S/
@@ -160,11 +160,11 @@ def parse(parent, line, pos, content, strict=true)
return CDATA.new(parent, line, pos, scanner.pre_match.gsub(/<!\[CDATA\[/, ''))
end
-
+
closing = ( scanner.scan(/\//) ? :close : nil )
return Text.new(parent, line, pos, content) unless name = scanner.scan(/[\w:-]+/)
name.downcase!
-
+
unless closing
scanner.skip(/\s*/)
attributes = {}
@@ -191,13 +191,13 @@ def parse(parent, line, pos, content, strict=true)
attributes[attr.downcase] = value
scanner.skip(/\s*/)
end
-
+
closing = ( scanner.scan(/\//) ? :self : nil )
end
-
+
unless scanner.scan(/\s*>/)
if strict
- raise "expected > (got #{scanner.rest.inspect} for #{content}, #{attributes.inspect})"
+ raise "expected > (got #{scanner.rest.inspect} for #{content}, #{attributes.inspect})"
else
# throw away all text until we find what we're looking for
scanner.skip_until(/>/) or scanner.terminate
@@ -212,9 +212,9 @@ def parse(parent, line, pos, content, strict=true)
# A node that represents text, rather than markup.
class Text < Node #:nodoc:
-
+
attr_reader :content
-
+
# Creates a new text node as a child of the given parent, with the given
# content.
def initialize(parent, line, pos, content)
@@ -240,7 +240,7 @@ def to_s
def find(conditions)
match(conditions) && self
end
-
+
# Returns non-+nil+ if this node meets the given conditions, or +nil+
# otherwise. See the discussion of #find for the valid conditions.
def match(conditions)
@@ -268,7 +268,7 @@ def ==(node)
content == node.content
end
end
-
+
# A CDATA node is simply a text node with a specialized way of displaying
# itself.
class CDATA < Text #:nodoc:
@@ -281,16 +281,16 @@ def to_s
# closing tag, or a self-closing tag. It has a name, and may have a hash of
# attributes.
class Tag < Node #:nodoc:
-
+
# Either +nil+, <tt>:close</tt>, or <tt>:self</tt>
attr_reader :closing
-
+
# Either +nil+, or a hash of attributes for this node.
attr_reader :attributes
# The name of this tag.
attr_reader :name
-
+
# Create a new node as a child of the given parent, using the given content
# to describe the node. It will be parsed and the node name, attributes and
# closing status extracted.
@@ -344,7 +344,7 @@ def find(conditions)
def tag?
true
end
-
+
# Returns +true+ if the node meets any of the given conditions. The
# +conditions+ parameter must be a hash of any of the following keys
# (all are optional):
@@ -404,7 +404,7 @@ def tag?
# node.match :descendant => { :tag => "strong" }
#
# # test if the node has between 2 and 4 span tags as immediate children
- # node.match :children => { :count => 2..4, :only => { :tag => "span" } }
+ # node.match :children => { :count => 2..4, :only => { :tag => "span" } }
#
# # get funky: test to see if the node is a "div", has a "ul" ancestor
# # and an "li" parent (with "class" = "enum"), and whether or not it has
@@ -439,7 +439,7 @@ def match(conditions)
# test children
return false unless children.find { |child| child.match(conditions[:child]) } if conditions[:child]
-
+
# test ancestors
if conditions[:ancestor]
return false unless catch :found do
@@ -457,13 +457,13 @@ def match(conditions)
child.match(:descendant => conditions[:descendant])
end
end
-
+
# count children
if opts = conditions[:children]
matches = children.select do |c|
(c.kind_of?(HTML::Tag) and (c.closing == :self or ! c.childless?))
end
-
+
matches = matches.select { |c| c.match(opts[:only]) } if opts[:only]
opts.each do |key, value|
next if key == :only
@@ -489,24 +489,24 @@ def match(conditions)
self_index = siblings.index(self)
if conditions[:sibling]
- return false unless siblings.detect do |s|
+ return false unless siblings.detect do |s|
s != self && s.match(conditions[:sibling])
end
end
if conditions[:before]
- return false unless siblings[self_index+1..-1].detect do |s|
+ return false unless siblings[self_index+1..-1].detect do |s|
s != self && s.match(conditions[:before])
end
end
if conditions[:after]
- return false unless siblings[0,self_index].detect do |s|
+ return false unless siblings[0,self_index].detect do |s|
s != self && s.match(conditions[:after])
end
end
end
-
+
true
end
@@ -515,7 +515,7 @@ def ==(node)
return false unless closing == node.closing && self.name == node.name
attributes == node.attributes
end
-
+
private
# Match the given value to the given condition.
def match_condition(value, condition)
View
50 actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
@@ -7,11 +7,11 @@ def sanitize(text, options = {})
return text unless sanitizeable?(text)
tokenize(text, options).join
end
-
+
def sanitizeable?(text)
!(text.nil? || text.empty? || !text.index("<"))
end
-
+
protected
def tokenize(text, options)
tokenizer = HTML::Tokenizer.new(text)
@@ -22,12 +22,12 @@ def tokenize(text, options)
end
result
end
-
+
def process_node(node, result, options)
result << node.to_s
end
end
-
+
class FullSanitizer < Sanitizer
def sanitize(text, options = {})
result = super
@@ -37,12 +37,12 @@ def sanitize(text, options = {})
# Recurse - handle all dirty nested tags
result == text ? result : sanitize(result, options)
end
-
+
def process_node(node, result, options)
result << node.to_s if node.class == HTML::Text
end
end
-
+
class LinkSanitizer < FullSanitizer
cattr_accessor :included_tags, :instance_writer => false
self.included_tags = Set.new(%w(a href))
@@ -50,13 +50,13 @@ class LinkSanitizer < FullSanitizer
def sanitizeable?(text)
!(text.nil? || text.empty? || !((text.index("<a") || text.index("<href")) && text.index(">")))
end
-
+
protected
def process_node(node, result, options)
- result << node.to_s unless node.is_a?(HTML::Tag) && included_tags.include?(node.name)
+ result << node.to_s unless node.is_a?(HTML::Tag) && included_tags.include?(node.name)
end
end
-
+
class WhiteListSanitizer < Sanitizer
[:protocol_separator, :uri_attributes, :allowed_attributes, :allowed_tags, :allowed_protocols, :bad_tags,
:allowed_css_properties, :allowed_css_keywords, :shorthand_css_properties].each do |attr|
@@ -66,35 +66,35 @@ class WhiteListSanitizer < Sanitizer
# A regular expression of the valid characters used to separate protocols like
# the ':' in 'http://foo.com'
self.protocol_separator = /:|(&#0*58)|(&#x70)|(%|&#37;)3A/
-
+
# Specifies a Set of HTML attributes that can have URIs.
self.uri_attributes = Set.new(%w(href src cite action longdesc xlink:href lowsrc))
# Specifies a Set of 'bad' tags that the #sanitize helper will remove completely, as opposed
# to just escaping harmless tags like &lt;font&gt;
self.bad_tags = Set.new(%w(script))
-
+
# Specifies the default Set of tags that the #sanitize helper will allow unscathed.
- self.allowed_tags = Set.new(%w(strong em b i p code pre tt samp kbd var sub
- sup dfn cite big small address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr
+ self.allowed_tags = Set.new(%w(strong em b i p code pre tt samp kbd var sub
+ sup dfn cite big small address hr br div span h1 h2 h3 h4 h5 h6 ul ol li dl dt dd abbr
acronym a img blockquote del ins))
- # Specifies the default Set of html attributes that the #sanitize helper will leave
+ # Specifies the default Set of html attributes that the #sanitize helper will leave
# in the allowed tag.
self.allowed_attributes = Set.new(%w(href src width height alt cite datetime title class name xml:lang abbr))
-
+
# Specifies the default Set of acceptable css properties that #sanitize and #sanitize_css will accept.
- self.allowed_protocols = Set.new(%w(ed2k ftp http https irc mailto news gopher nntp telnet webcal xmpp callto
+ self.allowed_protocols = Set.new(%w(ed2k ftp http https irc mailto news gopher nntp telnet webcal xmpp callto
feed svn urn aim rsync tag ssh sftp rtsp afs))
-
+
# Specifies the default Set of acceptable css keywords that #sanitize and #sanitize_css will accept.
- self.allowed_css_properties = Set.new(%w(azimuth background-color border-bottom-color border-collapse
- border-color border-left-color border-right-color border-top-color clear color cursor direction display
+ self.allowed_css_properties = Set.new(%w(azimuth background-color border-bottom-color border-collapse
+ border-color border-left-color border-right-color border-top-color clear color cursor direction display
elevation float font font-family font-size font-style font-variant font-weight height letter-spacing line-height
overflow pause pause-after pause-before pitch pitch-range richness speak speak-header speak-numeral speak-punctuation
speech-rate stress text-align text-decoration text-indent unicode-bidi vertical-align voice-family volume white-space
width))
-
+
# Specifies the default Set of acceptable css keywords that #sanitize and #sanitize_css will accept.
self.allowed_css_keywords = Set.new(%w(auto aqua black block blue bold both bottom brown center
collapse dashed dotted fuchsia gray green !important italic left lime maroon medium none navy normal
@@ -118,9 +118,9 @@ def sanitize_css(style)
style.scan(/([-\w]+)\s*:\s*([^:;]*)/) do |prop,val|
if allowed_css_properties.include?(prop.downcase)
clean << prop + ': ' + val + ';'
- elsif shorthand_css_properties.include?(prop.split('-')[0].downcase)
+ elsif shorthand_css_properties.include?(prop.split('-')[0].downcase)
unless val.split().any? do |keyword|
- !allowed_css_keywords.include?(keyword) &&
+ !allowed_css_keywords.include?(keyword) &&
keyword !~ /^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$/
end
clean << prop + ': ' + val + ';'
@@ -146,7 +146,7 @@ def process_node(node, result, options)
else
options[:parent].unshift node.name
end
-
+
process_attributes_for node, options
options[:tags].include?(node.name) ? node : nil
@@ -154,7 +154,7 @@ def process_node(node, result, options)
bad_tags.include?(options[:parent].first) ? nil : node.to_s.gsub(/</, "&lt;")
end
end
-
+
def process_attributes_for(node, options)
return unless node.attributes
node.attributes.keys.each do |attr_name|
@@ -169,7 +169,7 @@ def process_attributes_for(node, options)
end
def contains_bad_protocols?(attr_name, value)
- uri_attributes.include?(attr_name) &&
+ uri_attributes.include?(attr_name) &&
(value =~ /(^[^\/:]*):|(&#0*58)|(&#x70)|(%|&#37;)3A/ && !allowed_protocols.include?(value.split(protocol_separator).first))
end
end
View
2  actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb
@@ -182,7 +182,7 @@ module HTML
# not another using <tt>:not</tt>. For example:
# p:not(.post)
# Matches all paragraphs that do not have the class <tt>.post</tt>.
- #
+ #
# === Substitution Values
#
# You can use substitution with identifiers, class names and element values.
View
16 actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb
@@ -1,7 +1,7 @@
require 'strscan'
module HTML #:nodoc:
-
+
# A simple HTML tokenizer. It simply breaks a stream of text into tokens, where each
# token is a string. Each string represents either "text", or an HTML element.
#
@@ -14,13 +14,13 @@ module HTML #:nodoc:
# p token
# end
class Tokenizer #:nodoc:
-
+
# The current (byte) position in the text
attr_reader :position
-
+
# The current line number
attr_reader :line
-
+
# Create a new Tokenizer for the given text.
def initialize(text)
text.encode! if text.encoding_aware?
@@ -42,7 +42,7 @@ def next
update_current_line(scan_text)
end
end
-
+
private
# Treat the text at the current position as a tag, and scan it. Supports
@@ -69,13 +69,13 @@ def scan_tag
def scan_text
"#{@scanner.getch}#{@scanner.scan(/[^<]*/)}"
end
-
+
# Counts the number of newlines in the text and updates the current line
# accordingly.
def update_current_line(text)
text.scan(/\r?\n/) { @current_line += 1 }
end
-
+
# Skips over quoted strings, so that less-than and greater-than characters
# within the strings are ignored.
def consume_quoted_regions
@@ -103,5 +103,5 @@ def consume_quoted_regions
text
end
end
-
+
end
View
20 actionpack/lib/action_dispatch/http/mime_type.rb
@@ -109,10 +109,10 @@ def parse(accept_header)
else
# keep track of creation order to keep the subsequent sort stable
list = []
- accept_header.split(/,/).each_with_index do |header, index|
- params, q = header.split(/;\s*q=/)
+ accept_header.split(/,/).each_with_index do |header, index|
+ params, q = header.split(/;\s*q=/)
if params
- params.strip!
+ params.strip!
list << AcceptItem.new(index, params, q) unless params.empty?
end
end
@@ -161,20 +161,20 @@ def parse(accept_header)
end
end
end
-
+
def initialize(string, symbol = nil, synonyms = [])
@symbol, @synonyms = symbol, synonyms
@string = string
end
-
+
def to_s
@string
end
-
+
def to_str
to_s
end
-
+
def to_sym
@symbol || @string.to_sym
end
@@ -186,11 +186,11 @@ def ===(list)
super
end
end
-
+
def ==(mime_type)
return false if mime_type.blank?
- (@synonyms + [ self ]).any? do |synonym|
- synonym.to_s == mime_type.to_s || synonym.to_sym == mime_type.to_sym
+ (@synonyms + [ self ]).any? do |synonym|
+ synonym.to_s == mime_type.to_s || synonym.to_sym == mime_type.to_sym
end
end
View
2  actionpack/lib/action_dispatch/middleware/stack.rb
@@ -69,7 +69,7 @@ def use(*args, &block)
end
def active
- ActiveSupport::Deprecation.warn "All middlewares in the chain are active since the laziness " <<
+ ActiveSupport::Deprecation.warn "All middlewares in the chain are active since the laziness " <<
"was removed from the middleware stack", caller
end
View
8 actionpack/lib/action_dispatch/routing.rb
@@ -15,7 +15,7 @@ module ActionDispatch
# match ':controller(/:action(/:id(.:format)))'
#
# This route states that it expects requests to consist of a
- # <tt>:controller</tt> followed optionally by an <tt>:action</tt> that in
+ # <tt>:controller</tt> followed optionally by an <tt>:action</tt> that in
# turn is followed optionally by an <tt>:id</tt>, which in turn is followed
# optionally by a <tt>:format</tt>
#
@@ -134,8 +134,8 @@ module ActionDispatch
# == HTTP Methods
#
# Using the <tt>:via</tt> option when specifying a route allows you to restrict it to a specific HTTP method.
- # Possible values are <tt>:post</tt>, <tt>:get</tt>, <tt>:put</tt>, <tt>:delete</tt> and <tt>:any</tt>.
- # If your route needs to respond to more than one method you can use an array, e.g. <tt>[ :get, :post ]</tt>.
+ # Possible values are <tt>:post</tt>, <tt>:get</tt>, <tt>:put</tt>, <tt>:delete</tt> and <tt>:any</tt>.
+ # If your route needs to respond to more than one method you can use an array, e.g. <tt>[ :get, :post ]</tt>.
# The default value is <tt>:any</tt> which means that the route will respond to any of the HTTP methods.
#
# Examples:
@@ -144,7 +144,7 @@ module ActionDispatch
# match 'post/:id' => "posts#create_comment', :via => :post
#
# Now, if you POST to <tt>/posts/:id</tt>, it will route to the <tt>create_comment</tt> action. A GET on the same
- # URL will route to the <tt>show</tt> action.
+ # URL will route to the <tt>show</tt> action.
#
# === HTTP helper methods
#
View
2  actionpack/lib/action_view/helpers/debug_helper.rb
@@ -1,6 +1,6 @@
module ActionView
# = Action View Debug Helper
- #
+ #
# Provides a set of methods for making it easier to debug Rails objects.
module Helpers
module DebugHelper
View
16 actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -53,16 +53,16 @@ module Helpers
# <option value="2">Sam</option>
# <option value="3">Tobias</option>
# </select>
- #
- # Like the other form helpers, +select+ can accept an <tt>:index</tt> option to manually set the ID used in the resulting output. Unlike other helpers, +select+ expects this
+ #
+ # Like the other form helpers, +select+ can accept an <tt>:index</tt> option to manually set the ID used in the resulting output. Unlike other helpers, +select+ expects this
# option to be in the +html_options+ parameter.
- #
- # Example:
- #
+ #
+ # Example:
+ #
# select("album[]", "genre", %w[rap rock country], {}, { :index => nil })
- #
+ #
# becomes:
- #
+ #
# <select name="album[][genre]" id="album__genre">
# <option value="rap">rap</option>
# <option value="rock">rock</option>
@@ -140,7 +140,7 @@ def select(object, method, choices, options = {}, html_options = {})
# The <tt>:value_method</tt> and <tt>:text_method</tt> parameters are methods to be called on each member
# of +collection+. The return values are used as the +value+ attribute and contents of each
# <tt><option></tt> tag, respectively.
- #
+ #
# Example object structure for use with this method:
# class Post < ActiveRecord::Base
# belongs_to :author