Giter VIP home page Giter VIP logo

locationer_gem's Introduction

Locationer

Add to gemfile

gem 'locationer', github: 'belike81/locationer_gem'

Add route to your routes.rb file

mount Locationer::Engine, at: '/locationer'

Run the installation script

rake locationer:install

Access the location data API

locationer/location_data/(*US or Mexico)/cities_nearby/(*city_name)

    • provide your own value for this

Use locationer in your own models

city_finder = Locationer::CityFinder.new('US') to instantiate finder object with the desired country

city_finder.nearby_cities(city: 'Los Angeles', state: 'CA') to get back an array of Locationer::GeoData objects

Setting up Dummy rails app

For development and testing there is a dummy rails app located under spec/dummy.

To set it up you first have to copy over the spec/dummy/config/database.yml.template and modify it to your own settings.

cp spec/dummy/config/database.yml.template spec/dummy/config/database.yml

Executing locationer:install rake task will copy over the migrations to the dummy app, run db:migrate and imports the location data from the US.csv and Mexico.csv files:

cd spec/dummy

bundle install

bundle exec rake locationer:install

To setup the dummy test db for testing run this:

bundle exec db:test:prepare

You now be able to enter the rails console in the dummy app.

rails c

locationer_gem's People

Contributors

belike81 avatar

Watchers

 avatar Hal Helms avatar Bill Kiskin avatar  avatar Wesley Robinson avatar James Cloos avatar uriel avatar mrlocus avatar Heath Griffin avatar Zachary Dixon avatar  avatar Israel Bautista avatar Juan Leal avatar Devery Channell avatar  avatar Tracie Pannell avatar Chase DeAnda avatar Andrew Kuttig avatar  avatar Hal Helms avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.