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/transformer.rb,
lib/haml_coffee_assets/rails/engine.rb,
lib/haml_coffee_assets/configuration.rb,
lib/haml_coffee_assets/global_context.rb,
lib/haml_coffee_assets/action_view/resolver.rb,
lib/haml_coffee_assets/action_view/template_handler.rb
Overview
Haml Coffee Assets main module
Defined Under Namespace
Modules: ActionView, Compiler, Rails Classes: Configuration, GlobalContext, Transformer
Constant Summary collapse
- VERSION =
'1.27.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
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# 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 ⇒ String
Get the path to the ‘hamlcoffee.js.coffee.erb` helper file.
38 39 40 |
# File 'lib/haml_coffee_assets.rb', line 38 def self.helpers_path File.(File.join(File.dirname(__FILE__), '..', 'vendor', 'assets', 'javascripts', 'hamlcoffee.js.coffee.erb')) end |