forked from clutchski/coffeelint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
56 lines (47 loc) · 1.27 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
LINT_CONFIG = "test/fixtures/coffeelint.json"
# Print a notification.
def notify(message)
padding = 4
line = '*' * (message.length + padding)
puts line
puts "* #{message.downcase} *"
puts line
end
desc "Run unit tests."
task :test => [:compile] do
sh("node_modules/.bin/vows --spec test/*.coffee")
notify("tested!")
end
desc "Lint the linter."
task :lint => [:compile] do
sh("./bin/coffeelint -r -f #{LINT_CONFIG} src/ test/*.coffee")
notify("linted!")
end
desc "Lint the linter."
task :'lint:csv' => [:compile] do
sh("./bin/coffeelint --csv -r -f #{LINT_CONFIG} src/ test/*.coffee")
notify("linted!")
end
desc "Lint the linter."
task :'lint:csv' => [:compile] do
sh("./bin/coffeelint --jslint -r -f #{LINT_CONFIG} src/ test/*.coffee")
notify("linted!")
end
desc "Compile the source."
task :compile do
sh("node_modules/.bin/coffee -c -o lib src")
# Add a hack for adding node shebang.
node='#!/usr/bin/env node'
sh("echo '#{node}' | cat - lib/commandline.js > bin/coffeelint")
sh("chmod +x bin/coffeelint")
sh("rm lib/commandline.js")
notify("compiled!")
end
desc "Publish the package."
task :publish => [:default] do
sh("npm publish")
end
task :tokenize do
sh "./utils/tokenize ./utils/test.coffee"
end
task :default => [:compile, :test, :lint]