Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fixes and some enhancements #6

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Bug Fixes and some enhancements #6

wants to merge 12 commits into from

Conversation

revans
Copy link

@revans revans commented Apr 27, 2011

OK, sorry about last pull request that I cancelled. This one works. :)

So, here's what I have done:

  • Changed require's in simple_geo.rb to use autoload for lazy loading of classes
  • Moved the URI.escaping to a method, instead of each method implementing it. DRY.
  • It seems right now, string hash keys are the way to go. However, when escaping the category key, it was looking for a symbol. So, it would never be properly escaped. When I get more time, I'll make the changes necessary so the hash keys can either be a string or symbol (symbols would be preferred).
  • The search query was not being escaped, so if you sent more than 1 word, it would blow up. The query is not being properly escaped.
  • I've added the blank? method to the Object class for easy checking of nil? or an empty string.

Thoughts?

@bobanj
Copy link

bobanj commented Jun 2, 2011

I'm using ruby 1.9.2 and having some problems with simplegeo gem
The example from simplegeo ruby page does not seam to work. After adding the credentials key, secret
I use CGI::escape instead of URI.escape for the example below.

results = SimpleGeo::Client.get_places_by_address("121 N La Salle St, Chicago, IL 60602", {'category' => 'Restaurant', 'type' => CGI::escape('Food & Drink'), 'radius' => 20})

Also I get no results back if I pass a q parameter for searching
results = SimpleGeo::Client.get_places_by_address("121 N La Salle St, Chicago, IL 60602", {'category' => 'Restaurant', 'type' => CGI::escape('Food & Drink'), 'radius' => '20', 'q' => CGI::escape('El Circo Cheapo Cabaret')})

where "El Circo Cheapo Cabaret" is the name of some restaurant that I get from getting results without the q argument.
Also I get no results if the q argument is empty.

Any fixes about this in near future?
Thank you in advance for the reply.

@revans
Copy link
Author

revans commented Jun 3, 2011

This patch has not been pulled in. You can try using my fork: https://github.com/codewranglers/simplegeo-ruby

@bobanj
Copy link

bobanj commented Jun 6, 2011

I get the same results - no results when using the q parameter
inside my Gemfile
gem 'simplegeo', :git => "git://github.com/codewranglers/simplegeo-ruby.git"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants