Module: Remixicon
- Defined in:
- lib/remixicon.rb,
lib/remixicon/engine.rb,
lib/remixicon/version.rb
Defined Under Namespace
Modules: Rails
Constant Summary collapse
- VERSION =
'1.2.1'
Class Method Summary collapse
- .assets_path ⇒ Object
- .fonts_path ⇒ Object
-
.gem_path ⇒ Object
Paths.
- .hanami? ⇒ Boolean
-
.load! ⇒ Object
Inspired by Kaminari.
- .rails? ⇒ Boolean
-
.sprockets? ⇒ Boolean
Environment detection helpers.
- .stylesheets_path ⇒ Object
Class Method Details
.assets_path ⇒ Object
38 39 40 |
# File 'lib/remixicon.rb', line 38 def assets_path @assets_path ||= File.join gem_path, 'assets' end |
.fonts_path ⇒ Object
34 35 36 |
# File 'lib/remixicon.rb', line 34 def fonts_path File.join assets_path, 'fonts' end |
.gem_path ⇒ Object
Paths
26 27 28 |
# File 'lib/remixicon.rb', line 26 def gem_path @gem_path ||= File. '..', File.dirname(__FILE__) end |
.hanami? ⇒ Boolean
51 52 53 |
# File 'lib/remixicon.rb', line 51 def hanami? defined?(::Hanami) end |
.load! ⇒ Object
Inspired by Kaminari
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/remixicon.rb', line 8 def load! 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 = [6, ::Sass::Script::Value::Number.precision].max end end |
.rails? ⇒ Boolean
47 48 49 |
# File 'lib/remixicon.rb', line 47 def rails? defined?(::Rails) end |
.sprockets? ⇒ Boolean
Environment detection helpers
43 44 45 |
# File 'lib/remixicon.rb', line 43 def sprockets? defined?(::Sprockets) end |
.stylesheets_path ⇒ Object
30 31 32 |
# File 'lib/remixicon.rb', line 30 def stylesheets_path File.join assets_path, 'stylesheets' end |