---
 lib/sass/plugin/merb.rb |   36 ++++++++++++++++++++++++++++--------
 1 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/lib/sass/plugin/merb.rb b/lib/sass/plugin/merb.rb
index 9a7263e..e09b66c 100644
--- a/lib/sass/plugin/merb.rb
+++ b/lib/sass/plugin/merb.rb
@@ -18,16 +18,36 @@ unless defined?(Sass::MERB_LOADED)
   config.symbolize_keys!
   Sass::Plugin.options.merge!(config)
   
-  class MerbHandler # :nodoc:
-    def process_with_sass(request, response)
-      if !Sass::Plugin.checked_for_updates ||
-          Sass::Plugin.options[:always_update] || 
Sass::Plugin.options[:always_check]
-        Sass::Plugin.update_stylesheets
+  if version[0] > 0 || (version[0] <= 0 && version[1] >= 9)
+
+    class Merb::Rack::Application # :nodoc:
+      def sass_handler(env)
+        if !Sass::Plugin.checked_for_updates ||
+            Sass::Plugin.options[:always_update] || 
Sass::Plugin.options[:always_check]
+          Sass::Plugin.update_stylesheets
+        end
+
+        orginal_handler(env)
       end
+      alias_method :orginal_handler, :call
+      alias_method :call, :sass_handler        
+    end
+
+  else
 
-      process_without_sass(request, response)
+    class MerbHandler # :nodoc:
+      def sass_handler(request, response)
+        if !Sass::Plugin.checked_for_updates ||
+            Sass::Plugin.options[:always_update] || 
Sass::Plugin.options[:always_check]
+          Sass::Plugin.update_stylesheets
+        end
+
+        orginal_handler(request, response)
+      end
+      alias_method :orginal_handler, :process
+      alias_method :process, :sass_handler
     end
-    alias_method :process_without_sass, :process
-    alias_method :process, :process_with_sass
+
   end
+
 end
-- 
1.5.3.8


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to