module Rake::FileUtilsExt

def when_writing(msg=nil)


instead of actually building the project.

DRYRUN: Building Project

will print:
conditions. If the nowrite(true) flag is set, then the example
The following code will build the project under normal

end
project.build
when_writing("Building Project") do

Example:

from running when the :nowrite flag is set.
Use this function to prevent potentially destructive ruby code
def when_writing(msg=nil)
  if FileUtilsExt.nowrite_flag
    $stderr.puts "DRYRUN: #{msg}" if msg
  else
    yield
  end
end