Module: BedrockSass

Defined in:
lib/bedrock_sass.rb,
lib/bedrock_sass/engine.rb,
lib/bedrock_sass/version.rb

Defined Under Namespace

Classes: Engine

Constant Summary collapse

VERSION =
'0.2.2'

Class Method Summary collapse

Class Method Details

.ace_pathObject



47
48
49
# File 'lib/bedrock_sass.rb', line 47

def ace_path
  @ace_path ||= File.join(vendor_path, 'ace')
end

.assets_pathObject



27
28
29
# File 'lib/bedrock_sass.rb', line 27

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

.assets_pathsObject



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/bedrock_sass.rb', line 55

def assets_paths
  @assets_paths ||= [
    tinymce_path,
    ace_path,
    motion_ui_path,
    foundation_path,
    yoastseo_path,
    stylesheets_path,
    javascripts_path
  ]
end

.deprecated_sass?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/bedrock_sass.rb', line 84

def deprecated_sass?
  defined?(::Sass) && ::Sass.respond_to?(:load_paths)
end

.foundation_pathObject



35
36
37
# File 'lib/bedrock_sass.rb', line 35

def foundation_path
  @foundation_path ||= File.join(vendor_path, 'foundation', 'scss')
end

.gem_pathObject



15
16
17
# File 'lib/bedrock_sass.rb', line 15

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

.javascripts_pathObject



23
24
25
# File 'lib/bedrock_sass.rb', line 23

def javascripts_path
  File.join(assets_path, 'bedrock', 'js')
end

.load!Object



5
6
7
8
9
10
11
12
13
# File 'lib/bedrock_sass.rb', line 5

def load!
  if rails?
    register_rails_engine
  elsif sprockets?
    register_sprockets
  elsif deprecated_sass?
    register_deprecated_sass
  end
end

.motion_ui_pathObject



39
40
41
# File 'lib/bedrock_sass.rb', line 39

def motion_ui_path
  @motion_ui_path ||= File.join(vendor_path, 'motion-ui')
end

.rails?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/bedrock_sass.rb', line 80

def rails?
  defined?(::Rails)
end

.sprockets?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/bedrock_sass.rb', line 76

def sprockets?
  defined?(::Sprockets)
end

.styles_pathsObject



67
68
69
70
71
72
73
74
# File 'lib/bedrock_sass.rb', line 67

def styles_paths
  @styles_paths ||= [
    motion_ui_path,
    yoastseo_path,
    foundation_path,
    stylesheets_path
  ]
end

.stylesheets_pathObject



19
20
21
# File 'lib/bedrock_sass.rb', line 19

def stylesheets_path
  File.join(assets_path, 'bedrock', 'scss')
end

.tinymce_pathObject



43
44
45
# File 'lib/bedrock_sass.rb', line 43

def tinymce_path
  @tinymce_path ||= File.join(vendor_path, 'tinymce')
end

.vendor_pathObject



31
32
33
# File 'lib/bedrock_sass.rb', line 31

def vendor_path
  @vendor_path ||= File.join(assets_path, '_vendor')
end

.yoastseo_pathObject



51
52
53
# File 'lib/bedrock_sass.rb', line 51

def yoastseo_path
  @yoastseo_path ||= File.join(vendor_path, 'yoastseo', 'css')
end