PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/scalate-jruby/src/main/resources/haml-3.0.25/init.rb

http://github.com/scalate/scalate
Ruby | 18 lines | 12 code | 1 blank | 5 comment | 1 complexity | 8cf7412e1c69f8b67b0d3a05e834d5da MD5 | raw file
 1begin
 2  require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here
 3rescue LoadError
 4  begin
 5    require 'haml' # From gem
 6  rescue LoadError => e
 7    # gems:install may be run to install Haml with the skeleton plugin
 8    # but not the gem itself installed.
 9    # Don't die if this is the case.
10    raise e unless defined?(Rake) &&
11      (Rake.application.top_level_tasks.include?('gems') ||
12        Rake.application.top_level_tasks.include?('gems:install'))
13  end
14end
15
16# Load Haml and Sass.
17# Haml may be undefined if we're running gems:install.
18Haml.init_rails(binding) if defined?(Haml)