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 964c689 commit 53582a84556102b4d81f144f8c6a28cf9157516d @elisehuard committed 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

4 comments on commit 53582a8

Thx for fix.

Thanks!

Thank you

Thanxxx man!!!! its saved my time... :-)

Please sign in to comment.