ipcat 2.0.21 → 2.0.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 128607107ec0662a3fa669eb945725fc0561466c031954c4f1e5383ebf151dce
4
- data.tar.gz: 5227424a89485a5a5609bd59644921eba35a8865b4ffd4b4a3b360fba87b7fe6
3
+ metadata.gz: 586f5adbfe57b16532b557414e3f64f82e555577cdf22359b46cb6dfd8c10f79
4
+ data.tar.gz: 1b2229eec1b863890e8128ad9a149cf603aa9c846f712285d5c0f77290f5d1cc
5
5
  SHA512:
6
- metadata.gz: 1b9d07d76fd125bcb6cde416e2b177ffe875f872fc8617912200c1aa8e1157a6fd10d533cc5909597d04a482c0c6eb30b61c64a7f4a17c483e1fe15322334536
7
- data.tar.gz: 0c60a4e6823615569cadf8868a445777140d4c8ddc26eee4a08b002e2d29468704cf94c8501d293482305830488dd572787205cdcfae19ed4ad8a2c7b2827b6f
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/client9/ipcat) library to classify IP addresses from known datacenters
3
+ A ruby port of the [ipcat](https://github.com/rale/ipcat) library to classify IP addresses from known datacenters
4
4
 
5
- [![Build Status](https://travis-ci.org/kickstarter/ipcat-ruby.svg?branch=master)](https://travis-ci.org/kickstarter/ipcat-ruby)
6
- [![Code Climate](https://img.shields.io/codeclimate/github/kickstarter/ipcat-ruby.svg?style=flat)](https://codeclimate.com/github/kickstarter/ipcat-ruby)
5
+ [![minitest](https://github.com/kickstarter/ipcat-ruby/actions/workflows/minitest.yml/badge.svg)](https://github.com/kickstarter/ipcat-ruby/actions/workflows/minitest.yml)
7
6
 
8
7
  ## Installation
9
8
 
data/Rakefile CHANGED
@@ -32,3 +32,6 @@ task :bench do
32
32
  end
33
33
  end
34
34
  end
35
+
36
+ # Ensure tests pass and dataset is generated before building
37
+ task :build => %i[test generate_dataset]
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/client9/ipcat/
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.github.com/client9/ipcat/master/datacenters.csv')
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class IPCat
4
- VERSION = '2.0.21'
4
+ VERSION = '2.0.22'
5
5
  end
@@ -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
- -> { IPCat::IPRange.new(2, 1) }.must_raise ArgumentError
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.21
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: 2019-03-08 00:00:00.000000000 Z
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: 4.4.0
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: 4.4.0
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/client9/ipcat/'
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
- rubyforge_project:
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