Module: Chroma

Defined in:
lib/chroma-js.rb,
lib/chroma-js/engine.rb,
lib/chroma-js/version.rb

Defined Under Namespace

Modules: Rails

Constant Summary collapse

VERSION =
'1.0.7'
CHROMA_SHA =
'65c0852b050b58147cff5de5157f061bdabf2bc4'

Class Method Summary collapse

Class Method Details

.assets_pathObject



22
23
24
# File 'lib/chroma-js.rb', line 22

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

.gem_pathObject

Paths



14
15
16
# File 'lib/chroma-js.rb', line 14

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

.javascripts_pathObject



18
19
20
# File 'lib/chroma-js.rb', line 18

def javascripts_path
  File.join assets_path, 'javascripts'
end

.load!Object

Based on bootstrap-sass



5
6
7
8
9
10
11
# File 'lib/chroma-js.rb', line 5

def load!
  if rails?
    register_rails_engine
  elsif sprockets?
    register_sprockets
  end
end

.rails?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/chroma-js.rb', line 31

def rails?
  defined?(::Rails)
end

.sprockets?Boolean

Environment detection helpers

Returns:

  • (Boolean)


27
28
29
# File 'lib/chroma-js.rb', line 27

def sprockets?
  defined?(::Sprockets)
end