8000 GitHub - andreyors/car_api: A code exercise about APIs...and cars
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

andreyors/car_api

 
 

Repository files navigation

Test Project for Ally

Description

I use Sinatra as base framework for API, DataMapper as ORM, Test-Unit for acceptance tests For database - PostgreSQL with 'earthdistance' and 'cube' extensions to get ranged by distance collection.

DataMapper has strange issue which blocks us from importing data, solved with updating version from 2.0.0 to 2.1.2 https://goo.gl/a1hHea

Installation notes

  • Install gem dependency manager - gem install bundler
  • Install PostgreSQL and pg extension
    • Mac OS X related
    • Linux related
  • Create database createdb ally_development
  • Define environment variable - export DB_DSN=postgres://localhost/ally_development
  • Install all gems bundle install --binstubs
  • Inject PostGIS extensions to enable distance calculation - rake udf
  • Insert demo data from data.json - rake init
  • Start web app - rackup
  • Open in browser - "http://localhost:9292/cars?location=1,2"
  • Run acceptance tests - rake (please, ensure that you started server)
  • Run unit tests - rake unit

About

A code exercise about APIs...and cars

Resources

Security policy

Stars

Watchers

Forks

Releases< 372B /h2>
No releases published

Packages

No packages published

Languages

  • Ruby 90.2%
  • Dockerfile 9.8%
0