Skip to content
This repository was archived by the owner on Jan 6, 2022. It is now read-only.
This repository was archived by the owner on Jan 6, 2022. It is now read-only.

addthis_feed_button error #1

@addame

Description

@addame

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions