From e2c7545cdd69376ed7e6ccb2084dda8cbd7571c2 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Mon, 17 Sep 2012 19:18:56 -0500 Subject: [PATCH] update ActionMailer documentation [ci skip] --- actionmailer/lib/action_mailer/collector.rb | 2 +- .../lib/action_mailer/delivery_methods.rb | 19 ++++++++----------- actionmailer/lib/action_mailer/mail_helper.rb | 7 +++---- actionmailer/lib/action_mailer/railtie.rb | 2 +- actionmailer/lib/action_mailer/test_helper.rb | 3 ++- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/actionmailer/lib/action_mailer/collector.rb b/actionmailer/lib/action_mailer/collector.rb index b8d1db9558..569a09bd2a 100644 --- a/actionmailer/lib/action_mailer/collector.rb +++ b/actionmailer/lib/action_mailer/collector.rb @@ -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 diff --git a/actionmailer/lib/action_mailer/delivery_methods.rb b/actionmailer/lib/action_mailer/delivery_methods.rb index b795d4f80a..110f6769e6 100644 --- a/actionmailer/lib/action_mailer/delivery_methods.rb +++ b/actionmailer/lib/action_mailer/delivery_methods.rb @@ -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 diff --git a/actionmailer/lib/action_mailer/mail_helper.rb b/actionmailer/lib/action_mailer/mail_helper.rb index 2036883b22..ec84256491 100644 --- a/actionmailer/lib/action_mailer/mail_helper.rb +++ b/actionmailer/lib/action_mailer/mail_helper.rb @@ -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" diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb index 8679096735..5bd05c24b8 100644 --- a/actionmailer/lib/action_mailer/railtie.rb +++ b/actionmailer/lib/action_mailer/railtie.rb @@ -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 diff --git a/actionmailer/lib/action_mailer/test_helper.rb b/actionmailer/lib/action_mailer/test_helper.rb index 7204822395..3ab37d8142 100644 --- a/actionmailer/lib/action_mailer/test_helper.rb +++ b/actionmailer/lib/action_mailer/test_helper.rb @@ -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