| | 12 | |
|---|
| | 13 | |
|---|
| | 14 | desc "install sample Rakefile" |
|---|
| | 15 | task :install do |t| |
|---|
| | 16 | |
|---|
| | 17 | dstfile = File.join(Rake.original_dir, "../Rakefile") |
|---|
| | 18 | |
|---|
| | 19 | raise "Rakefile already existant, delete it first to proceed" if File.exists?(dstfile) |
|---|
| | 20 | |
|---|
| | 21 | src = ENV['SRC'] || "src" |
|---|
| | 22 | testsrc = ENV['TESTSRC'] || "testsrc" |
|---|
| | 23 | |
|---|
| | 24 | rfile = File.read('Rakefile.jerbil') |
|---|
| | 25 | |
|---|
| | 26 | rfile.gsub!(/##SRC##/, src) |
|---|
| | 27 | rfile.gsub!(/##TESTSRC##/, testsrc) |
|---|
| | 28 | |
|---|
| | 29 | File.open( dstfile, 'w' ) do |f| |
|---|
| | 30 | f << rfile |
|---|
| | 31 | end |
|---|
| | 32 | |
|---|
| | 33 | puts "created sample Rakefile in #{dstfile}" |
|---|
| | 34 | end |
|---|