module HamlCoffeeAssets

Main Haml Coffee Assets module with its configuration settings.

Haml Coffee Assets main module

Constants

VERSION

Public Class Methods

config() click to toggle source

Get the Haml Coffee Assets configuration

@return [HamlCoffeeAssets::Configuration] the configuration object

# File lib/haml_coffee_assets/configuration.rb, line 7
def self.config
  @config ||= ::HamlCoffeeAssets::Configuration.new
end
helpers(compile=true) click to toggle source

Get the Haml Coffee Assets helper file

@param [Boolean] compile whether to compile the CS helpers or not @return [String] the helpers content

# File lib/haml_coffee_assets.rb, line 47
def self.helpers(compile=true)
  require 'erb'

  content = File.read(HamlCoffeeAssets.helpers_path)
  script = ERB.new(content).result(binding)

  if compile
    require 'coffee-script'
    script = CoffeeScript.compile(script)
  end

  script << GlobalContext.to_s if defined?(Rails)
  script
end
helpers_path() click to toggle source

Get the path to the ‘hamlcoffee.js.coffee.erb` helper file.

@return [String] the absolute path to the helpers file

# File lib/haml_coffee_assets.rb, line 38
def self.helpers_path
  File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', 'assets', 'javascripts', 'hamlcoffee.js.coffee.erb'))
end