Skip to content

Commit

Permalink
in Ruby 1.8.7 arity of method to_xs is 0 - in 1.9.2 it takes encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
elisehuard committed Nov 11, 2011
1 parent 964c689 commit 53582a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/builder/xmlbase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

4 comments on commit 53582a8

@akwiatkowski
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for fix.

@thbar
Copy link

@thbar thbar commented on 53582a8 Mar 16, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@thomaschriskelly
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@yasirhashmi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.