public
Description: HTML Abstraction Markup Language - A Markup Haiku
Homepage: http://haml.hamptoncatlin.com
Clone URL: git://github.com/nex3/haml.git
Ensure that Sass::Plugin.update_stylesheets is run at least once per 
process, unless specifically forbidden.
nex3 (author)
Mon Feb 11 19:49:16 -0800 2008
commit  120fa87512ae7ef1af8ceafb6a231547777e7c44
tree    d649291fc3f27e16645dc4b9407e5df852889f3b
parent  70e0797e4fccddcac3c3d8d8cfa0b5a48d577fe9
...
14
15
16
 
 
 
 
 
 
17
18
19
...
35
36
37
 
38
39
40
...
14
15
16
17
18
19
20
21
22
23
24
25
...
41
42
43
44
45
46
47
0
@@ -14,6 +14,12 @@ module Sass
0
         :full_exception => true
0
       }
0
 
0
+ # Whether or not Sass has *ever* checked if the stylesheets need updates
0
+ # (in this Ruby instance).
0
+ def checked_for_updates
0
+ @@checked_for_updates
0
+ end
0
+
0
       # Gets various options for Sass. See README for details.
0
       #--
0
       # TODO: *DOCUMENT OPTIONS*
0
@@ -35,6 +41,7 @@ module Sass
0
       def update_stylesheets
0
         return if options[:never_update]
0
 
0
+ @@checked_for_updates = true
0
         Dir.glob(File.join(options[:template_location], "**", "*.sass")).entries.each do |file|
0
 
0
           # Get the relative path to the file with no extension
...
20
21
22
23
 
 
 
 
 
24
25
26
...
20
21
22
 
23
24
25
26
27
28
29
30
0
@@ -20,7 +20,11 @@ unless defined?(Sass::MERB_LOADED)
0
   
0
   class MerbHandler # :nodoc:
0
     def process_with_sass(request, response)
0
- Sass::Plugin.update_stylesheets if Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
0
+ if !Sass::Plugin.checked_for_updates ||
0
+ Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
0
+ Sass::Plugin.update_stylesheets
0
+ end
0
+
0
       process_without_sass(request, response)
0
     end
0
     alias_method :process_without_sass, :process
...
11
12
13
14
 
 
 
 
 
15
16
17
...
11
12
13
 
14
15
16
17
18
19
20
21
0
@@ -11,7 +11,11 @@ unless defined?(Sass::RAILS_LOADED)
0
     class Base
0
       alias_method :sass_old_process, :process
0
       def process(*args)
0
- Sass::Plugin.update_stylesheets if Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
0
+ if !Sass::Plugin.checked_for_updates ||
0
+ Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
0
+ Sass::Plugin.update_stylesheets
0
+ end
0
+
0
         sass_old_process(*args)
0
       end
0
     end

Comments

    No one has commented yet.