Class Rake::SprocketsTask
In: lib/rake/sprocketstask.rb
Parent: Rake::TaskLib

Simple Sprockets compilation Rake task macro.

  Rake::SprocketsTask.new do |t|
    t.environment = Sprockets::Environment.new
    t.output      = "./public/assets"
    t.assets      = %w( application.js application.css )
  end

Methods

define   environment   log_level   log_level=   new  

Attributes

assets  [RW]  Array of asset logical paths to compile.
  t.assets = %w( application.js jquery.js application.css )
environment  [W] 
keep  [RW]  Number of old assets to keep.
logger  [RW]  Logger to use during rake tasks. Defaults to using stderr.
  t.logger = Logger.new($stdout)
name  [RW]  Name of the task. Defaults to "assets".

The name will also be used to suffix the clean and clobber tasks, "clean_assets" and "clobber_assets".

output  [RW]  Directory to write compiled assets too. As well as the manifest file.
  t.output = "./public/assets"

Public Class methods

Public Instance methods

Define tasks

`Environment` instance used for finding assets.

You‘ll most likely want to reassign `environment` to your own.

  Rake::SprocketsTask.new do |t|
    t.environment = Foo::Assets
  end

Returns logger level Integer.

Set logger level with constant or symbol.

  t.log_level = Logger::INFO
  t.log_level = :debug

[Validate]