Giter Club home page Giter Club logo

cities's Issues

Error in lib/cities.rb

guys yoiu have a major issue in lib/cities.rb
The error popsup when i do cities = Cities.cities_in_country('FR')

/cities-0.3.1/lib/cities.rb:30:in has_data?': undefined method exists?' for Dir:Class (NoMethodError)

This is the method involve
def has_data?
data_path && Dir.exists?(data_path)
end

it should be
def has_data?
data_path && Dir.exist?(data_path)
end

Cities json data

Where you get it?

It seems too old (I saw the population of my homeland cities).

How can I get a fresh data?

Custom data source

I saw in the code that the data is loaded in the load_country_data private method.
It'd be good if this method was customizable (using my lambda or proc, for example)?
This would allow to load data from other sources instead of JSON files.

Uninitialized constant Cities

I added "gem cities" into my Gemfile and bundled. I also downloaded the data. Then I opened my console and typed

2.1.1 :002 > require 'cities'
 => false 
2.1.1 :003 > Cities
NameError: uninitialized constant Cities

Was I doing something wrong? I'm on rails 4.1.0 and I have also countries gem in my Gemfile. It is defined right before cities gem.

Method `cities` for `Subdivision` class.

Hi!
I created a small function - fetching cities for particular state/subdivision object. I created it regarding my project, but I believe it will be useful for many users of this gem.

Pull request: #13

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.