diff options
author | Thomas McDonald <tom@conceptcoding.co.uk> | 2012-05-06 22:11:47 +0400 |
---|---|---|
committer | Thomas McDonald <tom@conceptcoding.co.uk> | 2012-05-06 22:11:47 +0400 |
commit | 1503314ca285f4188eb81251f457a741ece858f4 (patch) | |
tree | 276182988901efb5a7ccba7b955ef80604665fbd /lib/bootstrap-sass.rb | |
parent | d68959b70823ebe5076ced99c241ac227450aa3a (diff) |
further tweaking to rails w/compass support
Diffstat (limited to 'lib/bootstrap-sass.rb')
-rw-r--r-- | lib/bootstrap-sass.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/bootstrap-sass.rb b/lib/bootstrap-sass.rb index 47beeee7..485c4c8d 100644 --- a/lib/bootstrap-sass.rb +++ b/lib/bootstrap-sass.rb @@ -3,12 +3,12 @@ module Bootstrap # Inspired by Kaminari def self.load! - if compass? + if compass? && asset_pipeline? + register_compass_extension + elsif compass? + # Only require compass extension if a standalone project require 'bootstrap-sass/compass_extensions' - base = File.join(File.dirname(__FILE__), '..') - styles = File.join(base, 'vendor', 'assets', 'stylesheets') - templates = File.join(base, 'templates') - ::Compass::Frameworks.register('bootstrap', :stylesheets_directory => styles, :templates_directory => templates) + register_compass_extension elsif asset_pipeline? require 'sass-rails' # See: https://github.com/thomas-mcdonald/bootstrap-sass/pull/4 require 'bootstrap-sass/engine' @@ -23,6 +23,13 @@ module Bootstrap defined?(::Rails) && ::Rails.version >= '3.1.0' end + def self.register_compass_extension + base = File.join(File.dirname(__FILE__), '..') + styles = File.join(base, 'vendor', 'assets', 'stylesheets') + templates = File.join(base, 'templates') + ::Compass::Frameworks.register('bootstrap', :stylesheets_directory => styles, :templates_directory => templates) + end + def self.compass? defined?(::Compass) end |