better_ipaddr 0.2.2 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa1cd24ef7a0afb9034bfa9e7bcc92c986121d32
4
- data.tar.gz: 4e69dfa1e6c92aa844037a58f178f840dce19be4
3
+ metadata.gz: 4c742e6191e7a279cb6b18444d6fbe019a7f2a44
4
+ data.tar.gz: 56e8d5c730c30dfbe39ffcfee75a85e35a32f0ae
5
5
  SHA512:
6
- metadata.gz: 2722acdf74657ae6597285186419175a81ebcc38a97f2325eed1a2a7e1148617f767843d4699448cf0e4a87a7a31925935e0c05a1be643289d5849724a198dc0
7
- data.tar.gz: 995ae726a38e9b28a491b27acc83803ebeb5eee4bca04ba9c5594d3dd7071377e51b2c4a31340c431bf755e289236f22cfdae67e4bd002d765480492ee7ea93d
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
- return false if other.nil?
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
@@ -1,3 +1,3 @@
1
1
  module BetterIpaddr
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
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.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-09-13 00:00:00.000000000 Z
11
+ date: 2016-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler