lib/asset_hat/tasks/js.rb in asset_hat-0.4.1 vs lib/asset_hat/tasks/js.rb in asset_hat-0.4.2
- old
+ new
@@ -1,10 +1,10 @@
namespace :asset_hat do
namespace :js do
desc 'Minifies one JS file'
- task :minify_file, :filepath, :needs => :environment do |t, args|
+ task :minify_file, [:filepath] => :environment do |t, args|
type = 'js'
if args.filepath.blank?
raise "Usage: rake asset_hat:#{type}:" +
"minify_file[filepath.#{type}]" and return
@@ -29,11 +29,11 @@
# Print results
puts "- Minified to #{target_filepath}" if verbose
end
desc 'Minifies one JS bundle'
- task :minify_bundle, :bundle, :needs => :environment do |t, args|
+ task :minify_bundle, [:bundle] => :environment do |t, args|
type = 'js'
if args.bundle.blank?
raise "Usage: rake asset_hat:#{type}:" +
"minify_bundle[application]" and return
@@ -102,10 +102,10 @@
end
end
end
desc 'Concatenates and minifies all JS bundles'
- task :minify, :opts, :needs => :environment do |t, args|
+ task :minify, [:opts] => :environment do |t, args|
args.with_defaults(:opts => {})
opts = args.opts.reverse_merge(:show_intro => true, :show_outro => true)
type = 'js'
report_format = ENV['FORMAT']