Sha256: 76b418fd81ff49f72819235b095e7fe09e9a49661875f1dcfe255581fab95f16
Contents?: true
Size: 651 Bytes
Versions: 5
Compression:
Stored size: 651 Bytes
Contents
class Premailer module Rails module CSSLoaders module AssetPipelineLoader extend self def load(url) if asset_pipeline_present? file = file_name(url) asset = ::Rails.application.assets.find_asset(file) asset.to_s if asset end end def asset_pipeline_present? defined?(::Rails) and ::Rails.application.respond_to?(:assets) end def file_name(url) URI(url).path .sub("#{::Rails.configuration.assets.prefix}/", '') .sub(/-(\h{32}|\h{64})\.css$/, '.css') end end end end end
Version data entries
5 entries across 5 versions & 2 rubygems