Permalink
Browse files

More specific Haml and Sass pre-require checks

If anything defined the Haml or Sass modules prior to
invoking the haml or sass rendering methods, the module had
to be explicitly required... now it doesn't.
  • Loading branch information...
1 parent c9b2f6b commit c156c68b1c2c33d80e1f63f670b6d4b7917fa4f7 S. Brent Faulkner committed with rtomayko Mar 20, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/sinatra/base.rb
View
@@ -223,13 +223,13 @@ def erb(template, options={})
end
def haml(template, options={})
- require 'haml' unless defined? ::Haml
+ require 'haml' unless defined? ::Haml::Engine
options[:options] ||= self.class.haml if self.class.respond_to? :haml
render :haml, template, options
end
def sass(template, options={}, &block)
- require 'sass' unless defined? ::Sass
+ require 'sass' unless defined? ::Sass::Engine
options[:layout] = false
render :sass, template, options
end

0 comments on commit c156c68

Please sign in to comment.