2006-12-03 19:06:39 -05:00
|
|
|
dir = File.dirname(__FILE__)
|
2008-10-13 01:38:49 -04:00
|
|
|
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
2006-12-18 21:56:49 -05:00
|
|
|
|
2009-01-25 14:02:33 -05:00
|
|
|
require 'haml/version'
|
|
|
|
|
2009-06-18 16:40:57 -04:00
|
|
|
# The module that contains everything Haml-related:
|
2008-04-08 02:09:17 -04:00
|
|
|
#
|
2009-06-18 16:40:57 -04:00
|
|
|
# * {Haml::Engine} is the class used to render Haml within Ruby code.
|
|
|
|
# * {Haml::Helpers} contains Ruby helpers available within Haml templates.
|
|
|
|
# * {Haml::Template} interfaces with web frameworks (Rails in particular).
|
|
|
|
# * {Haml::Error} is raised when Haml encounters an error.
|
|
|
|
# * {Haml::HTML} handles conversion of HTML to Haml.
|
2008-04-24 15:35:42 -04:00
|
|
|
#
|
2009-06-18 16:40:57 -04:00
|
|
|
# Also see the {file:HAML_REFERENCE.md full Haml reference}.
|
2007-12-11 05:03:44 -05:00
|
|
|
module Haml
|
2009-01-25 14:02:33 -05:00
|
|
|
extend Haml::Version
|
2008-04-11 00:39:48 -04:00
|
|
|
|
2008-04-11 01:00:42 -04:00
|
|
|
# A string representing the version of Haml.
|
2009-01-25 14:02:33 -05:00
|
|
|
# A more fine-grained representation is available from Haml.version.
|
2008-04-11 01:01:25 -04:00
|
|
|
VERSION = version[:string] unless defined?(Haml::VERSION)
|
2008-03-15 00:25:36 -04:00
|
|
|
|
2009-04-29 04:02:44 -04:00
|
|
|
# Initializes Haml for Rails.
|
|
|
|
#
|
|
|
|
# This method is called by `init.rb`,
|
2007-12-11 05:03:44 -05:00
|
|
|
# which is run by Rails on startup.
|
2009-04-29 04:02:44 -04:00
|
|
|
# We use it rather than putting stuff straight into `init.rb`
|
2007-12-11 05:03:44 -05:00
|
|
|
# so we can change the initialization behavior
|
|
|
|
# without modifying the file itself.
|
2009-04-29 04:02:44 -04:00
|
|
|
#
|
|
|
|
# @param binding [Binding] The context of the `init.rb` file.
|
|
|
|
# This isn't actually used;
|
|
|
|
# it's just passed in in case it needs to be used in the future
|
2007-12-11 05:03:44 -05:00
|
|
|
def self.init_rails(binding)
|
2008-07-30 09:58:56 -04:00
|
|
|
# No &method here for Rails 2.1 compatibility
|
|
|
|
%w[haml/template sass sass/plugin].each {|f| require f}
|
2007-12-11 05:03:44 -05:00
|
|
|
end
|
|
|
|
end
|
2006-12-18 21:56:49 -05:00
|
|
|
|
2008-11-22 22:17:06 -05:00
|
|
|
require 'haml/util'
|
2006-12-03 19:06:39 -05:00
|
|
|
require 'haml/engine'
|