Permalink
Browse files

Rakefile: Copy images to output/; tweak logic.

  • Loading branch information...
1 parent 7cd997f commit f79cd1f632972fb938aed6f129b4191a28c08514 @runpaint committed May 10, 2009
Showing with 15 additions and 4 deletions.
  1. +15 −4 Rakefile
View
19 Rakefile
@@ -1,18 +1,29 @@
+SOURCE_HTML = FileList['text/**/*.html']
+IMAGES = FileList['images/*']
+directory "output"
+
+task :images => :output
+task :images => IMAGES do |t|
+ IMAGES.each do |image|
+ cp image, "output"
+ end
+end
+
+task 'output/all.html' => [:output, :images]
file 'output/all.html' => FileList['text/**/*.html'] do |t|
File.open(t.name,'w') do |out|
- t.prerequisites.sort.each do |source|
+ SOURCE_HTML.sort.each do |source|
out.puts File.open(source).read
end
end
end
-file 'output/vim-recipes.pdf' => ['output/all.html'] do |t|
+file 'output/vim-recipes.pdf' => 'output/all.html' do |t|
system("prince #{t.prerequisites.first} #{t.name}")
end
-task :pdf => ['output/vim-recipes.pdf'] do
-end
+task :pdf => 'output/vim-recipes.pdf'
task :ilinks => ['output/all.html'] do |t|
require 'hpricot'

0 comments on commit f79cd1f

Please sign in to comment.