module Sass::Plugin

def update_stylesheets

if it does.
from options[:templates]
and updates it using the corresponding template
to see if it needs updating,
Checks each stylesheet in options[:css_location]
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
    name = file.sub(options[:template_location] + "/", "")[0...-5]
    if !forbid_update?(name) && (options[:always_update] || stylesheet_needs_update?(name))
      css = css_filename(name)
      File.delete(css) if File.exists?(css)
      filename = template_filename(name)
      l_options = @@options.dup
      l_options[:filename] = filename
      l_options[:load_paths] = load_paths
      engine = Engine.new(File.read(filename), l_options)
      result = begin
                 engine.render
               rescue Exception => e
                 exception_string(e)
               end
      # Create any directories that might be necessary
      dirs = [l_options[:css_location]]
      name.split("/")[0...-1].each { |dir| dirs << "#{dirs[-1]}/#{dir}" }
      dirs.each { |dir| Dir.mkdir(dir) unless File.exist?(dir) }
      # Finally, write the file
      File.open(css, 'w') do |file|
        file.print(result)
      end
    end
  end
end