Sha256: c5fa1002934d3b15f4a94a370cb2d3656ad1328002776dd25cf03a159bc5d2fd
Contents?: true
Size: 701 Bytes
Versions: 1
Compression:
Stored size: 701 Bytes
Contents
class Premailer module Rails module CSSLoaders module FileSystemLoader extend self def load(url) file = file_name(url) File.read(file) if File.file?(file) end def file_name(url) path = URI(url).path if relative_url_root path = path.sub(/\A#{relative_url_root.chomp('/')}/, '') end "public#{path}" end def relative_url_root defined?(::Rails) && ::Rails.respond_to?(:configuration) && ::Rails.configuration.respond_to?(:relative_url_root) && ::Rails.configuration.relative_url_root end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
premailer-rails-1.9.6 | lib/premailer/rails/css_loaders/file_system_loader.rb |