Module: AssetPipeline

Defined in:
lib/asset_pipeline.rb,
lib/asset_pipeline/tasks.rb,
lib/asset_pipeline/version.rb

Defined Under Namespace

Classes: Tasks

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.config {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (AssetPipeline)

    the object that the method was called on



40
41
42
43
44
# File 'lib/asset_pipeline.rb', line 40

def self.config
  yield self
  self.assets_public_path = File.join(public_folder, path_prefix)
  self.setup!
end

.setup!Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/asset_pipeline.rb', line 46

def self.setup!
  assets_paths.each do |raw_path|
    paths = Dir[File.join(raw_path, '*')]
    paths.each { |path| sprockets.append_path path }
  end

  Sprockets::Helpers.configure do |config|
    config.environment = sprockets
    config.prefix      = path_prefix     if path_prefix
    config.digest      = assets_digest
    config.public_path = public_folder   if public_folder
    config.debug       = assets_debug
    config.protocol    = assets_protocol if assets_protocol
    config.asset_host  = assets_host     if assets_host
    config.manifest    = Sprockets::Manifest.new(sprockets, assets_public_path)
  end

  sprockets.css_compressor = assets_css_compressor unless assets_css_compressor.nil?
  sprockets.js_compressor  = assets_js_compressor  unless assets_js_compressor.nil?
end