Module: Bootstrap

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

Defined Under Namespace

Modules: Rails

Constant Summary collapse

VERSION =
'4.1.1'
BOOTSTRAP_SHA =
'779ad9f174ea5ab7e755f6df0ec9e5912d67dd16'

Class Method Summary collapse

Class Method Details

.assets_pathObject



32
33
34
# File 'lib/bootstrap.rb', line 32

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

.gem_pathObject

Paths



20
21
22
# File 'lib/bootstrap.rb', line 20

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

.hanami?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/bootstrap.rb', line 45

def hanami?
  defined?(::Hanami)
end

.javascripts_pathObject



28
29
30
# File 'lib/bootstrap.rb', line 28

def javascripts_path
  File.join assets_path, 'javascripts'
end

.load!Object

Inspired by Kaminari



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/bootstrap.rb', line 7

def load!
  if rails?
    register_rails_engine
  elsif hanami?
    register_hanami
  elsif sprockets?
    register_sprockets
  end

  configure_sass
end

.rails?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/bootstrap.rb', line 41

def rails?
  defined?(::Rails)
end

.sprockets?Boolean

Environment detection helpers

Returns:

  • (Boolean)


37
38
39
# File 'lib/bootstrap.rb', line 37

def sprockets?
  defined?(::Sprockets)
end

.stylesheets_pathObject



24
25
26
# File 'lib/bootstrap.rb', line 24

def stylesheets_path
  File.join assets_path, 'stylesheets'
end