ipcat 2.0.21 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/Rakefile +3 -0
- data/data/datacenters +0 -0
- data/lib/ipcat.rb +2 -2
- data/lib/ipcat/version.rb +1 -1
- data/spec/ipcat_iprange_spec.rb +5 -5
- data/spec/ipcat_spec.rb +6 -6
- metadata +14 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 586f5adbfe57b16532b557414e3f64f82e555577cdf22359b46cb6dfd8c10f79
|
4
|
+
data.tar.gz: 1b2229eec1b863890e8128ad9a149cf603aa9c846f712285d5c0f77290f5d1cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfe2a2eddd94d32f951e25266eba740c7924c9d60e4d21e263982bddff38dac1c7478e73d525f0a0c47eb818b992d4b504692b526f07920056e9cbd82ccfe493
|
7
|
+
data.tar.gz: 766d2403fa9da2c0caabdafd79225082cd39f5553d31aa3bc2fdc3ac4ae9b4f83af36e5c511ef3c8f59737d026a83ee6a4c5e15c0ea953be5f084c410ff466cd
|
data/README.md
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
# ipcat-ruby
|
2
2
|
|
3
|
-
A ruby port of the [ipcat](https://github.com/
|
3
|
+
A ruby port of the [ipcat](https://github.com/rale/ipcat) library to classify IP addresses from known datacenters
|
4
4
|
|
5
|
-
[](https://codeclimate.com/github/kickstarter/ipcat-ruby)
|
5
|
+
[](https://github.com/kickstarter/ipcat-ruby/actions/workflows/minitest.yml)
|
7
6
|
|
8
7
|
## Installation
|
9
8
|
|
data/Rakefile
CHANGED
data/data/datacenters
CHANGED
Binary file
|
data/lib/ipcat.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
##
|
4
4
|
# IPCat
|
5
|
-
# Ruby lib for https://github.com/
|
5
|
+
# Ruby lib for https://github.com/rale/ipcat/
|
6
6
|
|
7
7
|
require 'ipaddr'
|
8
8
|
require 'ipcat/iprange'
|
@@ -27,7 +27,7 @@ class IPCat
|
|
27
27
|
@ranges = new_ranges
|
28
28
|
end
|
29
29
|
|
30
|
-
def load_csv!(path = 'https://raw.
|
30
|
+
def load_csv!(path = 'https://raw.githubusercontent.com/rale/ipcat/master/datacenters.csv')
|
31
31
|
reset_ranges!
|
32
32
|
|
33
33
|
require 'open-uri'
|
data/lib/ipcat/version.rb
CHANGED
data/spec/ipcat_iprange_spec.rb
CHANGED
@@ -14,14 +14,14 @@ describe 'IPCat::IPRange' do
|
|
14
14
|
|
15
15
|
describe '#initialize' do
|
16
16
|
it 'should fail if last < first' do
|
17
|
-
|
17
|
+
expect { IPCat::IPRange.new(2, 1) }.must_raise ArgumentError
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
describe '#<=> for integers' do
|
22
|
-
it('should match first') { (range <=> range.first).must_equal 0 }
|
23
|
-
it('should match last') { (range <=> range.last).must_equal 0 }
|
24
|
-
it('should match first-1') { (range <=> range.first - 1).must_equal 1 }
|
25
|
-
it('should match last+1') { (range <=> range.last + 1).must_equal(-1) }
|
22
|
+
it('should match first') { expect(range <=> range.first).must_equal 0 }
|
23
|
+
it('should match last') { expect(range <=> range.last).must_equal 0 }
|
24
|
+
it('should match first-1') { expect(range <=> range.first - 1).must_equal 1 }
|
25
|
+
it('should match last+1') { expect(range <=> range.last + 1).must_equal(-1) }
|
26
26
|
end
|
27
27
|
end
|
data/spec/ipcat_spec.rb
CHANGED
@@ -11,14 +11,14 @@ describe 'IPCat' do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
describe '#ranges' do
|
14
|
-
it('has a range') { IPCat.ranges.size.must_equal 1 }
|
14
|
+
it('has a range') { expect(IPCat.ranges.size).must_equal 1 }
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#datacenter?' do
|
18
|
-
it('should match 1.2.3.0') { IPCat.datacenter?('1.2.3.0').must_be_instance_of IPCat::IPRange }
|
19
|
-
it('should match 1.2.3.1') { IPCat.datacenter?('1.2.3.1').must_be_instance_of IPCat::IPRange }
|
20
|
-
it('should match 1.2.3.1') { IPCat.datacenter?('1.2.3.1').must_be_instance_of IPCat::IPRange }
|
21
|
-
it('should not match 1.1.1.1') { IPCat.datacenter?('1.1.1.1').must_be_nil }
|
22
|
-
it('should not match 2.2.2.2') { IPCat.datacenter?('2.2.2.2').must_be_nil }
|
18
|
+
it('should match 1.2.3.0') { expect(IPCat.datacenter?('1.2.3.0')).must_be_instance_of IPCat::IPRange }
|
19
|
+
it('should match 1.2.3.1') { expect(IPCat.datacenter?('1.2.3.1')).must_be_instance_of IPCat::IPRange }
|
20
|
+
it('should match 1.2.3.1') { expect(IPCat.datacenter?('1.2.3.1')).must_be_instance_of IPCat::IPRange }
|
21
|
+
it('should not match 1.1.1.1') { expect(IPCat.datacenter?('1.1.1.1')).must_be_nil }
|
22
|
+
it('should not match 2.2.2.2') { expect(IPCat.datacenter?('2.2.2.2')).must_be_nil }
|
23
23
|
end
|
24
24
|
end
|
metadata
CHANGED
@@ -1,44 +1,44 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ipcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Suggs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '5.14'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '5.14'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
description: 'A ruby port of the ipcat library: https://github.com/
|
40
|
+
version: '13.0'
|
41
|
+
description: 'A ruby port of the ipcat library: https://github.com/rale/ipcat/'
|
42
42
|
email: aaron@ktheory.com
|
43
43
|
executables: []
|
44
44
|
extensions: []
|
@@ -74,13 +74,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
|
-
|
78
|
-
rubygems_version: 2.7.6
|
77
|
+
rubygems_version: 3.0.3
|
79
78
|
signing_key:
|
80
79
|
specification_version: 4
|
81
80
|
summary: dataset for categorizing IP addresses in ruby
|
82
81
|
test_files:
|
83
|
-
- spec/benchmark_spec.rb
|
84
82
|
- spec/spec_helper.rb
|
85
|
-
- spec/ipcat_iprange_spec.rb
|
86
83
|
- spec/ipcat_spec.rb
|
84
|
+
- spec/benchmark_spec.rb
|
85
|
+
- spec/ipcat_iprange_spec.rb
|