Class: MasterView::Directives::Insert_generated_comment

Inherits:
MasterView::DirectiveBase show all
Defined in:
lib/masterview/directives/insert_generated_comment.rb

Overview

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

Constant Summary collapse

Generated_comment_text =
"#    WARNING - This file was generated by MasterView plugin. \n#    Do not edit this file otherwise you may lose your changes\n#    when this file is re-generated.\n# \n#    To make changes edit the MasterView file which is located at: \n"

Constants included from MasterView::DirectiveHelpers

MasterView::DirectiveHelpers::CRLF, MasterView::DirectiveHelpers::ERB_END, MasterView::DirectiveHelpers::ERB_EVAL, MasterView::DirectiveHelpers::ERB_START

Instance Method Summary collapse

Methods inherited from MasterView::DirectiveBase

#append_to_attr_value!, #attr_lckv_matches, #attr_value, #attr_value=, #attrs, #attrs=, #attrs_lck, #attrs_lckv, #common_html_options, #content, #content=, #content_str, #data, #data=, #erb, #erb_content, full_attr_name, #initialize, #merge_hash_attr_value!, #parse_attr_value, #prepend_to_attr_value!, #quote, register_directive, #remove_strings_from_attr_value!, #save_directive_call_stack, #tag_name, #tag_name=

Methods included from MasterView::DirectiveHelpers

#delete_last_in_parent, #find_last_in_parent, #find_string_val_in_string_hash, #lowercase_attribute_keys, #lowercase_attribute_keys_and_values, #merge_into_embedded_hash, #parse, #parse_eval_into_array, #parse_eval_into_hash, #remove_prepended_strings

Methods included from PluginLoadTracking

included

Constructor Details

This class inherits a constructor from MasterView::DirectiveBase

Instance Method Details

#priorityObject



16
17
18
# File 'lib/masterview/directives/insert_generated_comment.rb', line 16

def priority
  DirectivePriorities::Lowest
end

#stag(directive_call_stack) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/masterview/directives/insert_generated_comment.rb', line 20

def stag(directive_call_stack)
  comment = "\n<% \n" + Generated_comment_text  + "#    "+ attr_value + "\n%>"

  ret = []
  ret << directive_call_stack.render
  ret << comment
end