1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

update ActionMailer documentation [ci skip]

This commit is contained in:
Francesco Rodriguez 2012-09-17 19:18:56 -05:00
parent e9acafd984
commit e2c7545cdd
5 changed files with 15 additions and 18 deletions

View file

@ -2,7 +2,7 @@ require 'abstract_controller/collector'
require 'active_support/core_ext/hash/reverse_merge'
require 'active_support/core_ext/array/extract_options'
module ActionMailer #:nodoc:
module ActionMailer
class Collector
include AbstractController::Collector
attr_reader :responses

View file

@ -1,8 +1,8 @@
require 'tmpdir'
module ActionMailer
# This module handles everything related to mail delivery, from registering new
# delivery methods to configuring the mail object to be sent.
# This module handles everything related to mail delivery, from registering
# new delivery methods to configuring the mail object to be sent.
module DeliveryMethods
extend ActiveSupport::Concern
@ -42,22 +42,19 @@ module ActionMailer
# Provides a list of emails that have been delivered by Mail::TestMailer
delegate :deliveries, :deliveries=, :to => Mail::TestMailer
# Adds a new delivery method through the given class using the given symbol
# as alias and the default options supplied:
#
# Example:
# Adds a new delivery method through the given class using the given
# symbol as alias and the default options supplied.
#
# add_delivery_method :sendmail, Mail::Sendmail,
# :location => '/usr/sbin/sendmail',
# :arguments => '-i -t'
#
# 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)
self.delivery_methods = delivery_methods.merge(symbol.to_sym => klass).freeze
end
def wrap_delivery_behavior(mail, method=nil, options=nil) #:nodoc:
def wrap_delivery_behavior(mail, method=nil, options=nil) # :nodoc:
method ||= self.delivery_method
mail.delivery_handler = self
@ -79,7 +76,7 @@ module ActionMailer
end
end
def wrap_delivery_behavior!(*args) #:nodoc:
def wrap_delivery_behavior!(*args) # :nodoc:
self.class.wrap_delivery_behavior(message, *args)
end
end

View file

@ -1,6 +1,7 @@
module ActionMailer
module MailHelper
# Take the text and format it, indented two spaces for each line, and wrapped at 72 columns.
# Take the text and format it, indented two spaces for each line, and
# wrapped at 72 columns.
def block_format(text)
formatted = text.split(/\n\r?\n/).collect { |paragraph|
format_paragraph(paragraph)
@ -30,9 +31,7 @@ module ActionMailer
# Returns +text+ wrapped at +len+ columns and indented +indent+ spaces.
#
# === Examples
#
# my_text = "Here is a sample text with more than 40 characters"
# my_text = 'Here is a sample text with more than 40 characters'
#
# format_paragraph(my_text, 25, 4)
# # => " Here is a sample text with\n more than 40 characters"

View file

@ -3,7 +3,7 @@ require "rails"
require "abstract_controller/railties/routes_helpers"
module ActionMailer
class Railtie < Rails::Railtie
class Railtie < Rails::Railtie # :nodoc:
config.action_mailer = ActiveSupport::OrderedOptions.new
config.eager_load_namespaces << ActionMailer

View file

@ -10,7 +10,8 @@ module ActionMailer
# assert_emails 2
# end
#
# If a block is passed, that block should cause the specified number of emails to be sent.
# If a block is passed, that block should cause the specified number of
# emails to be sent.
#
# def test_emails_again
# assert_emails 1 do