Permalink
Browse files

in Ruby 1.8.7 arity of method to_xs is 0 - in 1.9.2 it takes encoding

  • Loading branch information...
1 parent a1d41f1 commit 4c4b69e2155db5f4eb6464e6f1a797d8d6f302dd @elisehuard elisehuard committed with thbar Nov 11, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/builder/xmlbase.rb
View
@@ -132,7 +132,11 @@ def _escape(text)
end
else
def _escape(text)
- text.to_xs((@encoding != 'utf-8' or $KCODE != 'UTF8'))
+ if (text.method(:to_xs).arity == 0)
+ text.to_xs
+ else
+ text.to_xs((@encoding != 'utf-8' or $KCODE != 'UTF8'))
+ end
end
end

0 comments on commit 4c4b69e

Please sign in to comment.