Skip to content
Snippets Groups Projects
Commit 776448be authored by Alex Reisner's avatar Alex Reisner
Browse files

Fix bug in CLI's handling of multi-part keys.

parent 0609b275
No related branches found
No related tags found
No related merge requests found
...@@ -13,10 +13,9 @@ module Geocoder ...@@ -13,10 +13,9 @@ module Geocoder
opts.separator "\nOptions: " opts.separator "\nOptions: "
opts.on("-k <key>", "--key <key>", opts.on("-k <key>", "--key <key>",
"Key for geocoding API (optional for most). For Google Premier use 'key client channel' separated by spaces") do |key| "Key for geocoding API (usually optional). Enclose multi-part keys in quotes and separate parts by spaces") do |key|
premier_key = key.split(' ') if (key_parts = key.split(' ')).size > 1
if premier_key.length == 3 Geocoder.configure(:api_key => key_parts)
Geocoder.configure(:api_key => premier_key)
else else
Geocoder.configure(:api_key => key) Geocoder.configure(:api_key => key)
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment