Utility functions for classes that use commands to postprocess generator output.
Encodes a string so that it is safe for use as a shell argument
# File voodoo/generators/command_postprocessor.rb, line 11 def shell_encode string '"' + string.gsub(/([\\`"$\n])/, "\\\\\\1") + '"' end
Creates a temporary file and returns its name
# File voodoo/generators/command_postprocessor.rb, line 16 def tempfile extension, base = nil base = self.class.name unless base file = Tempfile.open(basename + extension) name = file.path file.close name end
Generated with the Darkfish Rdoc Generator 2.