module Chroma

Constants

CHROMA_SHA
VERSION

Public Class Methods

assets_path() click to toggle source
# File lib/chroma-js.rb, line 22
def assets_path
  @assets_path ||= File.join gem_path, 'assets'
end
gem_path() click to toggle source

Paths

# File lib/chroma-js.rb, line 14
def gem_path
  @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
end
javascripts_path() click to toggle source
# File lib/chroma-js.rb, line 18
def javascripts_path
  File.join assets_path, 'javascripts'
end
load!() click to toggle source

Based on bootstrap-sass

# File lib/chroma-js.rb, line 5
def load!
  if rails?
    register_rails_engine
  elsif sprockets?
    register_sprockets
  end
end
rails?() click to toggle source
# File lib/chroma-js.rb, line 31
def rails?
  defined?(::Rails)
end
sprockets?() click to toggle source

Environment detection helpers

# File lib/chroma-js.rb, line 27
def sprockets?
  defined?(::Sprockets)
end

Private Class Methods

register_rails_engine() click to toggle source
# File lib/chroma-js.rb, line 37
def register_rails_engine
  require 'chroma-js/engine'
end
register_sprockets() click to toggle source
# File lib/chroma-js.rb, line 41
def register_sprockets
  Sprockets.append_path(javascripts_path)
end