Skip to content

Commit

Permalink
[Sass] Sass::Plugin is not expected to be thread safe in development …
Browse files Browse the repository at this point in the history
…mode at this point.
  • Loading branch information
thedarkone committed Apr 11, 2010
1 parent 4e9b686 commit dbd0c95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/sass/plugin/staleness_checker.rb
@@ -1,9 +1,15 @@
module Sass
module Plugin
class StalenessChecker
def initialize
@dependencies_cache = {}

class << self
attr_accessor :dependencies_cache
end

def initialize(dependencies = self.class.dependencies_cache)
@dependencies = dependencies
@mtimes, @dependencies_stale = {}, {}
@dependencies = Thread.current[:_sass_file_dependencies] ||= {}
end

def stylesheet_needs_update?(css_file, template_file)
Expand Down
1 change: 1 addition & 0 deletions test/sass/plugin_test.rb
Expand Up @@ -357,6 +357,7 @@ def touch(*args)
end

def reset_mtimes
Sass::Plugin::StalenessChecker.dependencies_cache = {}
atime = Time.now
mtime = Time.now - 5
Dir["{#{template_loc},#{tempfile_loc}}/**/*.{css,sass,scss}"].each {|f| File.utime(atime, mtime, f)}
Expand Down

0 comments on commit dbd0c95

Please sign in to comment.