From 719cd980ae438093d33876a06c956ce388ee78d1 Mon Sep 17 00:00:00 2001 From: Jacques Crocker Date: Sat, 20 Feb 2010 12:43:10 -0800 Subject: [PATCH] Separating out Rails2 actionpack integration logic Rails3 has different internal implementations on ActionPack which is causing breakage when trying to calculate image_paths. Lets only calculate this logic for Rails 2 at the moment, and figure out what to do with Rails3 later --- .../rails/{ => actionpack2}/action_controller.rb | 0 .../rails/{ => actionpack2}/sass_plugin.rb | 0 .../app_integration/rails/{ => actionpack2}/urls.rb | 0 lib/compass/app_integration/rails/runtime.rb | 12 ++++++++---- 4 files changed, 8 insertions(+), 4 deletions(-) rename lib/compass/app_integration/rails/{ => actionpack2}/action_controller.rb (100%) rename lib/compass/app_integration/rails/{ => actionpack2}/sass_plugin.rb (100%) rename lib/compass/app_integration/rails/{ => actionpack2}/urls.rb (100%) diff --git a/lib/compass/app_integration/rails/action_controller.rb b/lib/compass/app_integration/rails/actionpack2/action_controller.rb similarity index 100% rename from lib/compass/app_integration/rails/action_controller.rb rename to lib/compass/app_integration/rails/actionpack2/action_controller.rb diff --git a/lib/compass/app_integration/rails/sass_plugin.rb b/lib/compass/app_integration/rails/actionpack2/sass_plugin.rb similarity index 100% rename from lib/compass/app_integration/rails/sass_plugin.rb rename to lib/compass/app_integration/rails/actionpack2/sass_plugin.rb diff --git a/lib/compass/app_integration/rails/urls.rb b/lib/compass/app_integration/rails/actionpack2/urls.rb similarity index 100% rename from lib/compass/app_integration/rails/urls.rb rename to lib/compass/app_integration/rails/actionpack2/urls.rb diff --git a/lib/compass/app_integration/rails/runtime.rb b/lib/compass/app_integration/rails/runtime.rb index 82a353d1..d1a5ed5b 100644 --- a/lib/compass/app_integration/rails/runtime.rb +++ b/lib/compass/app_integration/rails/runtime.rb @@ -1,10 +1,14 @@ unless defined?(Compass::RAILS_LOADED) Compass::RAILS_LOADED = true - - %w(action_controller sass_plugin urls).each do |lib| - require "compass/app_integration/rails/#{lib}" + + if ActionPack::VERSION::MAJOR >= 3 + # figure something out so image_path works with rails integration + else + %w(action_controller sass_plugin urls).each do |lib| + require "compass/app_integration/rails/actionpack2/#{lib}" + end end - + # Wierd that this has to be re-included to pick up sub-modules. Ruby bug? class Sass::Script::Functions::EvaluationContext include Sass::Script::Functions