dewski / itunes

A Ruby wrapper around the iTunes API that lets you search for any sort of data that is available on the iTunes store.
http://github.com/dewski/itunes
MIT License
122 stars 29 forks source link

Returns HTTParty::Response #8

Closed masterkain closed 12 years ago

masterkain commented 12 years ago

Hello, I started to see this:

1.9.3p125 :004 > ITunes.music("immortal blizzard beasts").results
NoMethodError: undefined method `results' for #<HTTParty::Response:0x007f922a626bf0>

Hints?

itunes (0.3.0)
httparty (0.8.1)
masterkain commented 12 years ago

Probably this is related to the multi_json upgrade to 1.1.0, not sure.

masterkain commented 12 years ago

bundler decided to downgrade to 0.3.0 due to the multi_json dep:

    itunes (0.3.0)
      httparty

Enforcing itunes to the current version it's ok, but perhaps we should loosen the dep on multi_json with a '~> 1.0' like many gems do.

dewski commented 12 years ago

In version 0.3.0 the API was the following:

songs = ITunes.music('immortal blizzard beasts')
songs['results'].each do |song|
  puts "#{song['trackName']} - #{song['artistName']} (#{song['collectionName']})"
end

Have you just started using the results method on the results, or did you grab that from the current readme? As I am not sure that was ever supported through HTTParty. You may want to upgrade to 0.5.3 which would allow you to use what you have above. We will have to do a better job with version numbers for API changes like this.

masterkain commented 12 years ago

Yeah, my previous comment states that it was bundler's 'fault' for downgrading itunes due to the multi_json dep :)

dewski commented 12 years ago

Ah shoot, you commented juuust before I did. I'll push up a new gem version in a few with the dependency change.

masterkain commented 12 years ago

Awesome, thanks.

dewski commented 12 years ago

Released 0.5.4