ipaddr 1.2.0 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -0
- data/ipaddr.gemspec +9 -7
- data/lib/ipaddr.rb +92 -57
- metadata +9 -56
- data/.gitignore +0 -9
- data/.travis.yml +0 -14
- data/Gemfile +0 -4
- data/Rakefile +0 -10
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 36032dfe23b1e485b8028f2ef7a33bf22830dfceab14f8fa87bc36b9be641257
|
4
|
+
data.tar.gz: b9287bd1261a2632fdecff1aa087883a535d6f5743344916fbe778570dcabe59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f54ad4ceab5bec23c4c63369301a199dcd9558e9cc5b718bae845e9fa2d2892c76ca1207767100b0f4099c0b2a8e0bff1c7f3d52d722e40d1f6bf9ede02e757a
|
7
|
+
data.tar.gz: accdd06106c29eaa3f54ee9b230db907b8edc51c954086573f8c9fae353fc76423196e075d8b4e076499fc67e60f81d9d7a4b4471212654d93f060a4a950d984
|
data/README.md
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
IPAddr provides a set of methods to manipulate an IP address. Both
|
4
4
|
IPv4 and IPv6 are supported.
|
5
5
|
|
6
|
+
[![Build Status](https://travis-ci.org/ruby/ipaddr.svg?branch=master)](https://travis-ci.org/ruby/ipaddr)
|
7
|
+
|
6
8
|
## Installation
|
7
9
|
|
8
10
|
This library is part of the standard ruby distribution as default gem
|
data/ipaddr.gemspec
CHANGED
@@ -1,10 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# coding: utf-8
|
2
3
|
lib = File.expand_path("../lib", __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
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
|
+
|
5
10
|
Gem::Specification.new do |spec|
|
6
11
|
spec.name = "ipaddr"
|
7
|
-
spec.version =
|
12
|
+
spec.version = version
|
8
13
|
spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
|
9
14
|
spec.email = ["knu@idaemons.org", "ume@mahoroba.org"]
|
10
15
|
|
@@ -14,13 +19,10 @@ IPAddr provides a set of methods to manipulate an IP address.
|
|
14
19
|
Both IPv4 and IPv6 are supported.
|
15
20
|
DESCRIPTION
|
16
21
|
spec.homepage = "https://github.com/ruby/ipaddr"
|
22
|
+
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
17
23
|
|
18
|
-
spec.files = ["
|
19
|
-
spec.bindir = "exe"
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.files = ["LICENSE.txt", "README.md", "ipaddr.gemspec", "lib/ipaddr.rb"]
|
21
25
|
spec.require_paths = ["lib"]
|
22
26
|
|
23
|
-
spec.
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
-
spec.add_development_dependency "test-unit"
|
27
|
+
spec.required_ruby_version = ">= 2.3"
|
26
28
|
end
|
data/lib/ipaddr.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
#
|
3
3
|
# ipaddr.rb - A class to manipulate an IP address
|
4
4
|
#
|
@@ -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
|
@@ -103,22 +104,21 @@ class IPAddr
|
|
103
104
|
|
104
105
|
# Creates a new ipaddr containing the given network byte ordered
|
105
106
|
# string form of an IP address.
|
106
|
-
def
|
107
|
-
return
|
107
|
+
def self.new_ntoh(addr)
|
108
|
+
return new(ntop(addr))
|
108
109
|
end
|
109
110
|
|
110
111
|
# Convert a network byte ordered string form of an IP address into
|
111
112
|
# human readable form.
|
112
|
-
def
|
113
|
+
def self.ntop(addr)
|
113
114
|
case addr.size
|
114
115
|
when 4
|
115
|
-
|
116
|
+
addr.unpack('C4').join('.')
|
116
117
|
when 16
|
117
|
-
|
118
|
+
IN6FORMAT % addr.unpack('n8')
|
118
119
|
else
|
119
120
|
raise AddressFamilyError, "unsupported address family"
|
120
121
|
end
|
121
|
-
return s
|
122
122
|
end
|
123
123
|
|
124
124
|
# Returns a new ipaddr built by bitwise AND.
|
@@ -168,34 +168,17 @@ class IPAddr
|
|
168
168
|
# net1 = IPAddr.new("192.168.2.0/24")
|
169
169
|
# net2 = IPAddr.new("192.168.2.100")
|
170
170
|
# net3 = IPAddr.new("192.168.3.0")
|
171
|
+
# net4 = IPAddr.new("192.168.2.0/16")
|
171
172
|
# p net1.include?(net2) #=> true
|
172
173
|
# p net1.include?(net3) #=> false
|
174
|
+
# p net1.include?(net4) #=> false
|
175
|
+
# p net4.include?(net1) #=> true
|
173
176
|
def include?(other)
|
174
177
|
other = coerce_other(other)
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
mask_addr = (@mask_addr & IN4MASK)
|
180
|
-
addr = (@addr & IN4MASK)
|
181
|
-
family = Socket::AF_INET
|
182
|
-
else
|
183
|
-
mask_addr = @mask_addr
|
184
|
-
addr = @addr
|
185
|
-
family = @family
|
186
|
-
end
|
187
|
-
if other.ipv4_mapped?
|
188
|
-
other_addr = (other.to_i & IN4MASK)
|
189
|
-
other_family = Socket::AF_INET
|
190
|
-
else
|
191
|
-
other_addr = other.to_i
|
192
|
-
other_family = other.family
|
193
|
-
end
|
194
|
-
|
195
|
-
if family != other_family
|
196
|
-
return false
|
197
|
-
end
|
198
|
-
return ((addr & mask_addr) == (other_addr & mask_addr))
|
178
|
+
return false unless other.family == family
|
179
|
+
range = to_range
|
180
|
+
other = other.to_range
|
181
|
+
range.begin <= other.begin && range.end >= other.end
|
199
182
|
end
|
200
183
|
alias === include?
|
201
184
|
|
@@ -232,7 +215,13 @@ class IPAddr
|
|
232
215
|
# Returns a string containing the IP address representation in
|
233
216
|
# canonical form.
|
234
217
|
def to_string
|
235
|
-
|
218
|
+
str = _to_string(@addr)
|
219
|
+
|
220
|
+
if @family == Socket::AF_INET6
|
221
|
+
str << zone_id.to_s
|
222
|
+
end
|
223
|
+
|
224
|
+
return str
|
236
225
|
end
|
237
226
|
|
238
227
|
# Returns a network byte ordered string form of the IP address.
|
@@ -310,7 +299,7 @@ class IPAddr
|
|
310
299
|
|
311
300
|
# Returns true if the ipaddr is an IPv4-compatible IPv6 address.
|
312
301
|
def ipv4_compat?
|
313
|
-
warn "
|
302
|
+
warn "IPAddr\##{__callee__} is obsolete", uplevel: 1 if $VERBOSE
|
314
303
|
_ipv4_compat?
|
315
304
|
end
|
316
305
|
|
@@ -328,17 +317,19 @@ class IPAddr
|
|
328
317
|
# into an IPv4-mapped IPv6 address.
|
329
318
|
def ipv4_mapped
|
330
319
|
if !ipv4?
|
331
|
-
raise InvalidAddressError, "not an IPv4 address"
|
320
|
+
raise InvalidAddressError, "not an IPv4 address: #{@addr}"
|
332
321
|
end
|
333
|
-
|
322
|
+
clone = self.clone.set(@addr | 0xffff00000000, Socket::AF_INET6)
|
323
|
+
clone.instance_variable_set(:@mask_addr, @mask_addr | 0xffffffffffffffffffffffff00000000)
|
324
|
+
clone
|
334
325
|
end
|
335
326
|
|
336
327
|
# Returns a new ipaddr built by converting the native IPv4 address
|
337
328
|
# into an IPv4-compatible IPv6 address.
|
338
329
|
def ipv4_compat
|
339
|
-
warn "
|
330
|
+
warn "IPAddr\##{__callee__} is obsolete", uplevel: 1 if $VERBOSE
|
340
331
|
if !ipv4?
|
341
|
-
raise InvalidAddressError, "not an IPv4 address"
|
332
|
+
raise InvalidAddressError, "not an IPv4 address: #{@addr}"
|
342
333
|
end
|
343
334
|
return self.clone.set(@addr, Socket::AF_INET6)
|
344
335
|
end
|
@@ -369,7 +360,7 @@ class IPAddr
|
|
369
360
|
# Returns a string for DNS reverse lookup compatible with RFC3172.
|
370
361
|
def ip6_arpa
|
371
362
|
if !ipv6?
|
372
|
-
raise InvalidAddressError, "not an IPv6 address"
|
363
|
+
raise InvalidAddressError, "not an IPv6 address: #{@addr}"
|
373
364
|
end
|
374
365
|
return _reverse + ".ip6.arpa"
|
375
366
|
end
|
@@ -377,7 +368,7 @@ class IPAddr
|
|
377
368
|
# Returns a string for DNS reverse lookup compatible with RFC1886.
|
378
369
|
def ip6_int
|
379
370
|
if !ipv6?
|
380
|
-
raise InvalidAddressError, "not an IPv6 address"
|
371
|
+
raise InvalidAddressError, "not an IPv6 address: #{@addr}"
|
381
372
|
end
|
382
373
|
return _reverse + ".ip6.int"
|
383
374
|
end
|
@@ -404,7 +395,7 @@ class IPAddr
|
|
404
395
|
|
405
396
|
# Returns a hash value used by Hash, Set, and Array classes
|
406
397
|
def hash
|
407
|
-
return ([@addr, @mask_addr].hash << 1) | (ipv4? ? 0 : 1)
|
398
|
+
return ([@addr, @mask_addr, @zone_id].hash << 1) | (ipv4? ? 0 : 1)
|
408
399
|
end
|
409
400
|
|
410
401
|
# Creates a Range object for the network address.
|
@@ -420,7 +411,7 @@ class IPAddr
|
|
420
411
|
raise AddressFamilyError, "unsupported address family"
|
421
412
|
end
|
422
413
|
|
423
|
-
|
414
|
+
self.class.new(begin_addr, @family)..self.class.new(end_addr, @family)
|
424
415
|
end
|
425
416
|
|
426
417
|
# Returns the prefix length in bits for the ipaddr.
|
@@ -448,7 +439,7 @@ class IPAddr
|
|
448
439
|
when Integer
|
449
440
|
mask!(prefix)
|
450
441
|
else
|
451
|
-
raise InvalidPrefixError, "prefix must be an integer"
|
442
|
+
raise InvalidPrefixError, "prefix must be an integer: #{@addr}"
|
452
443
|
end
|
453
444
|
end
|
454
445
|
|
@@ -460,11 +451,42 @@ class IPAddr
|
|
460
451
|
af = "IPv4"
|
461
452
|
when Socket::AF_INET6
|
462
453
|
af = "IPv6"
|
454
|
+
zone_id = @zone_id.to_s
|
463
455
|
else
|
464
456
|
raise AddressFamilyError, "unsupported address family"
|
465
457
|
end
|
466
|
-
return sprintf("#<%s: %s:%s/%s>", self.class.name,
|
467
|
-
af, _to_string(@addr), _to_string(@mask_addr))
|
458
|
+
return sprintf("#<%s: %s:%s%s/%s>", self.class.name,
|
459
|
+
af, _to_string(@addr), zone_id, _to_string(@mask_addr))
|
460
|
+
end
|
461
|
+
|
462
|
+
# Returns the netmask in string format e.g. 255.255.0.0
|
463
|
+
def netmask
|
464
|
+
_to_string(@mask_addr)
|
465
|
+
end
|
466
|
+
|
467
|
+
# Returns the IPv6 zone identifier, if present.
|
468
|
+
# Raises InvalidAddressError if not an IPv6 address.
|
469
|
+
def zone_id
|
470
|
+
if @family == Socket::AF_INET6
|
471
|
+
@zone_id
|
472
|
+
else
|
473
|
+
raise InvalidAddressError, "not an IPv6 address"
|
474
|
+
end
|
475
|
+
end
|
476
|
+
|
477
|
+
# Returns the IPv6 zone identifier, if present.
|
478
|
+
# Raises InvalidAddressError if not an IPv6 address.
|
479
|
+
def zone_id=(zid)
|
480
|
+
if @family == Socket::AF_INET6
|
481
|
+
case zid
|
482
|
+
when nil, /\A%(\w+)\z/
|
483
|
+
@zone_id = zid
|
484
|
+
else
|
485
|
+
raise InvalidAddressError, "invalid zone identifier for address"
|
486
|
+
end
|
487
|
+
else
|
488
|
+
raise InvalidAddressError, "not an IPv6 address"
|
489
|
+
end
|
468
490
|
end
|
469
491
|
|
470
492
|
protected
|
@@ -476,11 +498,11 @@ class IPAddr
|
|
476
498
|
case family[0] ? family[0] : @family
|
477
499
|
when Socket::AF_INET
|
478
500
|
if addr < 0 || addr > IN4MASK
|
479
|
-
raise InvalidAddressError, "invalid address"
|
501
|
+
raise InvalidAddressError, "invalid address: #{@addr}"
|
480
502
|
end
|
481
503
|
when Socket::AF_INET6
|
482
504
|
if addr < 0 || addr > IN6MASK
|
483
|
-
raise InvalidAddressError, "invalid address"
|
505
|
+
raise InvalidAddressError, "invalid address: #{@addr}"
|
484
506
|
end
|
485
507
|
else
|
486
508
|
raise AddressFamilyError, "unsupported address family"
|
@@ -488,6 +510,9 @@ class IPAddr
|
|
488
510
|
@addr = addr
|
489
511
|
if family[0]
|
490
512
|
@family = family[0]
|
513
|
+
if @family == Socket::AF_INET
|
514
|
+
@mask_addr &= IN4MASK
|
515
|
+
end
|
491
516
|
end
|
492
517
|
return self
|
493
518
|
end
|
@@ -496,17 +521,20 @@ class IPAddr
|
|
496
521
|
def mask!(mask)
|
497
522
|
case mask
|
498
523
|
when String
|
499
|
-
|
524
|
+
case mask
|
525
|
+
when /\A(0|[1-9]+\d*)\z/
|
500
526
|
prefixlen = mask.to_i
|
527
|
+
when /\A\d+\z/
|
528
|
+
raise InvalidPrefixError, "leading zeros in prefix"
|
501
529
|
else
|
502
530
|
m = IPAddr.new(mask)
|
503
531
|
if m.family != @family
|
504
|
-
raise InvalidPrefixError, "address family is not same"
|
532
|
+
raise InvalidPrefixError, "address family is not same: #{@addr}"
|
505
533
|
end
|
506
534
|
@mask_addr = m.to_i
|
507
535
|
n = @mask_addr ^ m.instance_variable_get(:@mask_addr)
|
508
536
|
unless ((n + 1) & n).zero?
|
509
|
-
raise InvalidPrefixError, "invalid mask #{mask}"
|
537
|
+
raise InvalidPrefixError, "invalid mask #{mask}: #{@addr}"
|
510
538
|
end
|
511
539
|
@addr &= @mask_addr
|
512
540
|
return self
|
@@ -517,13 +545,13 @@ class IPAddr
|
|
517
545
|
case @family
|
518
546
|
when Socket::AF_INET
|
519
547
|
if prefixlen < 0 || prefixlen > 32
|
520
|
-
raise InvalidPrefixError, "invalid length"
|
548
|
+
raise InvalidPrefixError, "invalid length: #{@addr}"
|
521
549
|
end
|
522
550
|
masklen = 32 - prefixlen
|
523
551
|
@mask_addr = ((IN4MASK >> masklen) << masklen)
|
524
552
|
when Socket::AF_INET6
|
525
553
|
if prefixlen < 0 || prefixlen > 128
|
526
|
-
raise InvalidPrefixError, "invalid length"
|
554
|
+
raise InvalidPrefixError, "invalid length: #{@addr}"
|
527
555
|
end
|
528
556
|
masklen = 128 - prefixlen
|
529
557
|
@mask_addr = ((IN6MASK >> masklen) << masklen)
|
@@ -555,6 +583,7 @@ class IPAddr
|
|
555
583
|
# those, such as &, |, include? and ==, accept a string, or a packed
|
556
584
|
# in_addr value instead of an IPAddr object.
|
557
585
|
def initialize(addr = '::', family = Socket::AF_UNSPEC)
|
586
|
+
@mask_addr = nil
|
558
587
|
if !addr.kind_of?(String)
|
559
588
|
case family
|
560
589
|
when Socket::AF_INET, Socket::AF_INET6
|
@@ -567,11 +596,16 @@ class IPAddr
|
|
567
596
|
raise AddressFamilyError, "unsupported address family: #{family}"
|
568
597
|
end
|
569
598
|
end
|
570
|
-
prefix, prefixlen = addr.split('/')
|
599
|
+
prefix, prefixlen = addr.split('/', 2)
|
571
600
|
if prefix =~ /\A\[(.*)\]\z/i
|
572
601
|
prefix = $1
|
573
602
|
family = Socket::AF_INET6
|
574
603
|
end
|
604
|
+
if prefix =~ /\A(.*)(%\w+)\z/
|
605
|
+
prefix = $1
|
606
|
+
zone_id = $2
|
607
|
+
family = Socket::AF_INET6
|
608
|
+
end
|
575
609
|
# It seems AI_NUMERICHOST doesn't do the job.
|
576
610
|
#Socket.getaddrinfo(left, nil, Socket::AF_INET6, Socket::SOCK_STREAM, nil,
|
577
611
|
# Socket::AI_NUMERICHOST)
|
@@ -586,6 +620,7 @@ class IPAddr
|
|
586
620
|
@addr = in6_addr(prefix)
|
587
621
|
@family = Socket::AF_INET6
|
588
622
|
end
|
623
|
+
@zone_id = zone_id
|
589
624
|
if family != Socket::AF_UNSPEC && @family != family
|
590
625
|
raise AddressFamilyError, "address family mismatch"
|
591
626
|
end
|
@@ -616,8 +651,8 @@ class IPAddr
|
|
616
651
|
octets = m.captures
|
617
652
|
end
|
618
653
|
octets.inject(0) { |i, s|
|
619
|
-
(n = s.to_i) < 256 or raise InvalidAddressError, "invalid address"
|
620
|
-
s.match(/\A0./) and raise InvalidAddressError, "zero-filled number in IPv4 address is ambiguous"
|
654
|
+
(n = s.to_i) < 256 or raise InvalidAddressError, "invalid address: #{@addr}"
|
655
|
+
s.match(/\A0./) and raise InvalidAddressError, "zero-filled number in IPv4 address is ambiguous: #{@addr}"
|
621
656
|
i << 8 | n
|
622
657
|
}
|
623
658
|
end
|
@@ -634,19 +669,19 @@ class IPAddr
|
|
634
669
|
right = ''
|
635
670
|
when RE_IPV6ADDRLIKE_COMPRESSED
|
636
671
|
if $4
|
637
|
-
left.count(':') <= 6 or raise InvalidAddressError, "invalid address"
|
672
|
+
left.count(':') <= 6 or raise InvalidAddressError, "invalid address: #{@addr}"
|
638
673
|
addr = in_addr($~[4,4])
|
639
674
|
left = $1
|
640
675
|
right = $3 + '0:0'
|
641
676
|
else
|
642
677
|
left.count(':') <= ($1.empty? || $2.empty? ? 8 : 7) or
|
643
|
-
raise InvalidAddressError, "invalid address"
|
678
|
+
raise InvalidAddressError, "invalid address: #{@addr}"
|
644
679
|
left = $1
|
645
680
|
right = $2
|
646
681
|
addr = 0
|
647
682
|
end
|
648
683
|
else
|
649
|
-
raise InvalidAddressError, "invalid address"
|
684
|
+
raise InvalidAddressError, "invalid address: #{@addr}"
|
650
685
|
end
|
651
686
|
l = left.split(':')
|
652
687
|
r = right.split(':')
|
metadata
CHANGED
@@ -1,58 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ipaddr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori MUSHA
|
8
8
|
- Hajimu UMEMOTO
|
9
9
|
autorequire:
|
10
|
-
bindir:
|
10
|
+
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: bundler
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - "~>"
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '1.15'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - "~>"
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '1.15'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: rake
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - "~>"
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '10.0'
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - "~>"
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '10.0'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: test-unit
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - ">="
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '0'
|
49
|
-
type: :development
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0'
|
12
|
+
date: 2022-02-05 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
56
14
|
description: |
|
57
15
|
IPAddr provides a set of methods to manipulate an IP address.
|
58
16
|
Both IPv4 and IPv6 are supported.
|
@@ -63,18 +21,14 @@ executables: []
|
|
63
21
|
extensions: []
|
64
22
|
extra_rdoc_files: []
|
65
23
|
files:
|
66
|
-
- ".gitignore"
|
67
|
-
- ".travis.yml"
|
68
|
-
- Gemfile
|
69
24
|
- LICENSE.txt
|
70
25
|
- README.md
|
71
|
-
- Rakefile
|
72
|
-
- bin/console
|
73
|
-
- bin/setup
|
74
26
|
- ipaddr.gemspec
|
75
27
|
- lib/ipaddr.rb
|
76
28
|
homepage: https://github.com/ruby/ipaddr
|
77
|
-
licenses:
|
29
|
+
licenses:
|
30
|
+
- Ruby
|
31
|
+
- BSD-2-Clause
|
78
32
|
metadata: {}
|
79
33
|
post_install_message:
|
80
34
|
rdoc_options: []
|
@@ -84,15 +38,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
38
|
requirements:
|
85
39
|
- - ">="
|
86
40
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
41
|
+
version: '2.3'
|
88
42
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
43
|
requirements:
|
90
44
|
- - ">="
|
91
45
|
- !ruby/object:Gem::Version
|
92
46
|
version: '0'
|
93
47
|
requirements: []
|
94
|
-
|
95
|
-
rubygems_version: 2.6.14
|
48
|
+
rubygems_version: 3.0.3.1
|
96
49
|
signing_key:
|
97
50
|
specification_version: 4
|
98
51
|
summary: A class to manipulate an IP address in ruby
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.4
|
5
|
-
- ruby-head
|
6
|
-
- jruby
|
7
|
-
- jruby-head
|
8
|
-
matrix:
|
9
|
-
allow_failures:
|
10
|
-
# Even `rvm use jruby` does not work reliably on Travis:
|
11
|
-
# https://travis-ci.org/ruby/ipaddr/jobs/277222999
|
12
|
-
- rvm: jruby
|
13
|
-
- rvm: jruby-head
|
14
|
-
before_install: gem install bundler
|
data/Gemfile
DELETED
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "ipaddr"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|