addthis icon indicating copy to clipboard operation
addthis copied to clipboard

addthis_feed_button error

Open addame opened this issue 14 years ago • 0 comments

Whenever I make a call to addthis_feed_button in ruby 1.9.1, I'm getting errors. For example, with this : <%= addthis_feed_button("http://www.example.com/")%> I'm getting : invalid value for Integer: ":"

C:/Ruby19/lib/ruby/gems/1.9.1/gems/jaap3-addthis-0.8.0/lib/addthis.rb:44:in sprintf' C:/Ruby19/lib/ruby/gems/1.9.1/gems/jaap3-addthis-0.8.0/lib/addthis.rb:44:inblock in addthis_feed_button' C:/Ruby19/lib/ruby/gems/1.9.1/gems/jaap3-addthis-0.8.0/lib/addthis.rb:44:in gsub' C:/Ruby19/lib/ruby/gems/1.9.1/gems/jaap3-addthis-0.8.0/lib/addthis.rb:44:inaddthis_feed_button'

The problem is related to the way that ruby 1.9 is handling Strings#[]. The solution for ruby 1.9 is to use c[0].ord instead of c[0] in line 44 of addthis.rb

Mehdi

addame avatar May 27 '10 21:05 addame