Module: Bootstrap

Defined in:
lib/bootstrap-sass.rb,
lib/bootstrap-sass/engine.rb,
lib/bootstrap-sass/version.rb

Defined Under Namespace

Modules: Rails

Constant Summary collapse

VERSION =
'3.1.1.0'
BOOTSTRAP_SHA =
'385fb6898128bbfdc3def581bb92e01818fa0525'

Class Method Summary collapse

Class Method Details

.asset_pipeline?Boolean

Environment detection helpers

Returns:

  • (Boolean)


38
39
40
# File 'lib/bootstrap-sass.rb', line 38

def asset_pipeline?
  defined?(::Sprockets)
end

.assets_pathObject



33
34
35
# File 'lib/bootstrap-sass.rb', line 33

def assets_path
  @assets_path ||= File.join gem_path, 'vendor', 'assets'
end

.compass?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/bootstrap-sass.rb', line 42

def compass?
  defined?(::Compass)
end

.fonts_pathObject



25
26
27
# File 'lib/bootstrap-sass.rb', line 25

def fonts_path
  File.join assets_path, 'fonts'
end

.gem_pathObject

Paths



17
18
19
# File 'lib/bootstrap-sass.rb', line 17

def gem_path
  @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
end

.javascripts_pathObject



29
30
31
# File 'lib/bootstrap-sass.rb', line 29

def javascripts_path
  File.join assets_path, 'javascripts'
end

.load!Object

Inspired by Kaminari



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/bootstrap-sass.rb', line 4

def load!
  require 'bootstrap-sass/sass_functions'
  register_compass_extension if compass?

  if rails?
    require 'sass-rails'
    register_rails_engine
  end

  configure_sass
end

.rails?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/bootstrap-sass.rb', line 46

def rails?
  defined?(::Rails)
end

.stylesheets_pathObject



21
22
23
# File 'lib/bootstrap-sass.rb', line 21

def stylesheets_path
  File.join assets_path, 'stylesheets'
end