Skip to content

Instantly share code, notes, and snippets.

@voloko
Created October 6, 2009 08:17
Show Gist options
  • Save voloko/202854 to your computer and use it in GitHub Desktop.
Save voloko/202854 to your computer and use it in GitHub Desktop.
def generate_file_files
debug_msg "Generating file documentation in #@outputdir"
templatefile = @template_dir + 'file.rhtml'
@files.each do |file|
outfile = @outputdir + file.path
debug_msg " working on %s (%s)" % [ file.full_name, outfile ]
rel_prefix = @outputdir.relative_path_from( outfile.dirname )
debug_msg " rendering #{outfile}"
if file.absolute_name.match(/.*\.htm(l)?/)
outfile.dirname.mkpath
outfile.open( 'w', 0644 ) do |f|
f.print( file.comment )
end
else
self.render_template( templatefile, binding(), outfile )
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment