Module: Hackathon::Bootstrap

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

Defined Under Namespace

Modules: Rails

Constant Summary collapse

VERSION =
"0.0.1"
PATCHLEVEL =
5
@@theme =
'default'

Class Method Summary collapse

Class Method Details

.asset_pipeline?Boolean

Environment detection helpers



44
45
46
# File 'lib/hackathon-bootstrap.rb', line 44

def asset_pipeline?
  defined?(::Sprockets)
end

.assets_pathObject



39
40
41
# File 'lib/hackathon-bootstrap.rb', line 39

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

.compass?Boolean



48
49
50
# File 'lib/hackathon-bootstrap.rb', line 48

def compass?
  defined?(::Compass)
end

.fonts_pathObject



31
32
33
# File 'lib/hackathon-bootstrap.rb', line 31

def fonts_path
  File.join assets_path, 'fonts'
end

.gem_pathObject

Paths



23
24
25
# File 'lib/hackathon-bootstrap.rb', line 23

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

.javascripts_pathObject



35
36
37
# File 'lib/hackathon-bootstrap.rb', line 35

def javascripts_path
  File.join assets_path, 'javascripts'
end

.load!Object

Inspired by Kaminari



8
9
10
11
12
# File 'lib/hackathon-bootstrap.rb', line 8

def load!
  register_compass_extension if compass?
  register_rails_engine      if rails?
  configure_sass
end

.rails?Boolean



52
53
54
# File 'lib/hackathon-bootstrap.rb', line 52

def rails?
  defined?(::Rails)
end

.stylesheets_pathObject



27
28
29
# File 'lib/hackathon-bootstrap.rb', line 27

def stylesheets_path
  File.join assets_path, 'stylesheets'
end

.themeObject



18
19
20
# File 'lib/hackathon-bootstrap.rb', line 18

def theme
  @@theme ||= 'default'
end

.use(theme) ⇒ Object



14
15
16
# File 'lib/hackathon-bootstrap.rb', line 14

def use theme
  @@theme = theme
end