abunashir / googlemap

Experimental Google Map API client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Googlemap

Build Status

A simplest Ruby wrapper around Google Map API

Installation

Add this line to your application's Gemfile:

gem "googlemap", github: "abunashir/googlemap"

And then execute:

$ bundle install

Usage

Don't use this! This is just an experimental project for a specific purpose.

Configure

We need to setup Google Map API configuration before we can perform any request throughout this client

First, obtain an API key form Google API console, and once you have it then you can configure the client by adding an initializer with the following code:

Googlemap.configure do |googlemap_config|
  googlemap_config.api_key = "YOUR-SECRET-API-KEY"
end

Geocode

Find geocode for address

Googlemap::Geocode.find("valid_address")

Testing

To run the whole test suite, please use the following command, by default it won't make any actual API request.

bin/rspec spec/

Once, you have something finalized and if you want to make sure that it is actually working with the actual API or not then use the following command.

bin/rpsec --tag api_call spec/

Note: You will need to setup your actual API key before running the last command, and you can easily set it up by adding GOOGLEMAP_API_KEY in your environment variables.

License

The gem is available as open source under the terms of the MIT License

About

Experimental Google Map API client

License:MIT License


Languages

Language:Ruby 98.8%Language:Shell 1.2%