Module: Luda
- Defined in:
- lib/luda.rb,
lib/luda/config.rb,
lib/luda/engine.rb,
lib/luda/version.rb
Defined Under Namespace
Modules: Rails
Constant Summary collapse
- SASS_PRECISION =
6- VERSION =
'0.3.3'
Class Method Summary collapse
- .assets_path ⇒ Object
-
.gem_path ⇒ Object
Paths.
- .hanami? ⇒ Boolean
- .javascripts_path ⇒ Object
- .load! ⇒ Object
- .rails? ⇒ Boolean
-
.sprockets? ⇒ Boolean
Environment detection helpers.
- .stylesheets_path ⇒ Object
Class Method Details
.assets_path ⇒ Object
44 45 46 |
# File 'lib/luda.rb', line 44 def assets_path @assets_path ||= File.join gem_path, 'assets' end |
.gem_path ⇒ Object
Paths
32 33 34 |
# File 'lib/luda.rb', line 32 def gem_path @gem_path ||= File. '..', File.dirname(__FILE__) end |
.hanami? ⇒ Boolean
57 58 59 |
# File 'lib/luda.rb', line 57 def hanami? defined?(::Hanami) end |
.javascripts_path ⇒ Object
40 41 42 |
# File 'lib/luda.rb', line 40 def javascripts_path File.join assets_path, 'javascripts' end |
.load! ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/luda.rb', line 8 def load! if rails? register_rails_engine elsif hanami? register_hanami elsif sprockets? register_sprockets elsif defined?(::SassC) && ::SassC.respond_to?(:load_paths) ::SassC.load_paths << stylesheets_path elsif defined?(::Sass) && ::Sass.respond_to?(:load_paths) # The deprecated `sass` gem: ::Sass.load_paths << stylesheets_path end if defined?(::SassC::Script::Value::Number) ::SassC::Script::Value::Number.precision = [Luda::SASS_PRECISION, ::SassC::Script::Value::Number.precision].max end if defined?(::Sass::Script::Value::Number) ::Sass::Script::Value::Number.precision = [Luda::SASS_PRECISION, ::Sass::Script::Value::Number.precision].max end end |
.rails? ⇒ Boolean
53 54 55 |
# File 'lib/luda.rb', line 53 def rails? defined?(::Rails) end |
.sprockets? ⇒ Boolean
Environment detection helpers
49 50 51 |
# File 'lib/luda.rb', line 49 def sprockets? defined?(::Sprockets) end |
.stylesheets_path ⇒ Object
36 37 38 |
# File 'lib/luda.rb', line 36 def stylesheets_path File.join assets_path, 'stylesheets' end |