Permalink
Browse files

Merge branch 'master' of git@github.com:lifo/docrails

  • Loading branch information...
2 parents fa0cca3 + d4b7cd9 commit 6a5ac86207765e2c041378b35c05812f9bfe68b9 @TomK32 TomK32 committed Jun 11, 2008
Showing with 3,929 additions and 1,547 deletions.
  1. +7 −0 .gitignore
  2. +1 −1 actionmailer/CHANGELOG
  3. +1 −1 actionmailer/Rakefile
  4. +20 −14 actionmailer/lib/action_mailer/base.rb
  5. +1 −1 actionmailer/lib/action_mailer/helpers.rb
  6. +2 −2 actionmailer/lib/action_mailer/part.rb
  7. +1 −1 actionmailer/lib/action_mailer/quoting.rb
  8. +2 −2 actionmailer/lib/action_mailer/vendor.rb
  9. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail.rb
  10. +2 −2 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/address.rb
  11. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/attachments.rb
  12. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/base64.rb
  13. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/compat.rb
  14. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/config.rb
  15. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/core_extensions.rb
  16. +26 −6 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/encode.rb
  17. +1 −1 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/header.rb
  18. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/index.rb
  19. +7 −2 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/interface.rb
  20. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/loader.rb
  21. +4 −4 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/mail.rb
  22. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/mailbox.rb
  23. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/main.rb
  24. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/mbox.rb
  25. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/net.rb
  26. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/obsolete.rb
  27. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/parser.rb
  28. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/port.rb
  29. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/quoting.rb
  30. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/require_arch.rb
  31. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/scanner.rb
  32. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/scanner_r.rb
  33. 0 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/stringio.rb
  34. +1 −1 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/utils.rb
  35. +1 −1 actionmailer/lib/action_mailer/vendor/{tmail-1.2.2 → tmail-1.2.3}/tmail/version.rb
  36. +2 −2 actionmailer/lib/action_mailer/version.rb
  37. +34 −0 actionmailer/test/mail_service_test.rb
  38. +6 −1 actionpack/CHANGELOG
  39. +6 −12 actionpack/README
  40. +1 −1 actionpack/Rakefile
  41. +1 −0 actionpack/lib/action_controller.rb
  42. +2 −1 actionpack/lib/action_controller/assertions/model_assertions.rb
  43. +3 −3 actionpack/lib/action_controller/assertions/routing_assertions.rb
  44. +13 −13 actionpack/lib/action_controller/assertions/selector_assertions.rb
  45. +3 −3 actionpack/lib/action_controller/assertions/tag_assertions.rb
  46. +8 −8 actionpack/lib/action_controller/base.rb
  47. +13 −2 actionpack/lib/action_controller/caching/fragments.rb
  48. +23 −18 actionpack/lib/action_controller/cgi_ext/cookie.rb
  49. +1 −0 actionpack/lib/action_controller/cgi_ext/stdinput.rb
  50. +2 −1 actionpack/lib/action_controller/cgi_process.rb
  51. +7 −1 actionpack/lib/action_controller/dispatcher.rb
  52. +20 −20 actionpack/lib/action_controller/filters.rb
  53. +7 −7 actionpack/lib/action_controller/helpers.rb
  54. +14 −10 actionpack/lib/action_controller/integration.rb
  55. +1 −1 actionpack/lib/action_controller/mime_responds.rb
  56. +2 −2 actionpack/lib/action_controller/mime_type.rb
  57. +6 −7 actionpack/lib/action_controller/polymorphic_routes.rb
  58. +321 −0 actionpack/lib/action_controller/rack_process.rb
  59. +20 −14 actionpack/lib/action_controller/request.rb
  60. +1 −1 actionpack/lib/action_controller/request_forgery_protection.rb
  61. +17 −8 actionpack/lib/action_controller/request_profiler.rb
  62. +3 −3 actionpack/lib/action_controller/resources.rb
  63. +3 −3 actionpack/lib/action_controller/routing/builder.rb
  64. +1 −1 actionpack/lib/action_controller/routing/segments.rb
  65. +1 −1 actionpack/lib/action_controller/session/cookie_store.rb
  66. +23 −0 actionpack/lib/action_controller/test_case.rb
  67. +5 −4 actionpack/lib/action_controller/test_process.rb
  68. +2 −2 actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb
  69. +2 −2 actionpack/lib/action_pack/version.rb
  70. +5 −5 actionpack/lib/action_view/base.rb
  71. +0 −69 actionpack/lib/action_view/compiled_templates.rb
  72. +1 −1 actionpack/lib/action_view/helpers/active_record_helper.rb
  73. +12 −12 actionpack/lib/action_view/helpers/asset_tag_helper.rb
  74. +1 −1 actionpack/lib/action_view/helpers/date_helper.rb
  75. +20 −13 actionpack/lib/action_view/helpers/debug_helper.rb
  76. +89 −40 actionpack/lib/action_view/helpers/form_helper.rb
  77. +32 −24 actionpack/lib/action_view/helpers/form_options_helper.rb
  78. +4 −4 actionpack/lib/action_view/helpers/form_tag_helper.rb
  79. +20 −3 actionpack/lib/action_view/helpers/javascript_helper.rb
  80. +6 −6 actionpack/lib/action_view/helpers/prototype_helper.rb
  81. +2 −2 actionpack/lib/action_view/helpers/record_tag_helper.rb
  82. +16 −15 actionpack/lib/action_view/helpers/sanitize_helper.rb
  83. +79 −84 actionpack/lib/action_view/helpers/scriptaculous_helper.rb
  84. +2 −2 actionpack/lib/action_view/helpers/text_helper.rb
  85. +2 −2 actionpack/lib/action_view/helpers/url_helper.rb
  86. +2 −2 actionpack/lib/action_view/template.rb
  87. +4 −10 actionpack/lib/action_view/test_case.rb
  88. +14 −0 actionpack/test/controller/action_pack_assertions_test.rb
  89. +22 −20 actionpack/test/controller/caching_test.rb
  90. +33 −0 actionpack/test/controller/cgi_test.rb
  91. +1 −1 actionpack/test/controller/helper_test.rb
  92. +150 −0 actionpack/test/controller/rack_test.rb
  93. +7 −0 actionpack/test/controller/routing_test.rb
  94. +15 −5 actionpack/test/controller/test_test.rb
  95. +0 −192 actionpack/test/template/compiled_templates_test.rb
  96. +6 −0 actionpack/test/template/date_helper_test.rb
  97. +11 −0 actionpack/test/template/form_helper_test.rb
  98. +2 −4 actionpack/test/template/prototype_helper_test.rb
  99. +3 −0 actionpack/test/template/text_helper_test.rb
  100. +13 −1 activemodel/Rakefile
  101. +14 −1 activerecord/CHANGELOG
  102. +1 −1 activerecord/Rakefile
  103. +9 −9 activerecord/lib/active_record/aggregations.rb
  104. +1 −1 activerecord/lib/active_record/association_preload.rb
  105. +78 −64 activerecord/lib/active_record/associations.rb
  106. +32 −3 activerecord/lib/active_record/associations/association_collection.rb
  107. +3 −2 activerecord/lib/active_record/associations/association_proxy.rb
  108. +3 −2 activerecord/lib/active_record/associations/belongs_to_association.rb
  109. +5 −6 activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
  110. +1 −1 activerecord/lib/active_record/associations/has_many_association.rb
  111. +2 −2 activerecord/lib/active_record/associations/has_many_through_association.rb
  112. +3 −2 activerecord/lib/active_record/associations/has_one_association.rb
  113. +6 −2 activerecord/lib/active_record/attribute_methods.rb
  114. +129 −109 activerecord/lib/active_record/base.rb
  115. +12 −10 activerecord/lib/active_record/calculations.rb
  116. +2 −2 activerecord/lib/active_record/callbacks.rb
  117. +1 −1 activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
  118. +9 −4 activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
  119. +16 −16 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
  120. +3 −3 activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
  121. +5 −9 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
  122. +2 −1 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
  123. +2 −2 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
  124. +4 −0 activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
  125. +31 −15 activerecord/lib/active_record/dirty.rb
  126. +25 −24 activerecord/lib/active_record/fixtures.rb
  127. +7 −7 activerecord/lib/active_record/locking/optimistic.rb
  128. +2 −2 activerecord/lib/active_record/migration.rb
  129. +30 −6 activerecord/lib/active_record/named_scope.rb
  130. +2 −2 activerecord/lib/active_record/observer.rb
  131. +2 −2 activerecord/lib/active_record/schema.rb
  132. +1 −1 activerecord/lib/active_record/schema_dumper.rb
  133. +3 −3 activerecord/lib/active_record/serializers/xml_serializer.rb
  134. +2 −2 activerecord/lib/active_record/transactions.rb
  135. +26 −26 activerecord/lib/active_record/validations.rb
  136. +2 −2 activerecord/lib/active_record/version.rb
  137. +41 −32 activerecord/test/cases/active_schema_test_mysql.rb
  138. +20 −0 activerecord/test/cases/adapter_test.rb
  139. +35 −3 activerecord/test/cases/associations/belongs_to_associations_test.rb
  140. +2 −0 activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
  141. +72 −0 activerecord/test/cases/associations/has_many_associations_test.rb
  142. +1 −0 activerecord/test/cases/associations/has_many_through_associations_test.rb
  143. +5 −0 activerecord/test/cases/associations/has_one_associations_test.rb
  144. +2 −0 activerecord/test/cases/associations/join_model_test.rb
  145. +14 −2 activerecord/test/cases/associations_test.rb
  146. +4 −4 activerecord/test/cases/datatype_test_postgresql.rb
  147. +1 −1 activerecord/test/cases/defaults_test.rb
  148. +18 −0 activerecord/test/cases/dirty_test.rb
  149. +1 −1 activerecord/test/cases/finder_test.rb
  150. +17 −1 activerecord/test/cases/inheritance_test.rb
  151. +16 −0 activerecord/test/cases/method_scoping_test.rb
  152. +2 −2 activerecord/test/cases/migration_test.rb
  153. +38 −2 activerecord/test/cases/named_scope_test.rb
  154. +3 −2 activerecord/test/cases/reflection_test.rb
  155. +26 −0 activerecord/test/cases/transactions_test.rb
  156. +6 −0 activerecord/test/cases/validations_test.rb
  157. +2 −0 activerecord/test/models/company.rb
  158. +1 −1 activeresource/CHANGELOG
  159. +1 −1 activeresource/Rakefile
  160. +26 −26 activeresource/lib/active_resource/base.rb
  161. +7 −7 activeresource/lib/active_resource/custom_methods.rb
  162. +1 −1 activeresource/lib/active_resource/formats/xml_format.rb
  163. +74 −3 activeresource/lib/active_resource/http_mock.rb
  164. +2 −2 activeresource/lib/active_resource/validations.rb
  165. +2 −2 activeresource/lib/active_resource/version.rb
  166. +9 −1 activesupport/CHANGELOG
  167. +6 −2 activesupport/lib/active_support/cache.rb
  168. +6 −1 activesupport/lib/active_support/cache/file_store.rb
  169. +7 −1 activesupport/lib/active_support/cache/mem_cache_store.rb
  170. +6 −1 activesupport/lib/active_support/cache/memory_store.rb
  171. +1 −1 activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb
  172. +2 −2 activesupport/lib/active_support/core_ext/hash/conversions.rb
  173. +1 −1 activesupport/lib/active_support/core_ext/hash/except.rb
  174. +8 −4 activesupport/lib/active_support/core_ext/integer/even_odd.rb
  175. +1 −1 activesupport/lib/active_support/core_ext/object/misc.rb
  176. +2 −2 activesupport/lib/active_support/core_ext/string/inflections.rb
  177. +5 −5 activesupport/lib/active_support/core_ext/string/unicode.rb
  178. +1 −1 activesupport/lib/active_support/core_ext/time/calculations.rb
  179. +1 −1 activesupport/lib/active_support/core_ext/time/conversions.rb
  180. +24 −13 activesupport/lib/active_support/core_ext/time/zones.rb
  181. +12 −11 activesupport/lib/active_support/dependencies.rb
  182. +2 −2 activesupport/lib/active_support/deprecation.rb
  183. +59 −59 activesupport/lib/active_support/inflector.rb
  184. +1 −1 activesupport/lib/active_support/json.rb
  185. +1 −1 activesupport/lib/active_support/json/decoding.rb
  186. +9 −2 activesupport/lib/active_support/json/encoders/date.rb
  187. +9 −2 activesupport/lib/active_support/json/encoders/date_time.rb
  188. +11 −4 activesupport/lib/active_support/json/encoders/time.rb
  189. +8 −6 activesupport/lib/active_support/multibyte/chars.rb
  190. +8 −10 activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb
  191. +10 −2 activesupport/lib/active_support/testing/setup_and_teardown.rb
  192. +61 −22 activesupport/lib/active_support/time_with_zone.rb
  193. +24 −3 activesupport/lib/active_support/values/time_zone.rb
  194. +1 −1 activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb
  195. +2 −2 activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb
  196. +1 −1 activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone.rb
  197. +1 −1 activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/data_timezone_info.rb
  198. +1 −1 activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/linked_timezone.rb
  199. +57 −57 activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/offset_rationals.rb
  200. +1 −1 activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone.rb
  201. +1 −1 activesupport/lib/active_support/vendor/tzinfo-0.3.8/tzinfo/timezone_transition_info.rb
  202. +3 −3 activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb
  203. +2 −2 activesupport/lib/active_support/version.rb
  204. +38 −0 activesupport/test/core_ext/hash_ext_test.rb
  205. +7 −0 activesupport/test/core_ext/time_with_zone_test.rb
  206. +20 −6 activesupport/test/dependencies_test.rb
  207. +16 −0 activesupport/test/json/encoding_test.rb
  208. +1 −1 activesupport/test/time_zone_test.rb
  209. +1 −1 railties/CHANGELOG
  210. +5 −5 railties/Rakefile
  211. +2 −2 railties/configs/databases/frontbase.yml
  212. +2 −2 railties/configs/databases/mysql.yml
  213. +3 −3 railties/configs/databases/oracle.yml
  214. +2 −2 railties/configs/databases/postgresql.yml
  215. +2 −2 railties/configs/databases/sqlite2.yml
  216. +2 −2 railties/configs/databases/sqlite3.yml
  217. +5 −8 railties/configs/initializers/new_rails_defaults.rb
  218. +91 −0 railties/doc/guides/actionview/helpers.markdown
  219. +91 −0 railties/doc/guides/actionview/partials.markdown
  220. +56 −0 railties/doc/guides/activerecord/basics.markdown
  221. +862 −0 railties/doc/guides/creating_plugins/basics.markdown
  222. +5 −5 railties/environments/environment.rb
  223. +1 −1 railties/environments/test.rb
  224. +2 −2 railties/lib/commands/console.rb
  225. +13 −4 railties/lib/commands/dbconsole.rb
  226. +1 −1 railties/lib/commands/plugin.rb
  227. +2 −2 railties/lib/commands/process/spawner.rb
  228. +1 −1 railties/lib/commands/servers/lighttpd.rb
  229. +1 −1 railties/lib/commands/servers/mongrel.rb
  230. +1 −1 railties/lib/commands/servers/webrick.rb
  231. +59 −35 railties/lib/initializer.rb
  232. +11 −4 railties/lib/rails/gem_dependency.rb
  233. +1 −1 railties/lib/rails/mongrel_server/commands.rb
  234. +6 −11 railties/lib/rails/plugin.rb
  235. +5 −0 railties/lib/rails/rack.rb
  236. +35 −0 railties/lib/rails/rack/static.rb
  237. +2 −2 railties/lib/rails/version.rb
  238. +1 −1 railties/lib/rails_generator/base.rb
  239. +6 −4 railties/lib/rails_generator/commands.rb
  240. +4 −4 railties/lib/rails_generator/generators/components/migration/USAGE
  241. +9 −5 railties/lib/rails_generator/generators/components/scaffold/USAGE
  242. +1 −1 railties/lib/rails_generator/scripts.rb
  243. +6 −7 railties/lib/rails_generator/scripts/destroy.rb
  244. +1 −1 railties/lib/rails_generator/secret_key_generator.rb
  245. +1 −1 railties/lib/tasks/databases.rake
  246. +9 −3 railties/lib/tasks/gems.rake
  247. +1 −1 railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml
  248. +30 −30 railties/test/generators/generator_test_helper.rb
  249. +2 −5 release.rb
