module MasterView module Directives #outputs an else/end block around the text tags removing previous end tag (from if/elsif) class Else < MasterView::DirectiveBase def priority DirectivePriorities::High end def stag(directive_call_stack) tag = @directive_call_stack.context[:tag] delete_last_in_parent(tag, erb('end') ) ret = [] ret << erb('else') ret << directive_call_stack.render end def etag(directive_call_stack) ret = [] ret << directive_call_stack.render ret << erb('end') end end end end