Module: HamlCoffeeAssets
- Defined in:
- lib/haml_coffee_assets.rb,
lib/haml_coffee_assets/version.rb,
lib/haml_coffee_assets/compiler.rb,
lib/haml_coffee_assets/rails/engine.rb,
lib/haml_coffee_assets/configuration.rb,
lib/haml_coffee_assets/action_view/resolver.rb,
lib/haml_coffee_assets/tilt/template_handler.rb,
lib/haml_coffee_assets/action_view/template_handler.rb
Overview
Haml Coffee Assets main module
Defined Under Namespace
Modules: ActionView, Compiler, Rails, Tilt Classes: Configuration
Constant Summary collapse
- VERSION =
'1.12.0'
Class Method Summary collapse
-
.config ⇒ HamlCoffeeAssets::Configuration
Get the Haml Coffee Assets configuration.
-
.helpers(compile = true) ⇒ String
Get the Haml Coffee Assets helper file.
-
.helpers_path ⇒ String
Get the path to the ‘hamlcoffee.js.coffee.erb` helper file.
Class Method Details
.config ⇒ HamlCoffeeAssets::Configuration
Get the Haml Coffee Assets configuration
7 8 9 |
# File 'lib/haml_coffee_assets/configuration.rb', line 7 def self.config @config ||= ::HamlCoffeeAssets::Configuration.new end |
.helpers(compile = true) ⇒ String
Get the Haml Coffee Assets helper file
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/haml_coffee_assets.rb', line 41 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 end |
.helpers_path ⇒ String
Get the path to the ‘hamlcoffee.js.coffee.erb` helper file.
32 33 34 |
# File 'lib/haml_coffee_assets.rb', line 32 def self.helpers_path File.(File.join(File.dirname(__FILE__), '..', 'vendor', 'assets', 'javascripts', 'hamlcoffee.js.coffee.erb')) end |