ipaddress_2 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.rdoc +3 -3
- data/VERSION +1 -1
- data/ipaddress_2.gemspec +1 -1
- data/lib/ipaddress_2/ipv4.rb +3 -1
- data/lib/ipaddress_2/ipv6.rb +3 -1
- data/lib/ipaddress_2/version.rb +1 -1
- data/test/ipaddress_2/ipv4_test.rb +1 -0
- data/test/ipaddress_2/ipv6_test.rb +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9a281ff3a5be006b8e76e2495597ccc727a403f3e43421250088e8a61da18c6
|
4
|
+
data.tar.gz: 548b551caad2225532081bc4d9203c703c333ee715b84768115c0697b8a7f865
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48c4eefd3213e47460b477e34872e1c332f1480d620f6d96527f0c5acc7e4051ffefa233ac1b4566193ee9dfc548d040ee38e374968bda778b2f8462336cf792
|
7
|
+
data.tar.gz: 37c47f2d478e596a7f11daa7dd33f35e888c1ced7e351f4286561dc69853191d2b09b1e46c9d2227055916668381b30fd634e298aa5c9cf9ae35b7376d85b94a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## 0.11.1
|
4
|
+
|
5
|
+
### Bugfix
|
6
|
+
* Fix prefix change in find\_adjacent
|
7
|
+
|
3
8
|
## 0.11.0
|
4
9
|
|
5
10
|
### Enhancements
|
@@ -26,6 +31,6 @@
|
|
26
31
|
### Bugfix
|
27
32
|
* Removed duplicate link_local? in IPv6
|
28
33
|
|
29
|
-
Please check [CHANGELOG.rdoc](https://github.com/ipaddress2-gem/
|
34
|
+
Please check [CHANGELOG.rdoc](https://github.com/ipaddress2-gem/ipaddress_2/blob/master/CHANGELOG.rdoc) for previous changes.
|
30
35
|
|
31
36
|
|
data/README.rdoc
CHANGED
@@ -16,11 +16,11 @@ examples of typical usage.
|
|
16
16
|
|
17
17
|
* Ruby 1.9.3 or later
|
18
18
|
|
19
|
-
Please refer to {Travis CI}[https://travis-ci.org/ipaddress2-gem/
|
19
|
+
Please refer to {Travis CI}[https://travis-ci.org/ipaddress2-gem/ipaddress_2] for Build Tests on specific versions of Ruby.
|
20
20
|
|
21
|
-
{<img src="https://travis-ci.org/ipaddress2-gem/
|
21
|
+
{<img src="https://travis-ci.org/ipaddress2-gem/ipaddress_2.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/ipaddress2-gem/ipaddress_2] {<img src="https://codeclimate.com/github/ipaddress2-gem/ipaddress_2/badges/gpa.svg" />}[https://codeclimate.com/github/ipaddress2-gem/ipaddress_2]
|
22
22
|
|
23
|
-
If you want to contribute, please refer to {Contributing.md}[https://github.com/ipaddress2-gem/
|
23
|
+
If you want to contribute, please refer to {Contributing.md}[https://github.com/ipaddress2-gem/ipaddress_2/blob/master/CONTRIBUTING.md].
|
24
24
|
|
25
25
|
|
26
26
|
== Installation
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.11.
|
1
|
+
0.11.1
|
data/ipaddress_2.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = `git ls-files -z`.split("\x0")
|
20
|
-
s.homepage = "https://github.com/ipaddress2-gem/
|
20
|
+
s.homepage = "https://github.com/ipaddress2-gem/ipaddress_2"
|
21
21
|
|
22
22
|
s.add_development_dependency "bundler"
|
23
23
|
s.add_development_dependency "rake"
|
data/lib/ipaddress_2/ipv4.rb
CHANGED
@@ -1164,7 +1164,9 @@ module IPAddress;
|
|
1164
1164
|
return false if prefix == 0
|
1165
1165
|
current_subnet = to_string
|
1166
1166
|
self.prefix = @prefix - 1
|
1167
|
-
(split.map{|i| i.to_string} - [current_subnet])[0]
|
1167
|
+
adjacent_subnet = (split.map{|i| i.to_string} - [current_subnet])[0]
|
1168
|
+
self.prefix = @prefix + 1
|
1169
|
+
return adjacent_subnet
|
1168
1170
|
end
|
1169
1171
|
|
1170
1172
|
#
|
data/lib/ipaddress_2/ipv6.rb
CHANGED
@@ -977,7 +977,9 @@ module IPAddress;
|
|
977
977
|
return false if prefix == 0
|
978
978
|
current_subnet = to_string
|
979
979
|
self.prefix = @prefix - 1
|
980
|
-
(split.map{|i| i.to_string} - [current_subnet])[0]
|
980
|
+
adjacent_subnet = (split.map{|i| i.to_string} - [current_subnet])[0]
|
981
|
+
self.prefix = @prefix + 1
|
982
|
+
return adjacent_subnet
|
981
983
|
end
|
982
984
|
|
983
985
|
private
|
data/lib/ipaddress_2/version.rb
CHANGED
@@ -689,6 +689,7 @@ class IPv4Test < Minitest::Test
|
|
689
689
|
def test_finds_adjacent_subnet
|
690
690
|
ip = @klass.new("10.0.0.0/24")
|
691
691
|
assert_equal "10.0.1.0/24", ip.find_adjacent_subnet
|
692
|
+
assert_equal 24, ip.prefix
|
692
693
|
refute @klass.new("10.0.0.0/0").find_adjacent_subnet
|
693
694
|
assert_equal "10.0.0.0/8", @klass.new("11.0.0.0/8").find_adjacent_subnet
|
694
695
|
assert_equal "172.16.0.0/16", @klass.new("172.17.0.0/16").find_adjacent_subnet
|
@@ -572,11 +572,14 @@ class IPv6Test < Minitest::Test
|
|
572
572
|
|
573
573
|
def test_finds_adjacent_subnet
|
574
574
|
refute @klass.new("::/0").find_adjacent_subnet
|
575
|
+
|
576
|
+
ip = @klass.new("2001:db8::/32")
|
577
|
+
assert_equal "2001:db9::/32", ip.find_adjacent_subnet
|
578
|
+
assert_equal 32, ip.prefix
|
579
|
+
|
575
580
|
assert_equal "2001:db9::/32", @klass.new("2001:db8::/32").find_adjacent_subnet
|
576
581
|
assert_equal "2001:db8:0:1::/64", @klass.new("2001:db8::/64").find_adjacent_subnet
|
577
582
|
assert_equal "2001:db8:8:2000::/51", @klass.new("2001:db8:8::/51").find_adjacent_subnet
|
578
|
-
# assert_equal "", @klass.new("").find_adjacent_subnet
|
579
|
-
# assert_equal "", @klass.new("").find_adjacent_subnet
|
580
583
|
end
|
581
584
|
|
582
585
|
end # class IPv6Test
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ipaddress_2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bluemonk
|
@@ -168,7 +168,7 @@ files:
|
|
168
168
|
- test/ipaddress_2/prefix_test.rb
|
169
169
|
- test/ipaddress_2_test.rb
|
170
170
|
- test/test_helper.rb
|
171
|
-
homepage: https://github.com/ipaddress2-gem/
|
171
|
+
homepage: https://github.com/ipaddress2-gem/ipaddress_2
|
172
172
|
licenses:
|
173
173
|
- MIT
|
174
174
|
metadata: {}
|