Skip to content

Commit

Permalink
Added a Rakefile to build out the app into one sinatra file
Browse files Browse the repository at this point in the history
  • Loading branch information
pope committed May 8, 2008
1 parent c62e725 commit 84c5a45
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Rakefile
@@ -0,0 +1,32 @@
# Variables
view_files = Dir.glob('views/*')

task :default => ['pkg/watchtower.rb']

directory 'pkg'

desc "Builds the single sinatra file for serving everything up"
file 'pkg/watchtower.rb' => ['pkg', 'watchtower.rb'].concat(view_files) do
open('pkg/watchtower.rb', 'w') do |outfile|
open('watchtower.rb') do |watchtower|
while line = watchtower.gets
outfile.puts line
end
outfile.puts "user_in_file_templates!"
outfile.puts "__END__"
end
view_files.each do |view_file|
outfile.puts "##" + File.basename(view_file, File.extname(view_file))
open(view_file) do |infile|
while line = infile.gets
outfile.puts line
end
end
end
end
end

desc "Remove the build files"
task :clean do
rm_rf 'pkg'
end

0 comments on commit 84c5a45

Please sign in to comment.