My ipgeolocation gem.
The rails part is under construction.
Add this line to your application's Gemfile:
gem 'myip'
And then execute:
$ bundle
Or install it yourself as:
$ gem install myip
Type 'rspec' while in root directory of gem to test gem
Use commands in console after install:
update_ip_database
city_by_ip your_ip
region_by_ip your_ip
ctry_by_ip your_ip
cntry_by_ip your_ip
country_by_ip your_ip
To use gem functions in programm:
Myip::IPAddr.new.update_ip_database
Myip::IPAddr.new.city_by_ip 'your ip' #in Ukraine and Russia
Myip::IPAddr.new.region_by_ip 'your ip' #in Ukraine and Russia
Myip::IPAddr.new.ctry_by_ip 'your ip' #everywhere
Myip::IPAddr.new.cntry_by_ip 'your ip'
Myip::IPAddr.new.country_by_ip 'your ip'
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request