forked from gentooboontoo/js-quantities
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
35 lines (24 loc) · 726 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
32
33
34
35
require "rubygems"
require "bundler/setup"
require 'jshintrb/jshinttask'
Jshintrb::JshintTask.new :jshint do |t|
t.pattern = 'lib/**/*.js'
end
desc "Benchmark checked-out version against committed one, defaults PORT=3000, COMMIT=HEAD"
task :bench do
Dir.chdir(File.dirname(__FILE__))
port = ENV['PORT'] || '3000'
commit = ENV['COMMIT'] || 'HEAD'
pid = fork do
exec "adsf -p #{port}"
end
`git show #{commit}:src/quantities.js > src/.committed-quantities.js`
puts "Bench server launched: please open http://0.0.0.0:#{port}/bench"
begin
Process.wait(pid)
rescue Interrupt => e
puts "Killing web server..."
Process.kill(9, pid)
end
File.unlink 'src/.committed-quantities.js'
end