Module: Mice

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

Overview

Mice.load!

Defined Under Namespace

Modules: Rails

Constant Summary collapse

VERSION =
"0.2.14"

Class Method Summary collapse

Class Method Details

.asset_pipeline?Boolean

Environment detection helpers

Returns:

  • (Boolean)


55
56
57
# File 'lib/mice.rb', line 55

def asset_pipeline?
  defined?(::Sprockets)
end

.assets_pathObject



50
51
52
# File 'lib/mice.rb', line 50

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

.compass?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/mice.rb', line 59

def compass?
  defined?(::Compass)
end

.fonts_pathObject



42
43
44
# File 'lib/mice.rb', line 42

def fonts_path
  File.join assets_path, 'fonts'
end

.gem_pathObject

Paths



34
35
36
# File 'lib/mice.rb', line 34

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

.javascripts_pathObject



46
47
48
# File 'lib/mice.rb', line 46

def javascripts_path
  File.join assets_path, 'javascripts'
end

.load!Object

Inspired by Kaminari



23
24
25
26
27
28
29
30
31
# File 'lib/mice.rb', line 23

def load!
  register_compass_extension if compass?

  if rails?
    register_rails_engine
  end

  configure_sass
end

.rails?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/mice.rb', line 63

def rails?
  defined?(::Rails)
end

.stylesheets_pathObject



38
39
40
# File 'lib/mice.rb', line 38

def stylesheets_path
  File.join assets_path, 'stylesheets'
end