-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
38 lines (29 loc) · 794 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
36
37
38
require "rake"
require "ftools"
require "rake/classic_namespace"
Package = "percolate-mail"
Version = File.read("VERSION").chomp
Gemfile = "#{Package}-#{Version}.gem"
Gemspec = "#{Package}.gemspec"
Tarball = "#{Package}-#{Version}.tar.gz"
Files = [ "install.rb", "INSTALL" ] +
Dir["lib/**/*.rb"] +
Dir["examples/**/*.rb"]
task :dist => [ :test, :tarball, :gem ]
task :gem => Gemfile do File.move Gemfile,".." end
task :tarball => Tarball do File.move Tarball, ".." end
file Tarball => Files do
run "tar","zcvf",Tarball,*Files
end
file Gemfile do
run "gem build #{Gemspec}"
end
task :test do
FileList['test/*.rb'].each do |f|
run("ruby #{f}")
end
end
def run(*cmd)
puts cmd.join(" ")
system(*cmd) or fail "Command failed: [#{cmd}]"
end