/docs/gem.haml-3.1.4/classes/Haml.html
HTML | 278 lines | 185 code | 93 blank | 0 comment | 0 complexity | da29e3057943345662970d50d3b44d09 MD5 | raw file
- <?xml version="1.0" encoding="utf-8"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>Haml</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
- <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
- <script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
- <script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
- </head>
- <body>
- <div class="banner">
- <h1>
- <span class="type">Module</span>
- Haml
-
- </h1>
- <ul class="files">
-
- <li><a href="../files/lib/haml/buffer_rb.html">lib/haml/buffer.rb</a></li>
-
- <li><a href="../files/lib/haml/compiler_rb.html">lib/haml/compiler.rb</a></li>
-
- <li><a href="../files/lib/haml/engine_rb.html">lib/haml/engine.rb</a></li>
-
- <li><a href="../files/lib/haml/error_rb.html">lib/haml/error.rb</a></li>
-
- <li><a href="../files/lib/haml/exec_rb.html">lib/haml/exec.rb</a></li>
-
- <li><a href="../files/lib/haml/filters_rb.html">lib/haml/filters.rb</a></li>
-
- <li><a href="../files/lib/haml/helpers/action_view_extensions_rb.html">lib/haml/helpers/action_view_extensions.rb</a></li>
-
- <li><a href="../files/lib/haml/helpers/xss_mods_rb.html">lib/haml/helpers/xss_mods.rb</a></li>
-
- <li><a href="../files/lib/haml/helpers_rb.html">lib/haml/helpers.rb</a></li>
-
- <li><a href="../files/lib/haml/html/erb_rb.html">lib/haml/html/erb.rb</a></li>
-
- <li><a href="../files/lib/haml/html_rb.html">lib/haml/html.rb</a></li>
-
- <li><a href="../files/lib/haml/parser_rb.html">lib/haml/parser.rb</a></li>
-
- <li><a href="../files/lib/haml/root_rb.html">lib/haml/root.rb</a></li>
-
- <li><a href="../files/lib/haml/shared_rb.html">lib/haml/shared.rb</a></li>
-
- <li><a href="../files/lib/haml/template/options_rb.html">lib/haml/template/options.rb</a></li>
-
- <li><a href="../files/lib/haml/template/plugin_rb.html">lib/haml/template/plugin.rb</a></li>
-
- <li><a href="../files/lib/haml/template_rb.html">lib/haml/template.rb</a></li>
-
- <li><a href="../files/lib/haml/version_rb.html">lib/haml/version.rb</a></li>
-
- <li><a href="../files/lib/haml/util_rb.html">lib/haml/util.rb</a></li>
-
- <li><a href="../files/lib/haml_rb.html">lib/haml.rb</a></li>
-
- </ul>
- </div>
- <div id="bodyContent">
- <div id="content">
-
- <div class="description">
- <p>
- We keep options in its own self-contained file so that we can load it
- independently in Rails 3, where the full template stuff is lazy-loaded.
- </p>
- <hr size="1"></hr><p>
- This file makes <a href="Haml.html">Haml</a> work with Rails using the >
- 2.0.1 template handler API.
- </p>
- <hr size="1"></hr><p>
- The module that contains everything Haml-related:
- </p>
- <ul>
- <li>{Haml::Engine} is the class used to render <a href="Haml.html">Haml</a>
- within Ruby code.
- </li>
- <li>{Haml::Helpers} contains Ruby helpers available within <a
- href="Haml.html">Haml</a> templates.
- </li>
- <li>{Haml::Template} interfaces with web frameworks (Rails in particular).
- </li>
- <li>{Haml::Error} is raised when <a href="Haml.html">Haml</a> encounters an
- error.
- </li>
- <li>{Haml::HTML} handles conversion of <a href="Haml/HTML.html">HTML</a> to <a
- href="Haml.html">Haml</a>.
- </li>
- </ul>
- <p>
- Also see the {file:HAML_REFERENCE.md full <a href="Haml.html">Haml</a>
- reference}.
- </p>
- </div>
-
-
-
-
-
-
- <div class="sectiontitle">Methods</div>
- <dl class="methods">
-
- <dt>I</dt>
- <dd>
- <ul>
-
- <li><a href="#M000311">init_rails</a></li>
-
- </ul>
- </dd>
-
- </dl>
-
-
-
-
- <div class="sectiontitle">Classes and Modules</div>
- <ul>
-
- <li><span class="type">MODULE</span> <a href="Haml/Compiler.html">Haml::Compiler</a></li>
-
- <li><span class="type">MODULE</span> <a href="Haml/Exec.html">Haml::Exec</a></li>
-
- <li><span class="type">MODULE</span> <a href="Haml/Filters.html">Haml::Filters</a></li>
-
- <li><span class="type">MODULE</span> <a href="Haml/Helpers.html">Haml::Helpers</a></li>
-
- <li><span class="type">MODULE</span> <a href="Haml/Parser.html">Haml::Parser</a></li>
-
- <li><span class="type">MODULE</span> <a href="Haml/Shared.html">Haml::Shared</a></li>
-
- <li><span class="type">MODULE</span> <a href="Haml/Template.html">Haml::Template</a></li>
-
- <li><span class="type">MODULE</span> <a href="Haml/Util.html">Haml::Util</a></li>
-
- <li><span class="type">MODULE</span> <a href="Haml/Version.html">Haml::Version</a></li>
-
- <li><span class="type">CLASS</span> <a href="Haml/Buffer.html">Haml::Buffer</a></li>
-
- <li><span class="type">CLASS</span> <a href="Haml/Engine.html">Haml::Engine</a></li>
-
- <li><span class="type">CLASS</span> <a href="Haml/Error.html">Haml::Error</a></li>
-
- <li><span class="type">CLASS</span> <a href="Haml/HTML.html">Haml::HTML</a></li>
-
- <li><span class="type">CLASS</span> <a href="Haml/Plugin.html">Haml::Plugin</a></li>
-
- <li><span class="type">CLASS</span> <a href="Haml/SyntaxError.html">Haml::SyntaxError</a></li>
-
- </ul>
-
-
- <div class="sectiontitle">Constants</div>
- <table border='0' cellpadding='5'>
-
- <tr valign='top'>
- <td class="attr-name">ROOT_DIR</td>
- <td>=</td>
- <td class="attr-value">File.expand_path(File.join(__FILE__, "../../.."))</td>
- </tr>
-
- <tr valign='top'>
- <td> </td>
- <td colspan="2" class="attr-desc"><p>
- The root directory of the <a href="Haml.html">Haml</a> source tree. This
- may be overridden by the package manager if the lib directory is separated
- from the main source tree. @api public
- </p>
- </td>
- </tr>
-
-
- <tr valign='top'>
- <td class="attr-name">VERSION</td>
- <td>=</td>
- <td class="attr-value">version[:string] unless defined?(Haml::VERSION)</td>
- </tr>
-
- <tr valign='top'>
- <td> </td>
- <td colspan="2" class="attr-desc"><p>
- A string representing the version of <a href="Haml.html">Haml</a>. A more
- fine-grained representation is available from Haml.version. @api public
- </p>
- </td>
- </tr>
-
-
- </table>
-
-
-
- <div class="sectiontitle">Class Public methods</div>
-
- <div class="method">
- <div class="title" id="M000311">
-
- <a name="M000311"></a><b>init_rails</b>(binding)
-
- </div>
-
- <div class="description">
- <p>
- Initializes <a href="Haml.html">Haml</a> for Rails.
- </p>
- <p>
- This method is called by `init.rb`, which is run by Rails on startup. We
- use it rather than putting stuff straight into `init.rb` so we can change
- the initialization behavior without modifying the file itself.
- </p>
- <p>
- @param binding [Binding] The context of the `init.rb` file.
- </p>
- <pre>
- This isn't actually used;
- it's just passed in in case it needs to be used in the future
- </pre>
- </div>
-
-
-
-
- <div class="sourcecode">
- <p class="source-link">
- Source: <a href="javascript:toggleSource('M000311_source')" id="l_M000311_source">show</a>
-
- </p>
- <div id="M000311_source" class="dyn-source">
- <pre> <span class="ruby-comment cmt"># File lib/haml.rb, line 27</span>
- 27: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">init_rails</span>(<span class="ruby-identifier">binding</span>)
- 28: <span class="ruby-comment cmt"># 2.2 <= Rails < 3</span>
- 29: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Rails</span>) <span class="ruby-operator">&&</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:configuration</span>) <span class="ruby-operator">&&</span>
- 30: <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:after_initialize</span>) <span class="ruby-operator">&&</span>
- 31: <span class="ruby-operator">!</span><span class="ruby-constant">Haml</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">ap_geq_3?</span>
- 32: <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">after_initialize</span> <span class="ruby-keyword kw">do</span>
- 33: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-constant">Sass</span>)
- 34: <span class="ruby-identifier">autoload</span>(<span class="ruby-identifier">:Sass</span>, <span class="ruby-value str">'sass/rails2_shim'</span>)
- 35: <span class="ruby-comment cmt"># resolve autoload if it looks like they're using Sass without options</span>
- 36: <span class="ruby-constant">Sass</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RAILS_ROOT</span>, <span class="ruby-value str">'public/stylesheets/sass'</span>))
- 37: <span class="ruby-keyword kw">end</span>
- 38: <span class="ruby-keyword kw">end</span>
- 39:
- 40: <span class="ruby-comment cmt"># No &method here for Rails 2.1 compatibility</span>
- 41: <span class="ruby-node">%w[haml/template]</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">require</span> <span class="ruby-identifier">f</span>}
- 42: <span class="ruby-keyword kw">end</span></pre>
- </div>
- </div>
-
- </div>
-
- </div>
- </div>
- </body>
- </html>