View
@@ -5,3 +5,10 @@ actionpack/doc
actionmailer/doc
activesupport/doc
railties/doc
+activeresource/pkg
+activerecord/pkg
+actionpack/pkg
+actionmailer/pkg
+activesupport/pkg
+railties/pkg
+*.rbc
View
@@ -1,4 +1,4 @@
-*2.1.0 RC1 (May 11th, 2008)*
+*2.1.0 (May 31st, 2008)*
* Fixed that a return-path header would be ignored #7572 [joost]
View
@@ -55,7 +55,7 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "actionmailer"
s.homepage = "http://www.rubyonrails.org"
- s.add_dependency('actionpack', '= 2.0.991' + PKG_BUILD)
+ s.add_dependency('actionpack', '= 2.1.0' + PKG_BUILD)
s.has_rdoc = true
s.requirements << 'none'
@@ -5,12 +5,12 @@
require 'tmail/net'
module ActionMailer #:nodoc:
- # ActionMailer allows you to send email from your application using a mailer model and views.
+ # Action Mailer allows you to send email from your application using a mailer model and views.
#
#
# = Mailer Models
#
- # To use ActionMailer, you need to create a mailer model.
+ # To use Action Mailer, you need to create a mailer model.
#
# $ script/generate mailer Notifier
#
@@ -35,7 +35,8 @@ module ActionMailer #:nodoc:
# * <tt>subject</tt> - The subject of your email. Sets the <tt>Subject:</tt> header.
# * <tt>from</tt> - Who the email you are sending is from. Sets the <tt>From:</tt> header.
# * <tt>cc</tt> - Takes one or more email addresses. These addresses will receive a carbon copy of your email. Sets the <tt>Cc:</tt> header.
- # * <tt>bcc</tt> - Takes one or more email address. These addresses will receive a blind carbon copy of your email. Sets the <tt>Bcc:</tt> header.
+ # * <tt>bcc</tt> - Takes one or more email addresses. These addresses will receive a blind carbon copy of your email. Sets the <tt>Bcc:</tt> header.
+ # * <tt>reply_to</tt> - Takes one or more email addresses. These addresses will be listed as the default recipients when replying to your email. Sets the <tt>Reply-To:</tt> header.
# * <tt>sent_on</tt> - The date on which the message was sent. If not set, the header wil be set by the delivery agent.
# * <tt>content_type</tt> - Specify the content type of the message. Defaults to <tt>text/plain</tt>.
# * <tt>headers</tt> - Specify additional headers to be set for the message, e.g. <tt>headers 'X-Mail-Count' => 107370</tt>.
@@ -54,7 +55,7 @@ module ActionMailer #:nodoc:
#
# = Mailer views
#
- # Like ActionController, each mailer class has a corresponding view directory
+ # Like Action Controller, each mailer class has a corresponding view directory
# in which each method of the class looks for a template with its name.
# To define a template to be used with a mailing, create an <tt>.erb</tt> file with the same name as the method
# in your mailer model. For example, in the mailer defined above, the template at
@@ -157,7 +158,7 @@ module ActionMailer #:nodoc:
# end
# end
#
- # Multipart messages can also be used implicitly because ActionMailer will automatically
+ # 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 separate part to the message.
#
@@ -317,6 +318,10 @@ class Base
# Specify the from address for the message.
adv_attr_accessor :from
+ # Specify the address (if different than the "from" address) to direct
+ # replies to this message.
+ adv_attr_accessor :reply_to
+
# Specify additional headers to be added to the message.
adv_attr_accessor :headers
@@ -383,8 +388,8 @@ def method_missing(method_symbol, *parameters)#:nodoc:
# Receives a raw email, parses it into an email object, decodes it,
# instantiates a new mailer, and passes the email object to the mailer
- # object's #receive method. If you want your mailer to be able to
- # process incoming messages, you'll need to implement a #receive
+ # object's +receive+ method. If you want your mailer to be able to
+ # process incoming messages, you'll need to implement a +receive+
# method that accepts the email object as a parameter:
#
# class MyMailer < ActionMailer::Base
@@ -490,7 +495,7 @@ def create!(method_name, *parameters) #:nodoc:
end
# Delivers a TMail::Mail object. By default, it delivers the cached mail
- # object (from the #create! method). If no cached mail object exists, and
+ # object (from the <tt>create!</tt> method). If no cached mail object exists, and
# no alternate has been given as the parameter, this will fail.
def deliver!(mail = @mail)
raise "no mail object available for delivery!" unless mail
@@ -576,13 +581,14 @@ def sort_parts(parts, order = [])
def create_mail
m = TMail::Mail.new
- m.subject, = quote_any_if_necessary(charset, subject)
- m.to, m.from = quote_any_address_if_necessary(charset, recipients, from)
- m.bcc = quote_address_if_necessary(bcc, charset) unless bcc.nil?
- m.cc = quote_address_if_necessary(cc, charset) unless cc.nil?
-
+ m.subject, = quote_any_if_necessary(charset, subject)
+ m.to, m.from = quote_any_address_if_necessary(charset, recipients, from)
+ m.bcc = quote_address_if_necessary(bcc, charset) unless bcc.nil?
+ m.cc = quote_address_if_necessary(cc, charset) unless cc.nil?
+ m.reply_to = quote_address_if_necessary(reply_to, charset) unless reply_to.nil?
m.mime_version = mime_version unless mime_version.nil?
- m.date = sent_on.to_time rescue sent_on if sent_on
+ m.date = sent_on.to_time rescue sent_on if sent_on
+
headers.each { |k, v| m[k] = v }
real_content_type, ctype_attrs = parse_content_type
@@ -34,7 +34,7 @@ def add_template_helper(helper_module) #:nodoc:
# helper FooHelper
# includes FooHelper in the template class.
# helper { def foo() "#{bar} is the very best" end }
- # evaluates the block in the template class, adding method #foo.
+ # evaluates the block in the template class, adding method +foo+.
# helper(:three, BlindHelper) { def mice() 'mice' end }
# does all three.
def helper(*args, &block)
@@ -5,15 +5,15 @@
module ActionMailer
# Represents a subpart of an email message. It shares many similar
# attributes of ActionMailer::Base. Although you can create parts manually
- # and add them to the #parts list of the mailer, it is easier
+ # and add them to the +parts+ list of the mailer, it is easier
# to use the helper methods in ActionMailer::PartContainer.
class Part
include ActionMailer::AdvAttrAccessor
include ActionMailer::PartContainer
# Represents the body of the part, as a string. This should not be a
# Hash (like ActionMailer::Base), but if you want a template to be rendered
- # into the body of a subpart you can do it with the mailer's #render method
+ # into the body of a subpart you can do it with the mailer's +render+ method
# and assign the result here.
adv_attr_accessor :body
@@ -40,7 +40,7 @@ def quote_any_if_necessary(charset, *args)
# regular email address, or it can be a phrase followed by an address in
# brackets. The phrase is the only part that will be quoted, and only if
# it needs to be. This allows extended characters to be used in the
- # "to", "from", "cc", and "bcc" headers.
+ # "to", "from", "cc", "bcc" and "reply-to" headers.
def quote_address_if_necessary(address, charset)
if Array === address
address.map { |a| quote_address_if_necessary(a, charset) }
@@ -2,9 +2,9 @@
require 'rubygems'
begin
- gem 'tmail', '~> 1.2.2'
+ gem 'tmail', '~> 1.2.3'
rescue Gem::LoadError
- $:.unshift "#{File.dirname(__FILE__)}/vendor/tmail-1.2.2"
+ $:.unshift "#{File.dirname(__FILE__)}/vendor/tmail-1.2.3"
end
begin
@@ -38,7 +38,7 @@ module TMail
# = Class Address
#
# Provides a complete handling library for email addresses. Can parse a string of an
- # address directly or take in preformatted addresses themseleves. Allows you to add
+ # address directly or take in preformatted addresses themselves. Allows you to add
# and remove phrases from the front of the address and provides a compare function for
# email addresses.
#
@@ -143,7 +143,7 @@ def initialize( local, domain )
# This is to catch an unquoted "@" symbol in the local part of the
# address. Handles addresses like <"@"@me.com> and makes sure they
- # stay like <"@"@me.com> (previously were becomming <@@me.com>)
+ # stay like <"@"@me.com> (previously were becoming <@@me.com>)
if local && (local.join == '@' || local.join =~ /\A[^"].*?@.*?[^"]\Z/)
@local = "\"#{local.join}\""
else
@@ -339,22 +339,36 @@ def encode_value( str )
def scanadd( str, force = false )
types = ''
strs = []
-
+ if str.respond_to?(:encoding)
+ enc = str.encoding
+ str.force_encoding(Encoding::ASCII_8BIT)
+ end
until str.empty?
if m = /\A[^\e\t\r\n ]+/.match(str)
types << (force ? 'j' : 'a')
- strs.push m[0]
-
+ if str.respond_to?(:encoding)
+ strs.push m[0].force_encoding(enc)
+ else
+ strs.push m[0]
+ end
elsif m = /\A[\t\r\n ]+/.match(str)
types << 's'
- strs.push m[0]
+ if str.respond_to?(:encoding)
+ strs.push m[0].force_encoding(enc)
+ else
+ strs.push m[0]
+ end
elsif m = /\A\e../.match(str)
esc = m[0]
str = m.post_match
if esc != "\e(B" and m = /\A[^\e]+/.match(str)
types << 'j'
- strs.push m[0]
+ if str.respond_to?(:encoding)
+ strs.push m[0].force_encoding(enc)
+ else
+ strs.push m[0]
+ end
end
else
@@ -453,7 +467,13 @@ def extract_J( chunksize, str )
size = max_bytes(chunksize, str.size) - 6
size = (size % 2 == 0) ? (size) : (size - 1)
return nil if size <= 0
- "\e$B#{str.slice!(0, size)}\e(B"
+ if str.respond_to?(:encoding)
+ enc = str.encoding
+ str.force_encoding(Encoding::ASCII_8BIT)
+ "\e$B#{str.slice!(0, size)}\e(B".force_encoding(enc)
+ else
+ "\e$B#{str.slice!(0, size)}\e(B"
+ end
end
def extract_A( chunksize, str )
@@ -59,7 +59,7 @@ def new( name, body, conf = DEFAULT_CONFIG )
#
# This is because a mailbox doesn't have the : after the From that designates the
# beginning of the envelope sender (which can be different to the from address of
- # the emial)
+ # the email)
#
# Other fields can be passed as normal, "Reply-To", "Received" etc.
#
@@ -42,7 +42,7 @@ class Mail
# Allows you to query the mail object with a string to get the contents
# of the field you want.
#
- # Returns a string of the exact contnts of the field
+ # Returns a string of the exact contents of the field
#
# mail.from = "mikel <mikel@lindsaar.net>"
# mail.header_string("From") #=> "mikel <mikel@lindsaar.net>"
@@ -591,12 +591,17 @@ def message_id( default = nil )
end
# Destructively sets the message ID of the mail object instance to the passed in string
+ #
+ # Invalid message IDs are ignored (silently, unless configured otherwise) and result in
+ # a nil message ID. Left and right angle brackets are required.
#
# Example:
#
# mail = TMail::Mail.new
+ # mail.message_id = "<348F04F142D69C21-291E56D292BC@xxxx.net>"
+ # mail.message_id #=> "<348F04F142D69C21-291E56D292BC@xxxx.net>"
# mail.message_id = "this_is_my_badly_formatted_message_id"
- # mail.message_id #=> "this_is_my_badly_formatted_message_id"
+ # mail.message_id #=> nil
def message_id=( str )
set_string_attr 'Message-Id', str
end
@@ -255,7 +255,7 @@ def sub_header(key, param)
alias fetch []
# Allows you to set or delete TMail header objects at will.
- # Eamples:
+ # Examples:
# @mail = TMail::Mail.new
# @mail['to'].to_s # => 'mikel@test.com.au'
# @mail['to'] = 'mikel@elsewhere.org'
@@ -265,7 +265,7 @@ def sub_header(key, param)
# @mail['to'].to_s # => nil
# @mail.encoded # => "\r\n"
#
- # Note: setting mail[] = nil actualy deletes the header field in question from the object,
+ # Note: setting mail[] = nil actually deletes the header field in question from the object,
# it does not just set the value of the hash to nil
def []=( key, val )
dkey = key.downcase
@@ -408,8 +408,8 @@ def parse_header( f )
when /\AFrom (\S+)/
unixfrom = $1
- when /^charset=.*/
-
+ when /^charset=.*/
+
else
raise SyntaxError, "wrong mail header: '#{line.inspect}'"
end
@@ -118,7 +118,7 @@ module TextUtils
ATOM_UNSAFE = /[#{Regexp.quote aspecial}#{control}#{lwsp}]/n
PHRASE_UNSAFE = /[#{Regexp.quote aspecial}#{control}]/n
TOKEN_UNSAFE = /[#{Regexp.quote tspecial}#{control}#{lwsp}]/n
-
+
# Returns true if the string supplied is free from characters not allowed as an ATOM
def atom_safe?( str )
not ATOM_UNSAFE === str
@@ -32,7 +32,7 @@ module TMail
module VERSION
MAJOR = 1
MINOR = 2
- TINY = 2
+ TINY = 3
STRING = [MAJOR, MINOR, TINY].join('.')
end
@@ -1,8 +1,8 @@
module ActionMailer
module VERSION #:nodoc:
MAJOR = 2
- MINOR = 0
- TINY = 991
+ MINOR = 1
+ TINY = 0
STRING = [MAJOR, MINOR, TINY].join('.')
end
@@ -40,6 +40,15 @@ def cc_bcc(recipient)
body "Nothing to see here."
end
+ def different_reply_to(recipient)
+ recipients recipient
+ subject "testing reply_to"
+ from "system@loudthinking.com"
+ sent_on Time.local(2008, 5, 23)
+ reply_to "atraver@gmail.com"
+ body "Nothing to see here."
+ end
+
def iso_charset(recipient)
@recipients = recipient
@subject = "testing isø charsets"
@@ -445,6 +454,31 @@ def test_cc_bcc
assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
end
+ def test_reply_to
+ expected = new_mail
+
+ expected.to = @recipient
+ expected.subject = "testing reply_to"
+ expected.body = "Nothing to see here."
+ expected.from = "system@loudthinking.com"
+ expected.reply_to = "atraver@gmail.com"
+ expected.date = Time.local 2008, 5, 23
+
+ created = nil
+ assert_nothing_raised do
+ created = TestMailer.create_different_reply_to @recipient
+ end
+ assert_not_nil created
+ assert_equal expected.encoded, created.encoded
+
+ assert_nothing_raised do
+ TestMailer.deliver_different_reply_to @recipient
+ end
+
+ assert_not_nil ActionMailer::Base.deliveries.first
+ assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded
+ end
+
def test_iso_charset
expected = new_mail( "iso-8859-1" )
expected.to = @recipient
View
@@ -1,4 +1,9 @@
-*2.1.0 RC1 (May 11th, 2008)*
+* Added Rack processor [Ezra Zygmuntowicz, Josh Peek]
+
+
+*2.1.0 (May 31st, 2008)*
+
+* InstanceTag#default_time_from_options overflows to DateTime [Geoff Buesing]
* Fixed that forgery protection can be used without session tracking (Peter Jones) [#139]
Oops, something went wrong.

0 comments on commit 6a5ac86

Please sign in to comment.