2006-12-04 00:06:39 +00:00
|
|
|
dir = File.dirname(__FILE__)
|
2008-10-12 22:38:49 -07:00
|
|
|
$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
|
2006-12-19 02:56:49 +00:00
|
|
|
|
2009-01-25 11:02:33 -08:00
|
|
|
require 'haml/version'
|
|
|
|
|
2009-06-18 13:40:57 -07:00
|
|
|
# The module that contains everything Haml-related:
|
2008-04-07 23:09:17 -07:00
|
|
|
#
|
2009-06-18 13:40:57 -07: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 12:35:42 -07:00
|
|
|
#
|
2009-06-18 13:40:57 -07:00
|
|
|
# Also see the {file:HAML_REFERENCE.md full Haml reference}.
|
2007-12-11 10:03:44 +00:00
|
|
|
module Haml
|
2009-01-25 11:02:33 -08:00
|
|
|
extend Haml::Version
|
2008-04-10 21:39:48 -07:00
|
|
|
|
2008-04-10 22:00:42 -07:00
|
|
|
# A string representing the version of Haml.
|
2009-01-25 11:02:33 -08:00
|
|
|
# A more fine-grained representation is available from Haml.version.
|
2008-04-10 22:01:25 -07:00
|
|
|
VERSION = version[:string] unless defined?(Haml::VERSION)
|
2008-03-14 21:25:36 -07:00
|
|
|
|
2009-04-29 01:02:44 -07: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 01:02:44 -07: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 01:02:44 -07: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 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 10:03:44 +00:00
|
|
|
end
|
|
|
|
end
|
2006-12-19 02:56:49 +00:00
|
|
|
|
2008-11-22 19:17:06 -08:00
|
|
|
require 'haml/util'
|
2006-12-04 00:06:39 +00:00
|
|
|
require 'haml/engine'
|