#!/usr/bin/env ruby #-- # Copyright (c) 2006 Jeff Barczewski # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ # # = MasterView - Rails-optimized (x)html friendly template engine # # MasterView is a ruby/rails optimized HTML/XHTML friendly template engine. # It is designed to use the full power and productivity of rails including # layouts, partials, and rails html helpers while still being editable/styleable # in a WYSIWYG HTML editor. # # The MasterView template engine supports a number of configuration settings # which allow a client to easily customize its operation. # See MasterView::Configuration for a complete description of the # supported configuration options. # #-- #TODO: add some documentation in MasterView::DirectiveBase for directive developers: # Reference the MV logger using MasterView::Log #++ # #-- # Drop the main masterview directory in the plugin dir out of the load path # We only needed it around long enough to get this file loaded. # Everything else comes out of the subdirectories. #++ $LOAD_PATH.unshift(File.dirname(__FILE__)) # MasterView template engine module MasterView end # Ensure that the initializer gets run in order to load and install configuration settings. # Detect here whether the Initializer has been explicitly run by the client's startup. # Otherwise, we arrived here from a simple "require 'masterview'" and need to # fire up the initializer ourselves to load config settings before the plugin code # is loaded below and then to perform final installation configuration. should_run_initializer = defined?(MasterView::ConfigSettings).nil? if should_run_initializer require 'masterview/initializer' # pulls in masterview/directive_load_path, directive_metadata MasterView::Initializer.run(:initialize_configuration) # bail out at load_plugin to continue below end #external requires require 'rexml/rexml' require 'rexml/sax2listener' require 'cgi' require 'fileutils' require 'strscan' require 'find' require 'erb' require 'stringio' require 'set' require 'pathname' require 'ostruct' require 'yaml' #external gem requires require 'facets/core/string/blank' require 'facets/core/string/indent' require 'facets/core/string/starts_with' require 'active_support/inflector' #optional external gem requires, added functionality when available begin require 'tidy' rescue LoadError # Tidy was not available to load end #internal requires - ruby and rails extensions require 'masterview/core_ext/pathname' require 'masterview/core_ext/string' #internal requires require 'masterview/masterview_version' require 'masterview/masterview_info' require 'masterview/case_insensitive_hash' require 'masterview/filter_helpers' require 'masterview/mtime_tracking_hash' require 'masterview/exceptions' require 'masterview/io' require 'masterview/keyword_expander' require 'masterview/plugin_load_tracking' require 'masterview/attr_string_parser' #require 'masterview/directive_metadata' # already loaded by initializer require 'masterview/directive_dsl' require 'masterview/directive_helpers' require 'masterview/directive_base' #require 'masterview/directive_load_path' # already loaded by initializer require 'masterview/directive_registry' require 'masterview/parser_helpers' require 'masterview/parser' require 'masterview/analyzer' require 'masterview/template_spec' require 'masterview/runtime_helpers' include MasterView::RuntimeHelpers if should_run_initializer MasterView::Initializer.run(:complete_plugin_installation, MasterView::ConfigSettings) end