2006-12-04 00:06:39 +00:00
|
|
|
dir = File.dirname(__FILE__)
|
2008-10-13 05:38:49 +00:00
|
|
|
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
2006-12-19 02:56:49 +00:00
|
|
|
|
2009-01-25 19:02:33 +00:00
|
|
|
require 'haml/version'
|
|
|
|
|
2009-06-18 20:40:57 +00:00
|
|
|
# The module that contains everything Haml-related:
|
2008-04-08 06:09:17 +00:00
|
|
|
#
|
2009-06-18 20:40:57 +00: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 19:35:42 +00:00
|
|
|
#
|
2009-06-18 20:40:57 +00:00
|
|
|
# Also see the {file:HAML_REFERENCE.md full Haml reference}.
|
2007-12-11 10:03:44 +00:00
|
|
|
module Haml
|
2009-01-25 19:02:33 +00:00
|
|
|
extend Haml::Version
|
2008-04-11 04:39:48 +00:00
|
|
|
|
2008-04-11 05:00:42 +00:00
|
|
|
# A string representing the version of Haml.
|
2009-01-25 19:02:33 +00:00
|
|
|
# A more fine-grained representation is available from Haml.version.
|
2008-04-11 05:01:25 +00:00
|
|
|
VERSION = version[:string] unless defined?(Haml::VERSION)
|
2008-03-15 04:25:36 +00:00
|
|
|
|
2009-04-29 08:02:44 +00:00
|
|
|
# Initializes Haml for Rails.
|
|
|
|
#
|
|
|
|
# This method is called by `init.rb`,
|
2007-12-11 10:03:44 +00:00
|
|
|
# which is run by Rails on startup.
|
2009-04-29 08:02:44 +00:00
|
|
|
# We use it rather than putting stuff straight into `init.rb`
|
2007-12-11 10:03:44 +00:00
|
|
|
# so we can change the initialization behavior
|
|
|
|
# without modifying the file itself.
|
2009-04-29 08:02:44 +00: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 10:03:44 +00:00
|
|
|
def self.init_rails(binding)
|
2008-07-30 13:58:56 +00:00
|
|
|
# No &method here for Rails 2.1 compatibility
|
|
|
|
%w[haml/template sass sass/plugin].each {|f| require f}
|
2007-12-11 10:03:44 +00:00
|
|
|
end
|
|
|
|
end
|
2006-12-19 02:56:49 +00:00
|
|
|
|
2008-11-23 03:17:06 +00:00
|
|
|
require 'haml/util'
|
2006-12-04 00:06:39 +00:00
|
|
|
require 'haml/engine'
|