-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
34 lines (26 loc) · 830 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
desc "Run JavaScript test suite"
task :test do
exec('open test/test.html')
end
directory "pkg"
task :package do
pkg_name = "espionage.js"
puts "Building #{pkg_name}..."
pkg_file = File.open(File.join(File.dirname(__FILE__), "pkg", pkg_name), "w")
pkg_file.write("/*!\n * espionage.js\n *\n")
puts "Writing license..."
license_file = File.open(File.join(File.dirname(__FILE__), "LICENSE"), "r")
license_file.each_line do |line|
pkg_file.write(" * #{line}")
end
license_file.close
pkg_file.write(" */\n\n")
puts "Writing library..."
["espionage.js", "mock.js", "spy.js", "stub.js", "time.js"].each do |filename|
js_file = File.open(File.join(File.dirname(__FILE__), filename), "r")
pkg_file.write(js_file.read)
js_file.close
end
pkg_file.close
puts "Done with #{pkg_name}"
end