Module: AssetBox
- Defined in:
- lib/asset_box.rb,
lib/asset_box/version.rb,
lib/asset_box/rails/engine.rb,
lib/asset_box/rails/helpers.rb,
lib/asset_box/rails/railtie.rb
Defined Under Namespace
Modules: Rails
Classes: Error
Constant Summary
collapse
- VERSION =
"0.1.0"
Class Method Summary
collapse
Class Method Details
.assets_path ⇒ Object
50
51
52
|
# File 'lib/asset_box.rb', line 50
def assets_path
@assets_path ||= File.join(gem_path, 'assets')
end
|
.compass? ⇒ Boolean
30
31
32
|
# File 'lib/asset_box.rb', line 30
def compass?
defined?(::Compass::Frameworks)
end
|
.fonts_path ⇒ Object
42
43
44
|
# File 'lib/asset_box.rb', line 42
def fonts_path
File.join(assets_path, 'fonts')
end
|
.gem_path ⇒ Object
54
55
56
|
# File 'lib/asset_box.rb', line 54
def gem_path
@gem_path ||= File.expand_path('..', File.dirname(__FILE__))
end
|
.hanami? ⇒ Boolean
58
59
60
|
# File 'lib/asset_box.rb', line 58
def hanami?
defined?(::Hanami)
end
|
.images_path ⇒ Object
46
47
48
|
# File 'lib/asset_box.rb', line 46
def images_path
File.join(assets_path, 'images')
end
|
.load! ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/asset_box.rb', line 7
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)
::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
34
35
36
|
# File 'lib/asset_box.rb', line 34
def rails?
defined?(::Rails)
end
|
.sprockets? ⇒ Boolean
26
27
28
|
# File 'lib/asset_box.rb', line 26
def sprockets?
defined?(::Sprockets)
end
|
.stylesheets_path ⇒ Object
38
39
40
|
# File 'lib/asset_box.rb', line 38
def stylesheets_path
File.join(assets_path, 'stylesheets')
end
|