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.3"
PATCHLEVEL =
2
@@theme =
'default'

Class Method Summary collapse

Class Method Details

.asset_pipeline?Boolean

Environment detection helpers

Returns:

  • (Boolean)


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

def asset_pipeline?
  defined?(::Sprockets)
end

.assets_pathObject



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

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

.compass?Boolean

Returns:

  • (Boolean)


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

def compass?
  defined?(::Compass)
end

.fonts_pathObject



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

def fonts_path
  File.join assets_path, 'fonts'
end

.gem_pathObject

Paths



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

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

.javascripts_pathObject



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

def javascripts_path
  File.join assets_path, 'javascripts'
end

.load!Object



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

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

.rails?Boolean

Returns:

  • (Boolean)


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

def rails?
  defined?(::Rails)
end

.stylesheets_pathObject



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

def stylesheets_path
  File.join assets_path, 'stylesheets'
end

.themeObject



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

def theme
  @@theme
end

.use(theme) ⇒ Object



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

def use theme
  @@theme = theme
end