ip2proxy_ruby 3.4.0 → 3.5.1
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/Gemfile +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +5 -2
- data/example.rb +46 -46
- data/ip2proxy_ruby.gemspec +12 -28
- data/lib/ip2proxy_ruby/i2p_database_config.rb +28 -28
- data/lib/ip2proxy_ruby/i2p_ip_data.rb +9 -9
- data/lib/ip2proxy_ruby/i2p_string_data.rb +18 -15
- data/lib/ip2proxy_ruby/ip2proxy_config.rb +19 -19
- data/lib/ip2proxy_ruby/ip2proxy_record.rb +19 -19
- data/lib/ip2proxy_ruby.rb +545 -545
- data/spec/ip2proxy_ruby_database_spec.rb +129 -129
- metadata +10 -10
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
|
-
|
|
3
|
-
describe "Ip2proxy" do
|
|
4
|
-
it "work correctly with invalid ip" do
|
|
5
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
6
|
-
record = i2p.get_all('1.0.0.x')
|
|
7
|
-
expect(record['country_short']).to eq 'INVALID IP ADDRESS'
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
it "work correctly with get_all ipv4" do
|
|
11
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
12
|
-
record = i2p.get_all('1.0.0.8')
|
|
13
|
-
expect(record['country_short']).to eq '-'
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it "work correctly with get_country_short" do
|
|
17
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
18
|
-
record = i2p.get_country_short('1.0.0.8')
|
|
19
|
-
expect(record).to eq '-'
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it "work correctly with get_country_long" do
|
|
23
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
24
|
-
record = i2p.get_country_long('1.0.0.8')
|
|
25
|
-
expect(record).to eq '-'
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it "work correctly with get_region" do
|
|
29
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
30
|
-
record = i2p.get_region('1.0.0.8')
|
|
31
|
-
expect(record).to eq '-'
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it "work correctly with get_city" do
|
|
35
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
36
|
-
record = i2p.get_city('1.0.0.8')
|
|
37
|
-
expect(record).to eq '-'
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
it "work correctly with get_isp" do
|
|
41
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
42
|
-
record = i2p.get_isp('1.0.0.8')
|
|
43
|
-
expect(record).to eq '-'
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
it "work correctly with get_domain" do
|
|
47
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
48
|
-
record = i2p.get_domain('1.0.0.8')
|
|
49
|
-
expect(record).to eq '-'
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
it "work correctly with get_usagetype" do
|
|
53
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
54
|
-
record = i2p.get_usagetype('1.0.0.8')
|
|
55
|
-
expect(record).to eq '-'
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
it "work correctly with get_asn" do
|
|
59
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
60
|
-
record = i2p.get_asn('1.0.0.8')
|
|
61
|
-
expect(record).to eq '-'
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
it "work correctly with get_as" do
|
|
65
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
66
|
-
record = i2p.get_as('1.0.0.8')
|
|
67
|
-
expect(record).to eq '-'
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
it "work correctly with get_last_seen" do
|
|
71
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
72
|
-
record = i2p.get_last_seen('1.0.0.8')
|
|
73
|
-
expect(record).to eq '-'
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
it "work correctly with get_threat" do
|
|
77
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
78
|
-
record = i2p.get_threat('1.0.0.8')
|
|
79
|
-
expect(record).to eq '-'
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
it "work correctly with is_proxy" do
|
|
83
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
84
|
-
record = i2p.is_proxy('1.0.0.8')
|
|
85
|
-
expect(record).to eq 0
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
it "work correctly with get_proxytype" do
|
|
89
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
90
|
-
record = i2p.get_proxytype('1.0.0.8')
|
|
91
|
-
expect(record).to eq '-'
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it "work correctly with get_provider" do
|
|
95
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
96
|
-
record = i2p.get_provider('1.0.0.8')
|
|
97
|
-
expect(record).to eq '-'
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
it "work correctly with get_fraud_score" do
|
|
101
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
102
|
-
record = i2p.get_fraud_score('1.0.0.8')
|
|
103
|
-
expect(record).to eq '0'
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
it "work correctly with get_all ipv6" do
|
|
107
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
108
|
-
record = i2p.get_all('2c0f:ffa0::4')
|
|
109
|
-
expect(record['country_short']).to eq '-'
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
it "work correctly with get_module_version" do
|
|
113
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
114
|
-
record = i2p.get_module_version()
|
|
115
|
-
expect(record).to eq '3.
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
it "work correctly with get_package_version" do
|
|
119
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
120
|
-
record = i2p.get_package_version()
|
|
121
|
-
expect(record).to eq '12'
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
it "work correctly with get_database_version" do
|
|
125
|
-
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
126
|
-
record = i2p.get_database_version()
|
|
127
|
-
expect(record).to eq '2025.2.5'
|
|
128
|
-
end
|
|
129
|
-
end
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "Ip2proxy" do
|
|
4
|
+
it "work correctly with invalid ip" do
|
|
5
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
6
|
+
record = i2p.get_all('1.0.0.x')
|
|
7
|
+
expect(record['country_short']).to eq 'INVALID IP ADDRESS'
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "work correctly with get_all ipv4" do
|
|
11
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
12
|
+
record = i2p.get_all('1.0.0.8')
|
|
13
|
+
expect(record['country_short']).to eq '-'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "work correctly with get_country_short" do
|
|
17
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
18
|
+
record = i2p.get_country_short('1.0.0.8')
|
|
19
|
+
expect(record).to eq '-'
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "work correctly with get_country_long" do
|
|
23
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
24
|
+
record = i2p.get_country_long('1.0.0.8')
|
|
25
|
+
expect(record).to eq '-'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it "work correctly with get_region" do
|
|
29
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
30
|
+
record = i2p.get_region('1.0.0.8')
|
|
31
|
+
expect(record).to eq '-'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "work correctly with get_city" do
|
|
35
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
36
|
+
record = i2p.get_city('1.0.0.8')
|
|
37
|
+
expect(record).to eq '-'
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it "work correctly with get_isp" do
|
|
41
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
42
|
+
record = i2p.get_isp('1.0.0.8')
|
|
43
|
+
expect(record).to eq '-'
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "work correctly with get_domain" do
|
|
47
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
48
|
+
record = i2p.get_domain('1.0.0.8')
|
|
49
|
+
expect(record).to eq '-'
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it "work correctly with get_usagetype" do
|
|
53
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
54
|
+
record = i2p.get_usagetype('1.0.0.8')
|
|
55
|
+
expect(record).to eq '-'
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
it "work correctly with get_asn" do
|
|
59
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
60
|
+
record = i2p.get_asn('1.0.0.8')
|
|
61
|
+
expect(record).to eq '-'
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
it "work correctly with get_as" do
|
|
65
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
66
|
+
record = i2p.get_as('1.0.0.8')
|
|
67
|
+
expect(record).to eq '-'
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it "work correctly with get_last_seen" do
|
|
71
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
72
|
+
record = i2p.get_last_seen('1.0.0.8')
|
|
73
|
+
expect(record).to eq '-'
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it "work correctly with get_threat" do
|
|
77
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
78
|
+
record = i2p.get_threat('1.0.0.8')
|
|
79
|
+
expect(record).to eq '-'
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
it "work correctly with is_proxy" do
|
|
83
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
84
|
+
record = i2p.is_proxy('1.0.0.8')
|
|
85
|
+
expect(record).to eq 0
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
it "work correctly with get_proxytype" do
|
|
89
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
90
|
+
record = i2p.get_proxytype('1.0.0.8')
|
|
91
|
+
expect(record).to eq '-'
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
it "work correctly with get_provider" do
|
|
95
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
96
|
+
record = i2p.get_provider('1.0.0.8')
|
|
97
|
+
expect(record).to eq '-'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
it "work correctly with get_fraud_score" do
|
|
101
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
102
|
+
record = i2p.get_fraud_score('1.0.0.8')
|
|
103
|
+
expect(record).to eq '0'
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
it "work correctly with get_all ipv6" do
|
|
107
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
108
|
+
record = i2p.get_all('2c0f:ffa0::4')
|
|
109
|
+
expect(record['country_short']).to eq '-'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
it "work correctly with get_module_version" do
|
|
113
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
114
|
+
record = i2p.get_module_version()
|
|
115
|
+
expect(record).to eq '3.5.1'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
it "work correctly with get_package_version" do
|
|
119
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
120
|
+
record = i2p.get_package_version()
|
|
121
|
+
expect(record).to eq '12'
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
it "work correctly with get_database_version" do
|
|
125
|
+
i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/PX12.SAMPLE.BIN")
|
|
126
|
+
record = i2p.get_database_version()
|
|
127
|
+
expect(record).to eq '2025.2.5'
|
|
128
|
+
end
|
|
129
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ip2proxy_ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ip2location
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: bindata
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: '3.0'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: '3.0'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: rspec
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
32
|
+
version: '3.13'
|
|
33
33
|
type: :development
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version:
|
|
39
|
+
version: '3.13'
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: rdoc
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -57,14 +57,14 @@ dependencies:
|
|
|
57
57
|
requirements:
|
|
58
58
|
- - ">="
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version:
|
|
60
|
+
version: '2.4'
|
|
61
61
|
type: :development
|
|
62
62
|
prerelease: false
|
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
65
|
- - ">="
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
67
|
+
version: '2.4'
|
|
68
68
|
description: The official IP2Proxy Ruby library to detect VPN servers, open proxies,
|
|
69
69
|
web proxies, Tor exit nodes, search engine robots, data center ranges and residential
|
|
70
70
|
proxies using IP2Proxy BIN database. Other information available includes proxy
|
|
@@ -111,14 +111,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
111
111
|
requirements:
|
|
112
112
|
- - ">="
|
|
113
113
|
- !ruby/object:Gem::Version
|
|
114
|
-
version: '0'
|
|
114
|
+
version: '3.0'
|
|
115
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
requirements:
|
|
117
117
|
- - ">="
|
|
118
118
|
- !ruby/object:Gem::Version
|
|
119
119
|
version: '0'
|
|
120
120
|
requirements: []
|
|
121
|
-
rubygems_version:
|
|
121
|
+
rubygems_version: 4.0.10
|
|
122
122
|
specification_version: 4
|
|
123
123
|
summary: IP2Proxy Ruby library
|
|
124
124
|
test_files: []
|