netaddr 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/netaddr.rb +3 -3
- data/test/netaddr_test.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13e871a188dbf2b94f5c57fe638c5dac249792134a8eece5386fbc36d1ea88d6
|
4
|
+
data.tar.gz: 14e02af771158f3003e49181ed49fe7e2fa8d201991215bda51fc2a48b15a96a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c1baeafeba2d571e007da5ed16276c3fadccb9be542ea47922878ba2e9889e8912145482db9b3c10f2aad3a7a19005ad0499005f71f893bb2db1e7806db1ed2
|
7
|
+
data.tar.gz: 3a287b3d7cb1f87cc46e50fefc54952c80e2ff43581492328a27091605db7937cde768d5003d9eeda201ee5e1b353de86e4602bf093bea497bac3403612f6e0f
|
data/lib/netaddr.rb
CHANGED
@@ -48,10 +48,10 @@ module NetAddr
|
|
48
48
|
|
49
49
|
## parse_net parses a string into an IPv4Net or IPv6Net
|
50
50
|
def parse_net(net)
|
51
|
-
if (net.include?("
|
52
|
-
return
|
51
|
+
if (net.include?(":"))
|
52
|
+
return IPv6Net.parse(net)
|
53
53
|
end
|
54
|
-
return
|
54
|
+
return IPv4Net.parse(net)
|
55
55
|
end
|
56
56
|
module_function :parse_net
|
57
57
|
|
data/test/netaddr_test.rb
CHANGED
@@ -13,6 +13,7 @@ class TestNetAddr < Test::Unit::TestCase
|
|
13
13
|
def test_parse_net
|
14
14
|
assert_equal("128.0.0.1/32", NetAddr.parse_net("128.0.0.1/32").to_s)
|
15
15
|
assert_equal("1::/24", NetAddr.parse_net("1::1/24").to_s)
|
16
|
+
assert_equal("::ffff:aabb:ccdd/128", NetAddr.parse_net("::ffff:170.187.204.221/128").to_s)
|
16
17
|
end
|
17
18
|
|
18
19
|
def test_ipv4_prefix_len
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netaddr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Spinhirne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
|
-
rubygems_version: 3.
|
63
|
+
rubygems_version: 3.3.5
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: A Ruby library for performing calculations on IPv4 and IPv6 subnets.
|