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.8.7'.freeze
SEMANTIC_UI_SHA =
'5b3969cc46bd1e1da1f59b2f5a05098fa5053d2a'.freeze

Class Method Summary collapse

Class Method Details

.assets_pathObject



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

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

.configure_sassObject



53
54
55
56
# File 'lib/fomantic-ui-sass.rb', line 53

def configure_sass
  require 'sassc'
  ::SassC.load_paths << stylesheets_path
end

.fonts_pathObject



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

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

.gem_pathObject

Paths



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

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

.images_pathObject



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

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

.javascripts_pathObject



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

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

.load!Object



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

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

  configure_sass
  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



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

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

.templates_pathObject



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

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