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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a1415cbc9b4353fc9da565edf3ac8a7a9e0494e9a69d5767c1a46219abc4b24
4
- data.tar.gz: d6d34f2d5dff1beea5855bfac31d5bbb12a3358f8f12aee2513dc074047037d7
3
+ metadata.gz: 13e871a188dbf2b94f5c57fe638c5dac249792134a8eece5386fbc36d1ea88d6
4
+ data.tar.gz: 14e02af771158f3003e49181ed49fe7e2fa8d201991215bda51fc2a48b15a96a
5
5
  SHA512:
6
- metadata.gz: fb448e9527d5bca2ec9c8f095dcf6b825de2919a429bf6aa50b757b2b71dcc9778b2910a090fbba3af209349f295ab59df29cb95f76057400e16a6b9eb892e93
7
- data.tar.gz: b2ff3dffd33f4bc1ce5b0e1fc16f3121cb2a7f75d9a0a6321daf7c1cc7adea85224d1bb1d0a4593706d0125341fa0c82c464a5ed8d3d5f34de79721df0dcf5ac
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?(".")) # ipv4
52
- return IPv4Net.parse(net)
51
+ if (net.include?(":"))
52
+ return IPv6Net.parse(net)
53
53
  end
54
- return IPv6Net.parse(net)
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.5
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: 2021-10-07 00:00:00.000000000 Z
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.1.2
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.