class DiceBag::Warning

Public Class Methods

new(template_filename) click to toggle source
# File lib/dice_bag/warning.rb, line 5
def initialize(template_filename)
  @template_filename = template_filename
end

Public Instance Methods

as_ruby_comment() click to toggle source
# File lib/dice_bag/warning.rb, line 9
def as_ruby_comment
  lines.map { |line| "# #{line}".rstrip }.join("\n") + "\n"
end
Also aliased as: as_yaml_comment
as_xml_comment() click to toggle source
# File lib/dice_bag/warning.rb, line 15
def as_xml_comment
  ["<!--", lines, "-->"].flatten.join("\n")
end
as_yaml_comment()
Alias for: as_ruby_comment

Protected Instance Methods

lines() click to toggle source
# File lib/dice_bag/warning.rb, line 21
def lines
  [
    "WARNING! Do not modify this file directly. It was generated from the",
    "'#{@template_filename}' template file.",
    "",
    "Use the rake config task to reconfigure. See the template file for",
    "further guidance."
  ]
end