https://github.com/kickstarter/ipcat-ruby
Ruby port of client9/ipcat
https://github.com/kickstarter/ipcat-ruby
Last synced: over 1 year ago
JSON representation
Ruby port of client9/ipcat
- Host: GitHub
- URL: https://github.com/kickstarter/ipcat-ruby
- Owner: kickstarter
- License: mit
- Created: 2013-01-01T12:08:16.000Z (over 13 years ago)
- Default Branch: main
- Last Pushed: 2024-08-05T19:48:18.000Z (almost 2 years ago)
- Last Synced: 2025-03-28T08:08:38.772Z (over 1 year ago)
- Language: Ruby
- Size: 360 KB
- Stars: 145
- Watchers: 115
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ipcat-ruby
A ruby port of the [ipcat](https://github.com/rale/ipcat) library to classify IP addresses from known datacenters
[](https://rubygems.org/gems/ipcat)
[](https://github.com/kickstarter/ipcat-ruby/actions/workflows/minitest.yml)
## Installation
With bundler:
```ruby
# In Gemfile
gem 'ipcat'
```
Or with rubygems:
```shell
gem install ipcat
```
## Usage
```ruby
IPCat.datacenter?(ip_address)
```
It will return an `IPCat::IPRange` if `ip_address` is from a known datacenter; `nil` otherwise.
For example,
```ruby
range = IPCat.datacenter?('52.95.252.0') # => instance of IPCat::IPRange
range.name # => 'Amazon AWS'
IPCat.datacenter?('127.0.0.1') # => nil
```
## License
Copyright (c) 2013 Kickstarter, Inc
Released under an [MIT License](http://opensource.org/licenses/MIT)