GeoIPDB
Fast GeoIPDB implementation for JRuby.
Installation
Add this line to your application's Gemfile:
gem 'geoipdb'
And then execute:
$ bundle
Or install it yourself as:
$ gem install geoipdb
Usage
db = IpDb.init "city_codes.csv", "ip_city.txt", "ip_city.cache"
ip_info = db.information_for_ip("178.0.0.1")
ip_info.inspect
=> #<IpInformation:0x101385c78 @city_name="eschborn", @city_code="ax5", @lng=8.55, @country_iso_code="de", @lat=50.133333, @is_mobile=true>
Contributing
- Fork it ( http://github.com/liquidm/geoipdb/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request