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 =
"6.7.2".freeze

Class Method Summary collapse

Class Method Details

.assets_pathObject



27
28
29
# File 'lib/font-awesome-sass.rb', line 27

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

.deprecated_sass?Boolean

Returns:

  • (Boolean)


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

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

.fonts_pathObject



23
24
25
# File 'lib/font-awesome-sass.rb', line 23

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

.gem_pathObject

Paths



15
16
17
# File 'lib/font-awesome-sass.rb', line 15

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

.load!Object



4
5
6
7
8
9
10
11
12
# File 'lib/font-awesome-sass.rb', line 4

def load!
  if rails?
    register_rails_engine
  elsif sprockets?
    register_sprockets
  elsif deprecated_sass?
    ::Sass.load_paths << stylesheets_path
  end
end

.rails?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/font-awesome-sass.rb', line 35

def rails?
  defined?(::Rails)
end

.sprockets?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/font-awesome-sass.rb', line 31

def sprockets?
  defined?(::Sprockets)
end

.stylesheets_pathObject



19
20
21
# File 'lib/font-awesome-sass.rb', line 19

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