Skip to content

Instantly share code, notes, and snippets.

@tiomoreno
Forked from phaer/coffeescript_converter.rb
Created June 23, 2013 11:58
Show Gist options
  • Save tiomoreno/5844769 to your computer and use it in GitHub Desktop.
Save tiomoreno/5844769 to your computer and use it in GitHub Desktop.
module Jekyll
require 'coffee-script'
class CoffeeScriptConverter < Converter
safe true
priority :normal
def matches(ext)
ext =~ /coffee/i
end
def output_ext(ext)
".js"
end
def convert(content)
begin
CoffeeScript.compile content
rescue StandardError => e
puts "CoffeeScript error:" + e.message
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment