Skip to content

Commit

Permalink
Rakefile: Copy images to output/; tweak logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
runpaint committed May 10, 2009
1 parent 7cd997f commit f79cd1f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions 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'
Expand Down

0 comments on commit f79cd1f

Please sign in to comment.