module MasterView module Directives # Inserts a comment into the file that indicates that this file was generated # and should not be edited, else changes could be lost. It includes the path to # the original file that should be edited instead class Insert_generated_comment < MasterView::DirectiveBase Generated_comment_text = <<-END # WARNING - This file was generated by MasterView plugin. # Do not edit this file otherwise you may lose your changes # when this file is re-generated. # # To make changes edit the MasterView file which is located at: END def priority DirectivePriorities::Lowest end def stag(directive_call_stack) comment = "\n<% \n" + Generated_comment_text + "# "+ attr_value + "\n%>" ret = [] ret << directive_call_stack.render ret << comment end end end end