module FontAwesome::Sass

Constants

VERSION

Public Class Methods

assets_path() click to toggle source
# File lib/font-awesome-sass.rb, line 29
def assets_path
  @assets_path ||= File.join(gem_path, 'assets')
end
compass?() click to toggle source
# File lib/font-awesome-sass.rb, line 37
def compass?
  defined?(::Compass::Frameworks)
end
deprecated_sass?() click to toggle source
# File lib/font-awesome-sass.rb, line 45
def deprecated_sass?
  # The deprecated `sass` gem:
  defined?(::Sass) && ::Sass.respond_to?(:load_paths)
end
fonts_path() click to toggle source
# File lib/font-awesome-sass.rb, line 25
def fonts_path
  File.join(assets_path, 'fonts')
end
gem_path() click to toggle source

Paths

# File lib/font-awesome-sass.rb, line 17
def gem_path
  @gem_path ||= File.expand_path('..', File.dirname(__FILE__))
end
load!() click to toggle source
# File lib/font-awesome-sass.rb, line 4
def load!
  if rails?
    register_rails_engine
  elsif sprockets?
    register_sprockets
  elsif compass?
    register_compass_extension
  elsif deprecated_sass?
    ::Sass.load_paths << stylesheets_path
  end
end
rails?() click to toggle source
# File lib/font-awesome-sass.rb, line 41
def rails?
  defined?(::Rails)
end
sprockets?() click to toggle source
# File lib/font-awesome-sass.rb, line 33
def sprockets?
  defined?(::Sprockets)
end
stylesheets_path() click to toggle source
# File lib/font-awesome-sass.rb, line 21
def stylesheets_path
  File.join(assets_path, 'stylesheets')
end

Private Class Methods

register_compass_extension() click to toggle source
# File lib/font-awesome-sass.rb, line 52
def register_compass_extension
  require 'font_awesome/sass/version'

  ::Compass::Frameworks.register(
    'font-awesome',
    :version               => FontAwesome::Sass::VERSION,
    :path                  => gem_path,
    :stylesheets_directory => stylesheets_path,
    :templates_directory   => File.join(gem_path, 'templates')
  )
end
register_rails_engine() click to toggle source
# File lib/font-awesome-sass.rb, line 64
def register_rails_engine
  require 'sass-rails'
  require 'font_awesome/sass/rails/engine'
  require 'font_awesome/sass/rails/railtie'
end
register_sprockets() click to toggle source
# File lib/font-awesome-sass.rb, line 70
def register_sprockets
  Sprockets.append_path(stylesheets_path)
  Sprockets.append_path(fonts_path)
end