Module: Luckysheet
- Defined in:
- lib/luckysheet-sass.rb,
lib/luckysheet-sass/engine.rb,
lib/luckysheet-sass/version.rb
Defined Under Namespace
Modules: Rails
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
- .assets_path ⇒ Object
- .compass? ⇒ Boolean
- .fonts_path ⇒ Object
-
.gem_path ⇒ Object
Paths.
- .hanami? ⇒ Boolean
- .images_path ⇒ Object
- .javascripts_path ⇒ Object
-
.load! ⇒ Object
Inspired by Kaminari.
- .rails? ⇒ Boolean
-
.sprockets? ⇒ Boolean
Environment detection helpers.
- .stylesheets_path ⇒ Object
Class Method Details
.assets_path ⇒ Object
45 46 47 |
# File 'lib/luckysheet-sass.rb', line 45 def assets_path @assets_path ||= File.join gem_path, 'assets' end |
.compass? ⇒ Boolean
54 55 56 |
# File 'lib/luckysheet-sass.rb', line 54 def compass? defined?(::Compass::Frameworks) end |
.fonts_path ⇒ Object
34 35 36 |
# File 'lib/luckysheet-sass.rb', line 34 def fonts_path File.join assets_path, 'fonts' end |
.gem_path ⇒ Object
Paths
26 27 28 |
# File 'lib/luckysheet-sass.rb', line 26 def gem_path @gem_path ||= File. '..', File.dirname(__FILE__) end |
.hanami? ⇒ Boolean
62 63 64 |
# File 'lib/luckysheet-sass.rb', line 62 def hanami? defined?(::Hanami) end |
.images_path ⇒ Object
37 38 39 |
# File 'lib/luckysheet-sass.rb', line 37 def images_path File.join assets_path, 'images' end |
.javascripts_path ⇒ Object
41 42 43 |
# File 'lib/luckysheet-sass.rb', line 41 def javascripts_path File.join assets_path, 'javascripts' end |
.load! ⇒ Object
Inspired by Kaminari
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/luckysheet-sass.rb', line 6 def load! register_compass_extension if compass? if rails? register_rails_engine elsif hanami? register_hanami elsif sprockets? register_sprockets elsif defined?(::Sass) && ::Sass.respond_to?(:load_paths) # The deprecated `sass` gem: ::Sass.load_paths << stylesheets_path end if defined?(::Sass::Script::Value::Number) ::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max end end |
.rails? ⇒ Boolean
58 59 60 |
# File 'lib/luckysheet-sass.rb', line 58 def rails? defined?(::Rails) end |
.sprockets? ⇒ Boolean
Environment detection helpers
50 51 52 |
# File 'lib/luckysheet-sass.rb', line 50 def sprockets? defined?(::Sprockets) end |
.stylesheets_path ⇒ Object
30 31 32 |
# File 'lib/luckysheet-sass.rb', line 30 def stylesheets_path File.join assets_path, 'stylesheets' end |