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_pathObject



31
32
33
# File 'lib/undraw.rb', line 31

def assets_path
  @assets_path ||= File.join gem_path, 'vendor/assets'
end

.gem_pathObject

Paths



19
20
21
# File 'lib/undraw.rb', line 19

def gem_path
  @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
end

.javascripts_pathObject



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

Returns:

  • (Boolean)


40
41
42
# File 'lib/undraw.rb', line 40

def rails?
  defined?(::Rails)
end

.rootObject



14
15
16
# File 'lib/undraw.rb', line 14

def root
  File.dirname __dir__
end

.sprockets?Boolean

Environment detection helpers

Returns:

  • (Boolean)


36
37
38
# File 'lib/undraw.rb', line 36

def sprockets?
  defined?(::Sprockets)
end

.stylesheets_pathObject



23
24
25
# File 'lib/undraw.rb', line 23

def stylesheets_path
  File.join assets_path, 'stylesheets'
end