lib/classy_assets/tasks.rb in classy_assets-0.7.2 vs lib/classy_assets/tasks.rb in classy_assets-0.8.0

- old
+ new

@@ -1,14 +1,19 @@ # encoding: utf-8 require 'rake' +require 'rake/sprocketstask' require 'classy_assets' -module ClassyAssets - module Tasks - def self.import! - tasks_path = File.expand_path('../tasks/', __FILE__) - Rake.application.add_import File.join(tasks_path, 'assets.rake') - end +class Rake::ClassyAssetsTask < Rake::SprocketsTask + def define_precompile + desc "Precompile assets" + task "assets:precompile" => [:assets] end end -ClassyAssets::Tasks.import! + +Rake::ClassyAssetsTask.new do |t| + t.environment = ClassyAssets.sprockets + t.output = ClassyAssets.config.asset_precompile_folder + t.assets = ClassyAssets.config.asset_precompile_files + t.define_precompile +end