Inspired by Kaminari
# File lib/bootstrap-sass.rb, line 5 def self.load! if compass? require 'bootstrap-sass/compass_functions' register_compass_extension elsif asset_pipeline? require 'bootstrap-sass/sass_functions' end if rails? require 'sass-rails' register_rails_engine end if !(rails? || compass?) raise Bootstrap::FrameworkNotFound, "bootstrap-sass requires either Rails > 3.1 or Compass, neither of which are loaded" end stylesheets = File.expand_path(File.join("..", 'vendor', 'assets', 'stylesheets')) ::Sass.load_paths << stylesheets end
# File lib/bootstrap-sass.rb, line 27 def self.asset_pipeline? defined?(::Sprockets) end
# File lib/bootstrap-sass.rb, line 31 def self.compass? defined?(::Compass) end
# File lib/bootstrap-sass.rb, line 35 def self.rails? defined?(::Rails) end
# File lib/bootstrap-sass.rb, line 39 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', :path => base, :stylesheets_directory => styles, :templates_directory => templates) end
# File lib/bootstrap-sass.rb, line 46 def self.register_rails_engine require 'bootstrap-sass/engine' end