7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/ice/handlers/coffeekup/handler.rb', line 7
def self.convert_template(template_text, vars = {})
Base.convert_template(template_text) do |context|
coffeescript_file = "#{File.dirname(__FILE__)}/../../../../js/coffee-script.js"
coffeekup_file = "#{File.dirname(__FILE__)}/../../../../js/coffeekup.js"
context.eval(open(coffeescript_file).read)
context.eval(open(coffeekup_file).read)
coffeekup_helpers_file = "#{File.dirname(__FILE__)}/../../../../js/lib/coffeekup-path-helper.coffee"
combo = open(coffeekup_helpers_file).read + "\n" + template_text.sub(/^(\s)*/, "")
template = context["coffeekup"]["compile"].call(combo)
template.call({context: vars.to_ice})
end
end
|