Project

city_utc

0.0
No commit activity in last 3 years
No release in over 3 years
This project consist of two parts First part includes sqlite database with two tables based on worldcitiespop.csv (http://download.maxmind.com/download/): cities(city, country, latitude, longitude, population, timezone_code) timezones(timezone, code) Second part is sinatra (web) application for work with the database throw Sequel ORM.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 4.42.1, ~> 4.42
>= 1.4.7, ~> 1.4
>= 1.3.13, ~> 1.3
>= 1.7.0, ~> 1.7
~> 1.0
 Project Readme

City-UTC

Description

This project consist of two parts. First part includes sqlite database with two tables:

Cities

id city country latitude longitude population timezone_code
.. ... ...... ........ ......... .......... .............

Timezones

timezone code
....... ....

You can work with this tables throw Sequel ORM.

And second part is web application to work with the database. It receives city name and responce with UTC time for this city. If there more than one city with chosen name it returns a city with biggest population.

Installation

  $ bundle install

Usage

Database usage example

  cities = CityUTC::City # Sequel::Model

  puts cities.count
  puts cities.select(:city, :population)
             .reverse(:population)
             .limit(3)
             .to_a

Web application usage example

  $ bundle exec rake launch_web_server!
  $ curl 'http://localhost:30042/time?'
  $ curl 'http://localhost:30042/time?Moscow,New%20York,vladivostok,berlin,wrong_city,washington,ufa'

Requirements

  • Ruby 2.1.0
  • gzip
  • thin ~> 1.7.0
  • sinatra, ~> 1.4.7
  • sqlite3, ~> 1.3.13
  • sequel, ~> 4.42.1
  • timezone ~> 1.0

License

Released under the MIT License. See the LICENSE file for further details.