Permalink
Browse files

attempt to gracefully fail without coffee script

  • Loading branch information...
1 parent 94dbfab commit 286e851f6abe716a585128172b0a339d9f16c2ff @saturnflyer committed Feb 26, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 lib/coffee_filter.rb
View
@@ -1,6 +1,11 @@
-require 'coffee_script'
-class CoffeeFilter < TextFilter
- def filter(text)
- CoffeeScript.compile text
+begin
+ require 'coffee_script'
+ class CoffeeFilter < TextFilter
+ def filter(text)
+ CoffeeScript.compile text
+ end
end
+rescue ExecJS::RuntimeUnavailable
+ Rails.logger.warn "There is no support for CoffeeScript"
+ class CoffeeFilter;end
end

0 comments on commit 286e851

Please sign in to comment.