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.1"
Class Method Summary
collapse
Class Method Details
.assets_path ⇒ Object
31
32
33
|
# File 'lib/undraw.rb', line 31
def assets_path
@assets_path ||= File.join gem_path, 'vendor/assets'
end
|
.gem_path ⇒ Object
19
20
21
|
# File 'lib/undraw.rb', line 19
def gem_path
@gem_path ||= File.expand_path '..', File.dirname(__FILE__)
end
|
.javascripts_path ⇒ Object
27
28
29
|
# File 'lib/undraw.rb', line 27
def javascripts_path
File.join assets_path, 'javascripts'
end
|
.load! ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/undraw.rb', line 6
def load!
if rails?
register_rails_engine
elsif sprockets?
register_sprockets
end
end
|
.rails? ⇒ Boolean
40
41
42
|
# File 'lib/undraw.rb', line 40
def rails?
defined?(::Rails)
end
|
.root ⇒ Object
14
15
16
|
# File 'lib/undraw.rb', line 14
def root
File.dirname __dir__
end
|
.sprockets? ⇒ Boolean
Environment detection helpers
36
37
38
|
# File 'lib/undraw.rb', line 36
def sprockets?
defined?(::Sprockets)
end
|
.stylesheets_path ⇒ Object
23
24
25
|
# File 'lib/undraw.rb', line 23
def stylesheets_path
File.join assets_path, 'stylesheets'
end
|