diff options
author | Thomas McDonald <tom@conceptcoding.co.uk> | 2012-05-11 17:39:47 +0400 |
---|---|---|
committer | Thomas McDonald <tom@conceptcoding.co.uk> | 2012-05-11 17:39:47 +0400 |
commit | 2a9d9bf4fb9eddca87396477dd9ea93ec5d3b985 (patch) | |
tree | 12998841d58c18cd901400f541fe6af68a80d669 | |
parent | 4a566811118903dbd0f044446ff7a8eb58c1c36e (diff) |
Register the rails engine when using Rails w/Compass
This means that the javascripts will still be available through the
asset pipeline.
-rw-r--r-- | lib/bootstrap-sass.rb | 15 | ||||
-rw-r--r-- | lib/bootstrap-sass/compass_functions.rb (renamed from lib/bootstrap-sass/compass_extensions.rb) | 0 | ||||
-rw-r--r-- | lib/bootstrap-sass/rails_functions.rb (renamed from lib/bootstrap-sass/rails_extentions.rb) | 0 | ||||
-rw-r--r-- | test/test_helper.rb | 4 |
4 files changed, 12 insertions, 7 deletions
diff --git a/lib/bootstrap-sass.rb b/lib/bootstrap-sass.rb index 485c4c8d..d6bea4f6 100644 --- a/lib/bootstrap-sass.rb +++ b/lib/bootstrap-sass.rb @@ -5,14 +5,15 @@ module Bootstrap def self.load! if compass? && asset_pipeline? register_compass_extension + register_rails_engine elsif compass? # Only require compass extension if a standalone project - require 'bootstrap-sass/compass_extensions' + require 'bootstrap-sass/compass_functions' register_compass_extension elsif asset_pipeline? require 'sass-rails' # See: https://github.com/thomas-mcdonald/bootstrap-sass/pull/4 - require 'bootstrap-sass/engine' - require 'bootstrap-sass/rails_extentions' + register_rails_engine + require 'bootstrap-sass/rails_functions' else raise Bootstrap::FrameworkNotFound, "bootstrap-sass requires either Rails > 3.1 or Compass, neither of which are loaded" end @@ -23,6 +24,10 @@ module Bootstrap defined?(::Rails) && ::Rails.version >= '3.1.0' end + def self.compass? + defined?(::Compass) + end + def self.register_compass_extension base = File.join(File.dirname(__FILE__), '..') styles = File.join(base, 'vendor', 'assets', 'stylesheets') @@ -30,8 +35,8 @@ module Bootstrap ::Compass::Frameworks.register('bootstrap', :stylesheets_directory => styles, :templates_directory => templates) end - def self.compass? - defined?(::Compass) + def self.register_rails_engine + require 'bootstrap-sass/engine' end end diff --git a/lib/bootstrap-sass/compass_extensions.rb b/lib/bootstrap-sass/compass_functions.rb index a579b8d0..a579b8d0 100644 --- a/lib/bootstrap-sass/compass_extensions.rb +++ b/lib/bootstrap-sass/compass_functions.rb diff --git a/lib/bootstrap-sass/rails_extentions.rb b/lib/bootstrap-sass/rails_functions.rb index 51bb904f..51bb904f 100644 --- a/lib/bootstrap-sass/rails_extentions.rb +++ b/lib/bootstrap-sass/rails_functions.rb diff --git a/test/test_helper.rb b/test/test_helper.rb index caff7e14..021d0d6a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -3,5 +3,5 @@ $:.unshift("#{File.dirname(__FILE__)}/..") require 'test/unit' require 'sass' -require 'lib/bootstrap-sass/compass_extensions' -require 'lib/bootstrap-sass/rails_extentions'
\ No newline at end of file +require 'lib/bootstrap-sass/compass_functions' +require 'lib/bootstrap-sass/rails_functions'
\ No newline at end of file |