Module: Jade
- Defined in:
- lib/ruby-jade.rb
Class Method Summary collapse
Class Method Details
.compile(template, options = {}) ⇒ Object
22 23 24 25 |
# File 'lib/ruby-jade.rb', line 22 def compile(template, = {}) = {:client => true, :compileDebug => false}.merge() context.call('compile', template, ) end |
.context ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ruby-jade.rb', line 10 def context @context ||= begin ExecJS.compile " var window = {};\n \#{File.read(path)}\n var compile = function (template, options) {\n return window.jade.compile(template, options).toString();\n }\n JS\n end\nend\n" |
.path ⇒ Object
6 7 8 |
# File 'lib/ruby-jade.rb', line 6 def path File. '../ruby-jade/jade.min.js', __FILE__ end |