Module: Fomantic::Ui::Sass

Defined in:
lib/fomantic-ui-sass.rb,
lib/fomantic/ui/sass/engine.rb,
lib/fomantic/ui/sass/version.rb,
lib/fomantic/ui/sass/breadcrumbs.rb

Defined Under Namespace

Modules: BreadCrumbs, Rails Classes: FrameworkNotFound

Constant Summary collapse

VERSION =
'2.9.3.2'
SEMANTIC_UI_SHA =
'697bba341f4ea6357e5fe22d8c7166aec107bf2a'

Class Method Summary collapse

Class Method Details

.assets_pathObject



34
35
36
# File 'lib/fomantic-ui-sass.rb', line 34

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

.fonts_pathObject



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

def fonts_path
  File.join(assets_path, 'fonts')
end

.gem_pathObject

Paths



26
27
28
# File 'lib/fomantic-ui-sass.rb', line 26

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

.images_pathObject



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

def images_path
  File.join(assets_path, 'images')
end

.javascripts_pathObject



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

def javascripts_path
  File.join(assets_path, 'javascripts')
end

.load!Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fomantic-ui-sass.rb', line 8

def load!
  if defined?(::Rails)
    require 'fomantic/ui/sass/engine'
  elsif defined?(::Compass)
    ::Compass::Frameworks.register('fomantic-ui', path: base, stylesheets_directory: stylesheets_path, templates_directory: templates_path)
  elsif defined?(::Sprockets)
    Sprockets.append_path(stylesheets_path)
    Sprockets.append_path(fonts_path)
    Sprockets.append_path(images_path)
    Sprockets.append_path(javascripts_path)
  end

  unless defined?(::Rails) || defined?(::Compass) || defined?(::Sprockets)
    raise Fomantic::Ui::Sass::FrameworkNotFound, 'fomantic-ui-sass requires either Rails > 3.1 or Compass, or Sprockets, none of which are loaded'
  end
end

.stylesheets_pathObject



50
51
52
# File 'lib/fomantic-ui-sass.rb', line 50

def stylesheets_path
  File.join(assets_path, 'stylesheets')
end

.templates_pathObject



30
31
32
# File 'lib/fomantic-ui-sass.rb', line 30

def templates_path
  File.join(gem_path, 'templates')
end