0.0
No commit activity in last 3 years
No release in over 3 years
A simple gem to be used in combination with https://github.com/carlesso/RubyGeoIp
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 0
 Project Readme

GeoIpClient

GeoIpClient is a simple gem which allows you to speak with your RubyGeoIp server.

Installation

Add this line to your application's Gemfile:

gem 'geo_ip_client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install geo_ip_client

Configuration

Edit your config/initializers/geo_ip_client.rb like:

GeoIpClient.configure do |config|
  config.server_path = "" # Insert the location of your server
  config.secret_key = nil # Inser your secret key if your RubyGeoIp server requires it
end

Usage

 > GeoIpClient.search("64.71.22.18")
=> {"request"=>"64.71.22.18",
    "ip"=>"64.71.22.18",
    "country_code2"=>"US",
    "country_code3"=>"USA",
    "country_name"=>"United States",
    "continent_code"=>"NA",
    "region_name"=>"CA",
    "city_name"=>"Santa Clara",
    "postal_code"=>"95054",
    "latitude"=>37.39609999999999,
    "longitude"=>-121.96170000000001,
    "dma_code"=>807,
    "area_code"=>408,
    "timezone"=>"America/Los_Angeles",
    "region_long_name"=>"California"}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

CHANGELOG

v. 0.0.3

v. 0.0.2

  • Minor update to republish Gem with updated .gemspec

v. 0.0.1

  • First release