Module: Undraw
- Defined in:
- lib/undraw.rb,
lib/undraw/engine.rb,
lib/undraw/helper.rb,
lib/undraw/version.rb
Defined Under Namespace
Modules: Helper
Classes: Engine, FileNotFound
Constant Summary
collapse
- VERSION =
"0.3.5"
Class Method Summary
collapse
Class Method Details
.assets_path ⇒ Object
22
23
24
|
# File 'lib/undraw.rb', line 22
def assets_path
@assets_path ||= File.join gem_path, 'vendor/assets'
end
|
.gem_path ⇒ Object
18
19
20
|
# File 'lib/undraw.rb', line 18
def gem_path
@gem_path ||= File.expand_path '..', File.dirname(__FILE__)
end
|
.load! ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/undraw.rb', line 5
def load!
if rails?
register_rails_engine
elsif sprockets?
register_sprockets
end
end
|
.rails? ⇒ Boolean
31
32
33
|
# File 'lib/undraw.rb', line 31
def rails?
defined?(::Rails)
end
|
.root ⇒ Object
13
14
15
|
# File 'lib/undraw.rb', line 13
def root
File.dirname __dir__
end
|
.sprockets? ⇒ Boolean
Environment detection helpers
27
28
29
|
# File 'lib/undraw.rb', line 27
def sprockets?
defined?(::Sprockets)
end
|