Module: PremailerRails::CSSLoaders::HassleLoader
Overview
Loads the CSS from Hassle middleware if present.
Instance Method Summary collapse
Instance Method Details
#hassle_enabled? ⇒ Boolean
24 25 26 |
# File 'lib/premailer-rails3/css_loaders.rb', line 24 def hassle_enabled? Rails.configuration.middleware.include? Hassle rescue false end |
#load(path) ⇒ Object
18 19 20 21 22 |
# File 'lib/premailer-rails3/css_loaders.rb', line 18 def load(path) if hassle_enabled? File.read("#{Rails.root}/tmp/hassle#{normalized_path(path)}") end end |
#normalized_path(path) ⇒ Object
28 29 30 |
# File 'lib/premailer-rails3/css_loaders.rb', line 28 def normalized_path(path) path == :default ? '/stylesheets/email.css' : path end |