kfaustino / binged

A Ruby wrapper for the Bing API
http://kfaustino.github.com/binged/
MIT License
21 stars 8 forks source link

Fix for undefined method `to_params' for Hash #2

Closed paulspringett closed 12 years ago

paulspringett commented 12 years ago

Running Ruby 1.9.3 with Rails 3.1.3, the following exception occurs:

> binged = Binged::Client.new(:api_key => KEY)
 => #<Binged::Client:0x000001029a5a80 @api_key="XXXX"> 
> binged.image.containing('Yukihiro Matsumoto').portrait.wide.each {|image| pp image}
NoMethodError: undefined method `to_params' for #<Hash:0x000001028d6a78>
    from /Users/paul/.rvm/gems/ruby-1.9.3-p0/gems/binged-0.3.0/lib/binged/search/base.rb:57:in `perform'

I couldn't find where to_params was defined - a bit of googling suggested it was from an old version of Active Support? I've added a dependency for activesupport >= 3.0.0 and fixed the to_params method call to the new to_param version.

Also fixed a Ruby 1.9 string encoding mismatch issue with an ellipsis char.