Module: FontAwesome::Sass

Defined in:
lib/font-awesome-sass.rb,
lib/font_awesome/sass/version.rb,
lib/font_awesome/sass/rails/engine.rb,
lib/font_awesome/sass/rails/helpers.rb,
lib/font_awesome/sass/rails/railtie.rb

Defined Under Namespace

Modules: Rails

Constant Summary collapse

VERSION =
'5.15.1'.freeze

Class Method Summary collapse

Class Method Details

.assets_pathObject


29
30
31
# File 'lib/font-awesome-sass.rb', line 29

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

.compass?Boolean

Returns:

  • (Boolean)

37
38
39
# File 'lib/font-awesome-sass.rb', line 37

def compass?
  defined?(::Compass::Frameworks)
end

.deprecated_sass?Boolean

Returns:

  • (Boolean)

45
46
47
48
# File 'lib/font-awesome-sass.rb', line 45

def deprecated_sass?
  # The deprecated `sass` gem:
  defined?(::Sass) && ::Sass.respond_to?(:load_paths)
end

.fonts_pathObject


25
26
27
# File 'lib/font-awesome-sass.rb', line 25

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

.gem_pathObject

Paths


17
18
19
# File 'lib/font-awesome-sass.rb', line 17

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

.load!Object


4
5
6
7
8
9
10
11
12
13
14
# 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?Boolean

Returns:

  • (Boolean)

41
42
43
# File 'lib/font-awesome-sass.rb', line 41

def rails?
  defined?(::Rails)
end

.sprockets?Boolean

Returns:

  • (Boolean)

33
34
35
# File 'lib/font-awesome-sass.rb', line 33

def sprockets?
  defined?(::Sprockets)
end

.stylesheets_pathObject


21
22
23
# File 'lib/font-awesome-sass.rb', line 21

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