From a7eff2c0faf717e6c747cb979750bf6ef83c37d3 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Wed, 10 Jun 2009 00:14:27 -0500 Subject: [PATCH] Avoid using `Tempfile` because Windows doesn't like it when we try to modify its access time. --- Rakefile | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Rakefile b/Rakefile index 87c4078..579325d 100755 --- a/Rakefile +++ b/Rakefile @@ -61,21 +61,23 @@ namespace :doc do puts "\nand you should be all set.\n\n" end - Tempfile.open("pdoc") do |temp| - secretary = Sprockets::Secretary.new( - :root => File.join(PROTOTYPE_ROOT, "src"), - :load_path => [PROTOTYPE_SRC_DIR], - :source_files => ["prototype.js"], - :strip_comments => false - ) - - secretary.concatenation.save_to(temp.path) - rm_rf PROTOTYPE_DOC_DIR - PDoc::Runner.new(temp.path, { - :output => PROTOTYPE_DOC_DIR, - :templates => File.join(PROTOTYPE_TEMPLATES_DIR, "html") - }).run - end + secretary = Sprockets::Secretary.new( + :root => File.join(PROTOTYPE_ROOT, "src"), + :load_path => [PROTOTYPE_SRC_DIR], + :source_files => ["prototype.js"], + :strip_comments => false + ) + + # Might as well re-use the unit tests' temp directory. + temp_path = File.join(PROTOTYPE_TMP_DIR, "prototype.temp.js") + secretary.concatenation.save_to(temp_path) + rm_rf PROTOTYPE_DOC_DIR + PDoc::Runner.new(temp_path, { + :output => PROTOTYPE_DOC_DIR, + :templates => File.join(PROTOTYPE_TEMPLATES_DIR, "html") + }).run + + rm_rf temp_path end task :require do