forked from jashkenas/backbone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
31 lines (26 loc) · 760 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'rubygems'
require 'closure-compiler'
HEADER = /((^\s*\/\/.*\n)+)/
desc "rebuild the backbone-min.js files for distribution"
task :build do
source = File.read 'backbone.js'
header = source.match(HEADER)
File.open('backbone-min.js', 'w+') do |file|
file.write header[1].squeeze(' ') + Closure::Compiler.new.compress(source)
end
end
desc "build the docco documentation"
task :doc do
system [
'docco backbone.js',
'docco examples/todos/todos.js examples/backbone-localstorage.js'
].join(' && ')
end
desc "run JavaScriptLint on the source"
task :lint do
system "jsl -nofilelisting -nologo -conf docs/jsl.conf -process backbone.js"
end
desc "test the CoffeeScript integration"
task :test do
system "coffee test/*.coffee"
end