Class: AssetPacker::Processor::Local::Image

Inherits:
AssetPacker::Processor::Local show all
Defined in:
lib/asset_packer/processor/local.rb

Instance Attribute Summary

Attributes inherited from AssetPacker::Processor

#asset_dir, #destination, #full_source_uri, #source_uri

Instance Method Summary collapse

Methods inherited from AssetPacker::Processor::Local

#save_asset

Methods inherited from AssetPacker::Processor

#cache, #initialize, #retrieve_asset

Constructor Details

This class inherits a constructor from AssetPacker::Processor

Instance Method Details

#call(doc) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/asset_packer/processor/local.rb', line 23

def call(doc)
  doc.replace('img') do |img|
    uri = img[:src]
    extension = File.extname(uri).sub(/^\./, '')
    img.attr(:src, save_asset(uri, extension))
  end
end