diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-01 16:39:05 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-01 16:39:05 -0500 |
commit | cae25199008bc26d215e7af5558cfcdfdc6ec264 (patch) | |
tree | 9b1cd9bf1a2a770af31406652362001460816e5b /actionmailer/lib/action_mailer | |
parent | d57397c4b62b6474ff8eb55bfd763f5e6dcdcd40 (diff) | |
parent | a0bb1dda119a7488b8a4d61b354a64e619b0d1b3 (diff) | |
download | rails-cae25199008bc26d215e7af5558cfcdfdc6ec264.tar.gz rails-cae25199008bc26d215e7af5558cfcdfdc6ec264.tar.bz2 rails-cae25199008bc26d215e7af5558cfcdfdc6ec264.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/mail_helper.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/mail_helper.rb b/actionmailer/lib/action_mailer/mail_helper.rb index ab5c3469b2..aab6e12387 100644 --- a/actionmailer/lib/action_mailer/mail_helper.rb +++ b/actionmailer/lib/action_mailer/mail_helper.rb @@ -3,6 +3,13 @@ module ActionMailer # Uses Text::Format to take the text and format it, indented two spaces for # each line, and wrapped at 72 columns. def block_format(text) + begin + require 'text/format' + rescue LoadError => e + $stderr.puts "You don't have text-format installed in your application. Please add it to your Gemfile and run bundle install" + raise e + end unless defined?(Text::Format) + formatted = text.split(/\n\r\n/).collect { |paragraph| Text::Format.new( :columns => 72, :first_indent => 2, :body_indent => 2, :text => paragraph |