Module: Patternfly

Defined in:
lib/patternfly-sass.rb,
lib/patternfly-sass/engine.rb,
lib/patternfly-sass/version.rb

Defined Under Namespace

Modules: Rails

Constant Summary collapse

VERSION =
'3.54.8'

Class Method Summary collapse

Class Method Details

.assets_pathObject



38
39
40
# File 'lib/patternfly-sass.rb', line 38

def assets_path
  @assets_path ||= File.join gem_path, 'dist'
end

.compass?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/patternfly-sass.rb', line 47

def compass?
  defined?(::Compass)
end

.fonts_pathObject



26
27
28
# File 'lib/patternfly-sass.rb', line 26

def fonts_path
  File.join assets_path, 'fonts'
end

.gem_pathObject

Paths



18
19
20
# File 'lib/patternfly-sass.rb', line 18

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

.images_pathObject



34
35
36
# File 'lib/patternfly-sass.rb', line 34

def images_path
  File.join assets_path, 'img'
end

.javascripts_pathObject



30
31
32
# File 'lib/patternfly-sass.rb', line 30

def javascripts_path
  File.join assets_path, 'js'
end

.load!Object

Inspired by Kaminari



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/patternfly-sass.rb', line 5

def load!
  register_compass_extension if compass?

  if rails?
    register_rails_engine
  elsif sprockets?
    register_sprockets
  end

  configure_sass
end

.rails?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/patternfly-sass.rb', line 51

def rails?
  defined?(::Rails)
end

.sprockets?Boolean

Environment detection helpers

Returns:

  • (Boolean)


43
44
45
# File 'lib/patternfly-sass.rb', line 43

def sprockets?
  defined?(::Sprockets)
end

.stylesheets_pathObject



22
23
24
# File 'lib/patternfly-sass.rb', line 22

def stylesheets_path
  File.join assets_path, 'sass'
end