lib/classy_assets/tasks.rb in classy_assets-0.11.4 vs lib/classy_assets/tasks.rb in classy_assets-0.12.0
- old
+ new
@@ -2,26 +2,24 @@
require 'rake'
require 'rake/sprocketstask'
require 'classy_assets'
-if ClassyAssets.config.asset_compress
- require 'uglifier'
- require 'yui/compressor'
-end
-
module ClassyAssets
class Tasks < Rake::SprocketsTask
def define_precompile_task
- task "assets:precompile" => [:clean_assets, :assets]
+ task "assets:precompile" => [:environment, :clean_assets, :assets]
+ task :assets => :environment
+ task :clean_assets => :environment
+ task :clobber_assets => :environment
end
end
end
ClassyAssets::Tasks.new do |t|
t.define_precompile_task
- t.environment = ClassyAssets.sprockets
- t.output = ClassyAssets.config.asset_precompile_path
+ t.environment = ->{ ClassyAssets.sprockets }
+ t.output = ->{ ClassyAssets.config.asset_precompile_path }
t.assets = ClassyAssets.config.asset_precompile
t.keep = ClassyAssets.config.asset_precompile_keep
- t.manifest = ::Sprockets::Manifest.new(t.environment, ClassyAssets.config.asset_manifest_path)
+ t.manifest = ->{ ::Sprockets::Manifest.new(t.environment, ClassyAssets.config.asset_manifest_path) }
end