lib/ztk/template.rb
# Renders a "DO NOT EDIT" notice for placement in generated files.
#
# @param [Hash] options Options hash.
# @option options [String] :message An optional message to display in the notice.
# @option options [String] :char The comment character; defaults to '#'.
#
# @return [String] The rendered noticed.
Renders a "DO NOT EDIT" notice for placement in generated files.
Renders a " DO NOT EDIT " notice for placement in generated files .
def do_not_edit_notice(options={})
        message = options[:message]
        char    = (options[:char] || '#')
        notice  = Array.new
        notice << char
        notice << "#{char} WARNING: AUTOMATICALLY GENERATED FILE; DO NOT EDIT!"
        if !message.nil?
          notice << char
          notice << "#{char} #{message}"
        end
        notice << char
        notice << "#{char} Generated @ #{Time.now.utc}"
        notice << char
        notice.join("\n") + "\n"
      end
def do_not_edit_notice ( options = { } ) message = options [ :message ] char = ( options [ :char ] || '#' ) notice = Array . new notice << char notice << "#{char} WARNING: AUTOMATICALLY GENERATED FILE; DO NOT EDIT!" if ! message . nil? notice << char notice << "#{char} #{message}" end notice << char notice << "#{char} Generated @ #{Time.now.utc}" notice << char notice . join ( "\n" ) + "\n" end
Renders a "DO NOT EDIT" notice for placement in generated files.
Renders a " DO NOT EDIT " notice for placement in generated files .
The rendered noticed.
The rendered noticed .
String
options
:char The comment character; defaults to '#'.
: char The comment character ; defaults to ' # ' .
'#'
<not_specific>
options Options hash.
options Options hash .