thegengen/cloudprint

search_all delegates to invalid query

Closed this issue · 4 comments

Calling client.printers.all delegates to client.printers.search_all, which in turn delegates to client.printers.search('all'). This doesn't return any printers, except for the default "Save to Google Docs" (__google__docs). I suggest changing method_missing to exclude "all" from the regexp, and then change def all to be an alias on search

Hi.

Sorry, my GitHub notification settings were set up so that I didn't get an email when you created this ticket. I'll look into this (and most likely make the changes you suggested) tomorrow.

Thanks for reporting it.

No worries. I opened a few more minor issues.

FYI, I'm afraid I'll have to push this back another day; I spent today with the 0.3.0 changes.

I've aliased search_all and delegated all as you've suggested. I've also replaced the method missing magic with explicit method definitions. It might be a bit more verbose, but it's a lot easier to reason about.

Also, I've released v0.3.1 of the gem with these changes.