Skip to content

Commit

Permalink
Merge pull request maccman#3 from josephholsten/master
Browse files Browse the repository at this point in the history
Add ECO template support
  • Loading branch information
maccman committed Jan 25, 2012
2 parents 298cd3b + bb9b9c8 commit 7faa533
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/stitch/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ def compile(filename)
require "stitch/compilers/javascript"
require "stitch/compilers/coffeescript"
require "stitch/compilers/tmpl"
require "stitch/compilers/mustache"
require "stitch/compilers/mustache"
require "stitch/compiler/eco"
19 changes: 19 additions & 0 deletions lib/stitch/compilers/eco.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Stitch
class EcoCompiler < Compiler
extensions :eco

enabled begin
require "eco"
true
rescue LoadError
false
end

source true

def compile(path)
source = File.read(path)
%{module.exports = #{Eco.compile(source)}}
end
end
end

0 comments on commit 7faa533

Please sign in to comment.