ipaddr 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/ipaddr.gemspec +5 -1
  3. data/lib/ipaddr.rb +6 -1
  4. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2856d459b11572a7c59a6ad57ec0462b5e851a5c2a012cb6d106a8be15e3739
4
- data.tar.gz: e8bf2d309cd922ad6c10af07f359034264be462b926718b4d8524e068084fa5f
3
+ metadata.gz: 36032dfe23b1e485b8028f2ef7a33bf22830dfceab14f8fa87bc36b9be641257
4
+ data.tar.gz: b9287bd1261a2632fdecff1aa087883a535d6f5743344916fbe778570dcabe59
5
5
  SHA512:
6
- metadata.gz: 372737acde9b6852b407d6b38df6392ea2240589eda19798e14fd01184594f0a9ef7d3a30d7f3ce5d178d314ff535a92fb1400f9895863c49047229175e1e350
7
- data.tar.gz: 46aaa06ed661f88c99b63f844855ec91e9b17639799d5d3d980a77f7db236306511671d6f38b562d08fcdd35150b5bea1adccef2b182c7c8e5563a6439b374d7
6
+ metadata.gz: f54ad4ceab5bec23c4c63369301a199dcd9558e9cc5b718bae845e9fa2d2892c76ca1207767100b0f4099c0b2a8e0bff1c7f3d52d722e40d1f6bf9ede02e757a
7
+ data.tar.gz: accdd06106c29eaa3f54ee9b230db907b8edc51c954086573f8c9fae353fc76423196e075d8b4e076499fc67e60f81d9d7a4b4471212654d93f060a4a950d984
data/ipaddr.gemspec CHANGED
@@ -3,9 +3,13 @@
3
3
  lib = File.expand_path("../lib", __FILE__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
+ version = File.foreach(File.expand_path("ipaddr.rb", lib)).find do |line|
7
+ /^\s*VERSION\s*=\s*["'](.*)["']/ =~ line and break $1
8
+ end
9
+
6
10
  Gem::Specification.new do |spec|
7
11
  spec.name = "ipaddr"
8
- spec.version = "1.2.3"
12
+ spec.version = version
9
13
  spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
10
14
  spec.email = ["knu@idaemons.org", "ume@mahoroba.org"]
11
15
 
data/lib/ipaddr.rb CHANGED
@@ -40,6 +40,7 @@ require 'socket'
40
40
  # p ipaddr3 #=> #<IPAddr: IPv4:192.168.2.0/255.255.255.0>
41
41
 
42
42
  class IPAddr
43
+ VERSION = "1.2.4"
43
44
 
44
45
  # 32 bit mask for IPv4
45
46
  IN4MASK = 0xffffffff
@@ -410,7 +411,7 @@ class IPAddr
410
411
  raise AddressFamilyError, "unsupported address family"
411
412
  end
412
413
 
413
- return clone.set(begin_addr, @family)..clone.set(end_addr, @family)
414
+ self.class.new(begin_addr, @family)..self.class.new(end_addr, @family)
414
415
  end
415
416
 
416
417
  # Returns the prefix length in bits for the ipaddr.
@@ -509,6 +510,9 @@ class IPAddr
509
510
  @addr = addr
510
511
  if family[0]
511
512
  @family = family[0]
513
+ if @family == Socket::AF_INET
514
+ @mask_addr &= IN4MASK
515
+ end
512
516
  end
513
517
  return self
514
518
  end
@@ -579,6 +583,7 @@ class IPAddr
579
583
  # those, such as &, |, include? and ==, accept a string, or a packed
580
584
  # in_addr value instead of an IPAddr object.
581
585
  def initialize(addr = '::', family = Socket::AF_UNSPEC)
586
+ @mask_addr = nil
582
587
  if !addr.kind_of?(String)
583
588
  case family
584
589
  when Socket::AF_INET, Socket::AF_INET6
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipaddr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akinori MUSHA
8
8
  - Hajimu UMEMOTO
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-25 00:00:00.000000000 Z
12
+ date: 2022-02-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: |
15
15
  IPAddr provides a set of methods to manipulate an IP address.
@@ -30,7 +30,7 @@ licenses:
30
30
  - Ruby
31
31
  - BSD-2-Clause
32
32
  metadata: {}
33
- post_install_message:
33
+ post_install_message:
34
34
  rdoc_options: []
35
35
  require_paths:
36
36
  - lib
@@ -45,8 +45,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  requirements: []
48
- rubygems_version: 3.2.22
49
- signing_key:
48
+ rubygems_version: 3.0.3.1
49
+ signing_key:
50
50
  specification_version: 4
51
51
  summary: A class to manipulate an IP address in ruby
52
52
  test_files: []