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:
commit
9bf42750cd
3 changed files with 17 additions and 2 deletions
|
@ -14,6 +14,12 @@ module Sass
|
||||||
:full_exception => true
|
: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.
|
# Gets various options for Sass. See README for details.
|
||||||
#--
|
#--
|
||||||
# TODO: *DOCUMENT OPTIONS*
|
# TODO: *DOCUMENT OPTIONS*
|
||||||
|
@ -35,6 +41,7 @@ module Sass
|
||||||
def update_stylesheets
|
def update_stylesheets
|
||||||
return if options[:never_update]
|
return if options[:never_update]
|
||||||
|
|
||||||
|
@@checked_for_updates = true
|
||||||
Dir.glob(File.join(options[:template_location], "**", "*.sass")).entries.each do |file|
|
Dir.glob(File.join(options[:template_location], "**", "*.sass")).entries.each do |file|
|
||||||
|
|
||||||
# Get the relative path to the file with no extension
|
# Get the relative path to the file with no extension
|
||||||
|
|
|
@ -20,7 +20,11 @@ unless defined?(Sass::MERB_LOADED)
|
||||||
|
|
||||||
class MerbHandler # :nodoc:
|
class MerbHandler # :nodoc:
|
||||||
def process_with_sass(request, response)
|
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)
|
process_without_sass(request, response)
|
||||||
end
|
end
|
||||||
alias_method :process_without_sass, :process
|
alias_method :process_without_sass, :process
|
||||||
|
|
|
@ -11,7 +11,11 @@ unless defined?(Sass::RAILS_LOADED)
|
||||||
class Base
|
class Base
|
||||||
alias_method :sass_old_process, :process
|
alias_method :sass_old_process, :process
|
||||||
def process(*args)
|
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)
|
sass_old_process(*args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue