joecorcoran / cities Goto Github PK
View Code? Open in Web Editor NEWWorld city data in Ruby
License: MIT License
World city data in Ruby
License: MIT License
How to start with this gem?
Please update document.
Created a buildpack to download JSON data and get it prepared to be used with this gem
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
Am I doing something wrong? Any specific name for those cities? =/
Country.new(:us).cities.values.select { |c| c.region == 'NY' && c.name.include?('New') }.map { |c| [c.name,c.region] }.sort
Where you get it?
It seems too old (I saw the population of my homeland cities).
How can I get a fresh data?
Im trying out this work, I find it useful, I am just wondering why the caching work for cities that is done in master is not into the latest version yet.
Hi! is this file https://s3-us-west-2.amazonaws.com/cities-gem/cities.tar.gz being updated?
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.