Skip to content

Commit

Permalink
Touch the flag file at directory creation time to prevent error after…
Browse files Browse the repository at this point in the history
… rdoc crashes
  • Loading branch information
drbrain committed Jan 1, 2011
1 parent e9b89fe commit 76fb2b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions History.txt
Expand Up @@ -10,6 +10,8 @@
obj...)</tt> to display correctly. Patch #6 by KUBO Takehiro.
* Improved processing of meta-programmed methods when followed by unparseable
syntax. RubyForge patch #28653 by Aidan Cully.
* rdoc now touches the flag file when it create the output directory.
Prevents the "isn't an RDoc directory" error if rdoc crashes.

=== 3.2 / 2010-12-29

Expand Down
1 change: 1 addition & 0 deletions lib/rdoc/rdoc.rb
Expand Up @@ -197,6 +197,7 @@ def setup_output_dir(dir, force)
end unless @options.force_output
else
FileUtils.mkdir_p dir
FileUtils.touch output_flag_file dir
end

last
Expand Down
3 changes: 2 additions & 1 deletion test/test_rdoc_rdoc.rb
Expand Up @@ -64,13 +64,14 @@ def test_setup_output_dir
skip "No Dir::mktmpdir, upgrade your ruby" unless Dir.respond_to? :mktmpdir

Dir.mktmpdir {|d|
path = File.join(d, 'testdir')
path = File.join d, 'testdir'

last = @rdoc.setup_output_dir path, false

assert_empty last

assert File.directory? path
assert File.exist? @rdoc.output_flag_file path
}
end

Expand Down

0 comments on commit 76fb2b7

Please sign in to comment.