1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Merge branch 'master' of git@github.com:nex3/haml

This commit is contained in:
Nathan Weizenbaum 2008-02-12 20:58:11 -08:00
commit 9bf42750cd
3 changed files with 17 additions and 2 deletions

View file

@ -14,6 +14,12 @@ module Sass
:full_exception => true
}
# Whether or not Sass has *ever* checked if the stylesheets need updates
# (in this Ruby instance).
def checked_for_updates
@@checked_for_updates
end
# Gets various options for Sass. See README for details.
#--
# TODO: *DOCUMENT OPTIONS*
@ -35,6 +41,7 @@ module Sass
def update_stylesheets
return if options[:never_update]
@@checked_for_updates = true
Dir.glob(File.join(options[:template_location], "**", "*.sass")).entries.each do |file|
# Get the relative path to the file with no extension

View file

@ -20,7 +20,11 @@ unless defined?(Sass::MERB_LOADED)
class MerbHandler # :nodoc:
def process_with_sass(request, response)
Sass::Plugin.update_stylesheets if Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
if !Sass::Plugin.checked_for_updates ||
Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
Sass::Plugin.update_stylesheets
end
process_without_sass(request, response)
end
alias_method :process_without_sass, :process

View file

@ -11,7 +11,11 @@ unless defined?(Sass::RAILS_LOADED)
class Base
alias_method :sass_old_process, :process
def process(*args)
Sass::Plugin.update_stylesheets if Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
if !Sass::Plugin.checked_for_updates ||
Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
Sass::Plugin.update_stylesheets
end
sass_old_process(*args)
end
end