tmdb_party
tmdb_party copied to clipboard
Updated httparty, rspec, implemented Object#blank?
Hi John,
I've updated your gem so the specs run, blank? doesn't complain anymore and updated httparty which solves the "couldn't parse YAML" error.
Thanks,
Ash.
Hi @ashmckenzie! Just tried out your changes and I get the following stack dump when searching movies:
/home/andrew/.rvm/gems/ruby-1.9.2-p320@tmdb_party_test/bundler/gems/tmdb_party-33dc04d28709/lib/tmdb_party/extras/httparty_icebox.rb:210:in `dump': no marshal_dump is defined for class Proc (TypeError)
from /home/andrew/.rvm/gems/ruby-1.9.2-p320@tmdb_party_test/bundler/gems/tmdb_party-33dc04d28709/lib/tmdb_party/extras/httparty_icebox.rb:210:in `block in set'
from /home/andrew/.rvm/gems/ruby-1.9.2-p320@tmdb_party_test/bundler/gems/tmdb_party-33dc04d28709/lib/tmdb_party/extras/httparty_icebox.rb:210:in `open'
from /home/andrew/.rvm/gems/ruby-1.9.2-p320@tmdb_party_test/bundler/gems/tmdb_party-33dc04d28709/lib/tmdb_party/extras/httparty_icebox.rb:210:in `set'
from /home/andrew/.rvm/gems/ruby-1.9.2-p320@tmdb_party_test/bundler/gems/tmdb_party-33dc04d28709/lib/tmdb_party/extras/httparty_icebox.rb:120:in `set'
from /home/andrew/.rvm/gems/ruby-1.9.2-p320@tmdb_party_test/bundler/gems/tmdb_party-33dc04d28709/lib/tmdb_party/extras/httparty_icebox.rb:93:in `get_with_caching'
from /home/andrew/.rvm/gems/ruby-1.9.2-p320@tmdb_party_test/bundler/gems/tmdb_party-33dc04d28709/lib/tmdb_party/extras/httparty_icebox.rb:101:in `get'
from /home/andrew/.rvm/gems/ruby-1.9.2-p320@tmdb_party_test/bundler/gems/tmdb_party-33dc04d28709/lib/tmdb_party.rb:70:in `handle_response'
from /home/andrew/.rvm/gems/ruby-1.9.2-p320@tmdb_party_test/bundler/gems/tmdb_party-33dc04d28709/lib/tmdb_party.rb:36:in `search_person'
from ./test.rb:8:in `<main>'
I'm using Ruby 1.9.2.
Forgot to mention, if I hack TMDb to cache in memory rather than to disk everything is fine. Here are the gem versions I'm using:
Gems included by the bundle:
* bundler (1.1.3)
* httparty (0.8.3)
* multi_json (1.3.5)
* multi_xml (0.5.1)
* tmdb_party (0.9.0 33dc04d)
Hi Andrew, not sure exactly what's going on there but if you could provide a github link to your code I can take a look. I don't think the error you are seeing above is as a result of my change but am happy to take a look.
#/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
require "tmdb_party"
require "pp"
tmdb = TMDBParty::Base.new('6acf9a0fd5218efe8859413e8ace0aba')
#results = tmdb.search('transformers')
results = tmdb.search_person('tom cruise')
pp results
Ash, I don't think there's anything wrong with your code! :-) I suspect something has changed with httparty recently, so this is mainly just a heads-up. Anyway, considering going my own way with a v3 wrapper based on faraday.
Hi @andrewdsmith
I've had a bit of a look and it's a curly one :( I think you're right, maybe the gemspec should require an older version of httparty ?
Success! Installing v 0.7.8 of httparty and removing the s.add_dependency "httparty", ">= 0.8.1" requirement in the gemspec works correctly :)
Nice work @ashmckenzie! I've decided to scratch my own itch, though, and build something new on the v3 API, using faraday and vcr for testing: https://github.com/andrewdsmith/neo-tmdb. Still early days.