Sha256: 0264728086201332603455c41a21a7545dd412e6e89a10a0bfd464fa77080c02
Contents?: true
Size: 614 Bytes
Versions: 27
Compression:
Stored size: 614 Bytes
Contents
module Knitkit class SyntaxValidator class << self def validate_content(file_type, content) case file_type.to_sym when :erb validate_erb(content) else return nil end end def validate_file(file) #stubbed for later development end private def validate_erb(contents) begin ActionView::Template::Handlers::Erubis.new(contents).result rescue SyntaxError=>ex ex.message rescue Exception=>ex nil end end end end#SyntaxValidator end#Knitkit
Version data entries
27 entries across 27 versions & 1 rubygems