diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-10 12:12:15 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-06-10 12:15:30 -0700 |
commit | 4fc0778123fc775d106f6bc8a4a2a362bf0047ed (patch) | |
tree | 71d9146d0a2ede4d71c1f99a4969ed6cca1d8b9b /actionmailer/lib | |
parent | c014c3e5c14beb71fa7c67f15448386d0ffaba28 (diff) | |
download | rails-4fc0778123fc775d106f6bc8a4a2a362bf0047ed.tar.gz rails-4fc0778123fc775d106f6bc8a4a2a362bf0047ed.tar.bz2 rails-4fc0778123fc775d106f6bc8a4a2a362bf0047ed.zip |
Simplify helper use of ActiveSupport::Dependencies, and use super better for in #helpers
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/helpers.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/actionmailer/lib/action_mailer/helpers.rb b/actionmailer/lib/action_mailer/helpers.rb index 31f7de8d60..1bb8682315 100644 --- a/actionmailer/lib/action_mailer/helpers.rb +++ b/actionmailer/lib/action_mailer/helpers.rb @@ -48,13 +48,14 @@ module ActionMailer file_name = arg.to_s.underscore + '_helper' class_name = file_name.camelize - begin - require_dependency(file_name) - rescue LoadError => load_error - requiree = / -- (.*?)(\.rb)?$/.match(load_error.message).to_a[1] - msg = (requiree == file_name) ? "Missing helper file helpers/#{file_name}.rb" : "Can't load file: #{requiree}" - raise LoadError.new(msg).copy_blame!(load_error) - end + require_dependency(file_name, "Missing helper file helpers/%s.rb") + # begin + # require_dependency(file_name) + # rescue LoadError => load_error + # requiree = / -- (.*?)(\.rb)?$/.match(load_error.message).to_a[1] + # msg = (requiree == file_name) ? "Missing helper file helpers/#{file_name}.rb" : "Can't load file: #{requiree}" + # raise LoadError.new(msg).copy_blame!(load_error) + # end add_template_helper(class_name.constantize) else @@ -97,7 +98,7 @@ module ActionMailer child.master_helper_module.__send__(:include, master_helper_module) child.helper child.name.to_s.underscore rescue MissingSourceFile => e - raise unless e.is_missing?("helpers/#{child.name.to_s.underscore}_helper") + raise unless e.is_missing?("#{child.name.to_s.underscore}_helper") end end end |