better_ipaddr 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/better_ipaddr/methods.rb +4 -2
- data/lib/better_ipaddr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c742e6191e7a279cb6b18444d6fbe019a7f2a44
|
4
|
+
data.tar.gz: 56e8d5c730c30dfbe39ffcfee75a85e35a32f0ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be8cf2af08d5c956400250aaad385ac8b9fa32c736330cf289326ba2eb4b44957cf5718ea2bf69c3e5b7524b4c758e9ed9de40ba87d6ff2f30baa839fa19c54
|
7
|
+
data.tar.gz: eac415d3db96e2c35d490d8412ad7fa8ccc28b66b582eec4632fced82ea48eef020956b36324c541532a6e0ec9fc70af8339b4ed20a54bb0e1c7da6a1a9cb158
|
@@ -157,12 +157,14 @@ module BetterIpaddr
|
|
157
157
|
|
158
158
|
# Test the equality of two IP addresses, or an IP address an
|
159
159
|
# integer representing an address in the same address family.
|
160
|
+
#
|
161
|
+
# Returns false for any other type.
|
162
|
+
#
|
160
163
|
# @param other [IPAddr, Integer] the address to compare with
|
161
164
|
# @return [Boolean]
|
162
165
|
|
163
166
|
def ==(other)
|
164
|
-
|
165
|
-
(self <=> other) == 0
|
167
|
+
(other.is_a?(IPAddr) || other.is_a?(Integer)) && (self <=> other) == 0
|
166
168
|
end
|
167
169
|
|
168
170
|
# The address at the given offset relative to the network address
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: better_ipaddr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Miller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|