Module: Semantic::Ui::Sass

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

Defined Under Namespace

Modules: BreadCrumbs, Rails Classes: FrameworkNotFound

Constant Summary collapse

VERSION =
"2.4.2.0"
SEMANTIC_UI_SHA =
'3989d7243c514f9018a55eb53cb34daf3bbf5a26'

Class Method Summary collapse

Class Method Details

.assets_pathObject



33
34
35
# File 'lib/semantic-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/semantic-ui-sass.rb', line 53

def configure_sass
  require 'sass'
  ::Sass.load_paths << stylesheets_path
end

.fonts_pathObject



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

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

.gem_pathObject

Paths



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

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

.images_pathObject



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

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

.javascripts_pathObject



45
46
47
# File 'lib/semantic-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/semantic-ui-sass.rb', line 6

def load!
  if defined?(::Rails)
    require 'semantic/ui/sass/engine'
  elsif defined?(::Compass)
    ::Compass::Frameworks.register('semantic-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
  if !(defined?(::Rails) || defined?(::Compass) || defined?(::Sprockets))
    raise Semantic::Ui::Sass::FrameworkNotFound, "semantic-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/semantic-ui-sass.rb', line 49

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

.templates_pathObject



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

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