diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-06-01 06:32:16 -0300 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-06-03 23:32:11 +1000 |
commit | 52f905715efcc60ffb6b10654d170f8d7da10496 (patch) | |
tree | 372cae5e28d3536fee51b00e8a30c60ace03d866 | |
parent | f50928db9cd11baf40a32e2d0ab51b2184ec3e4b (diff) | |
download | rails-52f905715efcc60ffb6b10654d170f8d7da10496.tar.gz rails-52f905715efcc60ffb6b10654d170f8d7da10496.tar.bz2 rails-52f905715efcc60ffb6b10654d170f8d7da10496.zip |
Unforce text-format from AM
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r-- | Gemfile | 3 | ||||
-rw-r--r-- | actionmailer/actionmailer.gemspec | 1 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer.rb | 6 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/mail_helper.rb | 7 |
4 files changed, 10 insertions, 7 deletions
@@ -24,6 +24,9 @@ end # AS gem "memcache-client", ">= 1.7.5" +# AM +gem "text-format", "~> 1.0.0" + # AR if mri || RUBY_ENGINE == "rbx" gem "sqlite3-ruby", "= 1.3.0.beta.2", :require => 'sqlite3' diff --git a/actionmailer/actionmailer.gemspec b/actionmailer/actionmailer.gemspec index 280771e4db..4706b63b79 100644 --- a/actionmailer/actionmailer.gemspec +++ b/actionmailer/actionmailer.gemspec @@ -21,5 +21,4 @@ Gem::Specification.new do |s| s.add_dependency('actionpack', version) s.add_dependency('mail', '~> 2.2.1') - s.add_dependency('text-format', '~> 1.0.0') end diff --git a/actionmailer/lib/action_mailer.rb b/actionmailer/lib/action_mailer.rb index 70cc312634..6e2d288082 100644 --- a/actionmailer/lib/action_mailer.rb +++ b/actionmailer/lib/action_mailer.rb @@ -49,9 +49,3 @@ module ActionMailer autoload :TestCase autoload :TestHelper end - -module Text - extend ActiveSupport::Autoload - - autoload :Format, 'text/format' -end 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 |