Browse files

Silence some warnings appearing in rspec

  • Loading branch information...
1 parent 1afcc37 commit 0759b4fdec1a1ea6ba157e865d0f0c85e53bc2ee @jeady jeady committed Sep 22, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 config/initializers/erb_hotfix.rb
View
14 config/initializers/erb_hotfix.rb
@@ -0,0 +1,14 @@
+class ERB
+ module Util
+ def html_escape(s)
+ silence_warnings {
+ s = s.to_s
+ if s.html_safe?
+ s
+ else
+ s.gsub(/[&"'><]/n) { |special| HTML_ESCAPE[special] }.html_safe
+ end
+ }
+ end
+ end
+end

0 comments on commit 0759b4f

Please sign in to comment.