Module: FontAwesome::Free

Defined in:
lib/fontawesome/free.rb,
lib/fontawesome/free/version.rb

Overview

Defines technology group types and accessors for them

Defined Under Namespace

Classes: UnknownTechTypeError

Constant Summary collapse

ROOT =

The root directory of all of the FontAwesome files

Pathname.new(__dir__) / 'font-awesome-src' / 'js-packages' / '@fortawesome' / 'fontawesome-free'
TYPES =

List of known technology types

%i[css js less scss sprites svgs webfonts].freeze
VERSION =

First three should match the FA version, last version number is for patches to the gem wrapper

'6.4.2.1'

Class Method Summary collapse

Class Method Details

.source_path(type) ⇒ String Also known as: []

Retrieves the path to the files for the given technology type.

Parameters:

  • type (Symbol)
    • One of the types defined in TYPES

Returns:

  • (String)

    the path to files for that tech



20
21
22
23
24
25
26
27
28
29
# File 'lib/fontawesome/free.rb', line 20

def self.source_path(type)
   unless TYPES.include? type
      raise UnknownTechTypeError,
            "Unknown FontAwesome group #{ type }. Must be one of: #{ TYPES.join(', ') }"
   end

   directory = ROOT / type.to_s

   directory.cleanpath.to_s
end