File: Rakefile

package info (click to toggle)
jquery-lazyload 1.7.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,392 kB
  • sloc: javascript: 197; makefile: 21
file content (21 lines) | stat: -rw-r--r-- 670 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
task :default => [:minify]

desc "Minify"
task :minify do
  begin
    require 'uglifier'
  rescue LoadError => e
    if verbose
      puts "\nYou'll need the 'uglifier' gem for minification. Just run:\n\n"
      puts "  $ gem install uglifier"
      puts "\nand you should be all set.\n\n"
      exit
    end
    return false
  end
  puts "Minifying jquery.lazyload.js with UglifyJS..."
  File.open("jquery.lazyload.min.js", "w"){|f| f.puts Uglifier.new.compile(File.read("jquery.lazyload.js"))}
  puts "Minifying jquery.scrollstop.js with UglifyJS..."
  File.open("jquery.scrollstop.min.js", "w"){|f| f.puts Uglifier.new.compile(File.read("jquery.scrollstop.js"))}

end