ipaddr 1.1.0 → 1.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 +5 -5
- data/README.md +3 -1
- data/ipaddr.gemspec +5 -7
- data/lib/ipaddr.rb +140 -54
- metadata +12 -59
- 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: d2856d459b11572a7c59a6ad57ec0462b5e851a5c2a012cb6d106a8be15e3739
|
4
|
+
data.tar.gz: e8bf2d309cd922ad6c10af07f359034264be462b926718b4d8524e068084fa5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 372737acde9b6852b407d6b38df6392ea2240589eda19798e14fd01184594f0a9ef7d3a30d7f3ce5d178d314ff535a92fb1400f9895863c49047229175e1e350
|
7
|
+
data.tar.gz: 46aaa06ed661f88c99b63f844855ec91e9b17639799d5d3d980a77f7db236306511671d6f38b562d08fcdd35150b5bea1adccef2b182c7c8e5563a6439b374d7
|
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
|
+
[](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
|
@@ -13,7 +15,7 @@ version than comes with older versions of ruby.
|
|
13
15
|
For example, you can add this line to your application's Gemfile:
|
14
16
|
|
15
17
|
```ruby
|
16
|
-
gem 'ipaddr', '~> 1.
|
18
|
+
gem 'ipaddr', '~> 1.2'
|
17
19
|
```
|
18
20
|
|
19
21
|
And then execute:
|
data/ipaddr.gemspec
CHANGED
@@ -1,10 +1,11 @@
|
|
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
|
|
5
6
|
Gem::Specification.new do |spec|
|
6
7
|
spec.name = "ipaddr"
|
7
|
-
spec.version = "1.
|
8
|
+
spec.version = "1.2.3"
|
8
9
|
spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
|
9
10
|
spec.email = ["knu@idaemons.org", "ume@mahoroba.org"]
|
10
11
|
|
@@ -14,13 +15,10 @@ IPAddr provides a set of methods to manipulate an IP address.
|
|
14
15
|
Both IPv4 and IPv6 are supported.
|
15
16
|
DESCRIPTION
|
16
17
|
spec.homepage = "https://github.com/ruby/ipaddr"
|
18
|
+
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
17
19
|
|
18
|
-
spec.files = ["
|
19
|
-
spec.bindir = "exe"
|
20
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.files = ["LICENSE.txt", "README.md", "ipaddr.gemspec", "lib/ipaddr.rb"]
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
-
spec.add_development_dependency "test-unit"
|
23
|
+
spec.required_ruby_version = ">= 2.3"
|
26
24
|
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
|
#
|
@@ -103,22 +103,21 @@ class IPAddr
|
|
103
103
|
|
104
104
|
# Creates a new ipaddr containing the given network byte ordered
|
105
105
|
# string form of an IP address.
|
106
|
-
def
|
107
|
-
return
|
106
|
+
def self.new_ntoh(addr)
|
107
|
+
return new(ntop(addr))
|
108
108
|
end
|
109
109
|
|
110
110
|
# Convert a network byte ordered string form of an IP address into
|
111
111
|
# human readable form.
|
112
|
-
def
|
112
|
+
def self.ntop(addr)
|
113
113
|
case addr.size
|
114
114
|
when 4
|
115
|
-
|
115
|
+
addr.unpack('C4').join('.')
|
116
116
|
when 16
|
117
|
-
|
117
|
+
IN6FORMAT % addr.unpack('n8')
|
118
118
|
else
|
119
119
|
raise AddressFamilyError, "unsupported address family"
|
120
120
|
end
|
121
|
-
return s
|
122
121
|
end
|
123
122
|
|
124
123
|
# Returns a new ipaddr built by bitwise AND.
|
@@ -168,34 +167,17 @@ class IPAddr
|
|
168
167
|
# net1 = IPAddr.new("192.168.2.0/24")
|
169
168
|
# net2 = IPAddr.new("192.168.2.100")
|
170
169
|
# net3 = IPAddr.new("192.168.3.0")
|
170
|
+
# net4 = IPAddr.new("192.168.2.0/16")
|
171
171
|
# p net1.include?(net2) #=> true
|
172
172
|
# p net1.include?(net3) #=> false
|
173
|
+
# p net1.include?(net4) #=> false
|
174
|
+
# p net4.include?(net1) #=> true
|
173
175
|
def include?(other)
|
174
176
|
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))
|
177
|
+
return false unless other.family == family
|
178
|
+
range = to_range
|
179
|
+
other = other.to_range
|
180
|
+
range.begin <= other.begin && range.end >= other.end
|
199
181
|
end
|
200
182
|
alias === include?
|
201
183
|
|
@@ -232,7 +214,13 @@ class IPAddr
|
|
232
214
|
# Returns a string containing the IP address representation in
|
233
215
|
# canonical form.
|
234
216
|
def to_string
|
235
|
-
|
217
|
+
str = _to_string(@addr)
|
218
|
+
|
219
|
+
if @family == Socket::AF_INET6
|
220
|
+
str << zone_id.to_s
|
221
|
+
end
|
222
|
+
|
223
|
+
return str
|
236
224
|
end
|
237
225
|
|
238
226
|
# Returns a network byte ordered string form of the IP address.
|
@@ -259,6 +247,50 @@ class IPAddr
|
|
259
247
|
return @family == Socket::AF_INET6
|
260
248
|
end
|
261
249
|
|
250
|
+
# Returns true if the ipaddr is a loopback address.
|
251
|
+
def loopback?
|
252
|
+
case @family
|
253
|
+
when Socket::AF_INET
|
254
|
+
@addr & 0xff000000 == 0x7f000000
|
255
|
+
when Socket::AF_INET6
|
256
|
+
@addr == 1
|
257
|
+
else
|
258
|
+
raise AddressFamilyError, "unsupported address family"
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
# Returns true if the ipaddr is a private address. IPv4 addresses
|
263
|
+
# in 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 as defined in RFC
|
264
|
+
# 1918 and IPv6 Unique Local Addresses in fc00::/7 as defined in RFC
|
265
|
+
# 4193 are considered private.
|
266
|
+
def private?
|
267
|
+
case @family
|
268
|
+
when Socket::AF_INET
|
269
|
+
@addr & 0xff000000 == 0x0a000000 || # 10.0.0.0/8
|
270
|
+
@addr & 0xfff00000 == 0xac100000 || # 172.16.0.0/12
|
271
|
+
@addr & 0xffff0000 == 0xc0a80000 # 192.168.0.0/16
|
272
|
+
when Socket::AF_INET6
|
273
|
+
@addr & 0xfe00_0000_0000_0000_0000_0000_0000_0000 == 0xfc00_0000_0000_0000_0000_0000_0000_0000
|
274
|
+
else
|
275
|
+
raise AddressFamilyError, "unsupported address family"
|
276
|
+
end
|
277
|
+
end
|
278
|
+
|
279
|
+
# Returns true if the ipaddr is a link-local address. IPv4
|
280
|
+
# addresses in 169.254.0.0/16 reserved by RFC 3927 and Link-Local
|
281
|
+
# IPv6 Unicast Addresses in fe80::/10 reserved by RFC 4291 are
|
282
|
+
# considered link-local.
|
283
|
+
def link_local?
|
284
|
+
case @family
|
285
|
+
when Socket::AF_INET
|
286
|
+
@addr & 0xffff0000 == 0xa9fe0000 # 169.254.0.0/16
|
287
|
+
when Socket::AF_INET6
|
288
|
+
@addr & 0xffc0_0000_0000_0000_0000_0000_0000_0000 == 0xfe80_0000_0000_0000_0000_0000_0000_0000
|
289
|
+
else
|
290
|
+
raise AddressFamilyError, "unsupported address family"
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
262
294
|
# Returns true if the ipaddr is an IPv4-mapped IPv6 address.
|
263
295
|
def ipv4_mapped?
|
264
296
|
return ipv6? && (@addr >> 32) == 0xffff
|
@@ -266,6 +298,11 @@ class IPAddr
|
|
266
298
|
|
267
299
|
# Returns true if the ipaddr is an IPv4-compatible IPv6 address.
|
268
300
|
def ipv4_compat?
|
301
|
+
warn "IPAddr\##{__callee__} is obsolete", uplevel: 1 if $VERBOSE
|
302
|
+
_ipv4_compat?
|
303
|
+
end
|
304
|
+
|
305
|
+
def _ipv4_compat?
|
269
306
|
if !ipv6? || (@addr >> 32) != 0
|
270
307
|
return false
|
271
308
|
end
|
@@ -273,20 +310,25 @@ class IPAddr
|
|
273
310
|
return a != 0 && a != 1
|
274
311
|
end
|
275
312
|
|
313
|
+
private :_ipv4_compat?
|
314
|
+
|
276
315
|
# Returns a new ipaddr built by converting the native IPv4 address
|
277
316
|
# into an IPv4-mapped IPv6 address.
|
278
317
|
def ipv4_mapped
|
279
318
|
if !ipv4?
|
280
|
-
raise InvalidAddressError, "not an IPv4 address"
|
319
|
+
raise InvalidAddressError, "not an IPv4 address: #{@addr}"
|
281
320
|
end
|
282
|
-
|
321
|
+
clone = self.clone.set(@addr | 0xffff00000000, Socket::AF_INET6)
|
322
|
+
clone.instance_variable_set(:@mask_addr, @mask_addr | 0xffffffffffffffffffffffff00000000)
|
323
|
+
clone
|
283
324
|
end
|
284
325
|
|
285
326
|
# Returns a new ipaddr built by converting the native IPv4 address
|
286
327
|
# into an IPv4-compatible IPv6 address.
|
287
328
|
def ipv4_compat
|
329
|
+
warn "IPAddr\##{__callee__} is obsolete", uplevel: 1 if $VERBOSE
|
288
330
|
if !ipv4?
|
289
|
-
raise InvalidAddressError, "not an IPv4 address"
|
331
|
+
raise InvalidAddressError, "not an IPv4 address: #{@addr}"
|
290
332
|
end
|
291
333
|
return self.clone.set(@addr, Socket::AF_INET6)
|
292
334
|
end
|
@@ -295,7 +337,7 @@ class IPAddr
|
|
295
337
|
# native IPv4 address. If the IP address is not an IPv4-mapped or
|
296
338
|
# IPv4-compatible IPv6 address, returns self.
|
297
339
|
def native
|
298
|
-
if !ipv4_mapped? && !
|
340
|
+
if !ipv4_mapped? && !_ipv4_compat?
|
299
341
|
return self
|
300
342
|
end
|
301
343
|
return self.clone.set(@addr & IN4MASK, Socket::AF_INET)
|
@@ -317,7 +359,7 @@ class IPAddr
|
|
317
359
|
# Returns a string for DNS reverse lookup compatible with RFC3172.
|
318
360
|
def ip6_arpa
|
319
361
|
if !ipv6?
|
320
|
-
raise InvalidAddressError, "not an IPv6 address"
|
362
|
+
raise InvalidAddressError, "not an IPv6 address: #{@addr}"
|
321
363
|
end
|
322
364
|
return _reverse + ".ip6.arpa"
|
323
365
|
end
|
@@ -325,7 +367,7 @@ class IPAddr
|
|
325
367
|
# Returns a string for DNS reverse lookup compatible with RFC1886.
|
326
368
|
def ip6_int
|
327
369
|
if !ipv6?
|
328
|
-
raise InvalidAddressError, "not an IPv6 address"
|
370
|
+
raise InvalidAddressError, "not an IPv6 address: #{@addr}"
|
329
371
|
end
|
330
372
|
return _reverse + ".ip6.int"
|
331
373
|
end
|
@@ -352,7 +394,7 @@ class IPAddr
|
|
352
394
|
|
353
395
|
# Returns a hash value used by Hash, Set, and Array classes
|
354
396
|
def hash
|
355
|
-
return ([@addr, @mask_addr].hash << 1) | (ipv4? ? 0 : 1)
|
397
|
+
return ([@addr, @mask_addr, @zone_id].hash << 1) | (ipv4? ? 0 : 1)
|
356
398
|
end
|
357
399
|
|
358
400
|
# Creates a Range object for the network address.
|
@@ -396,7 +438,7 @@ class IPAddr
|
|
396
438
|
when Integer
|
397
439
|
mask!(prefix)
|
398
440
|
else
|
399
|
-
raise InvalidPrefixError, "prefix must be an integer"
|
441
|
+
raise InvalidPrefixError, "prefix must be an integer: #{@addr}"
|
400
442
|
end
|
401
443
|
end
|
402
444
|
|
@@ -408,11 +450,42 @@ class IPAddr
|
|
408
450
|
af = "IPv4"
|
409
451
|
when Socket::AF_INET6
|
410
452
|
af = "IPv6"
|
453
|
+
zone_id = @zone_id.to_s
|
411
454
|
else
|
412
455
|
raise AddressFamilyError, "unsupported address family"
|
413
456
|
end
|
414
|
-
return sprintf("#<%s: %s:%s/%s>", self.class.name,
|
415
|
-
af, _to_string(@addr), _to_string(@mask_addr))
|
457
|
+
return sprintf("#<%s: %s:%s%s/%s>", self.class.name,
|
458
|
+
af, _to_string(@addr), zone_id, _to_string(@mask_addr))
|
459
|
+
end
|
460
|
+
|
461
|
+
# Returns the netmask in string format e.g. 255.255.0.0
|
462
|
+
def netmask
|
463
|
+
_to_string(@mask_addr)
|
464
|
+
end
|
465
|
+
|
466
|
+
# Returns the IPv6 zone identifier, if present.
|
467
|
+
# Raises InvalidAddressError if not an IPv6 address.
|
468
|
+
def zone_id
|
469
|
+
if @family == Socket::AF_INET6
|
470
|
+
@zone_id
|
471
|
+
else
|
472
|
+
raise InvalidAddressError, "not an IPv6 address"
|
473
|
+
end
|
474
|
+
end
|
475
|
+
|
476
|
+
# Returns the IPv6 zone identifier, if present.
|
477
|
+
# Raises InvalidAddressError if not an IPv6 address.
|
478
|
+
def zone_id=(zid)
|
479
|
+
if @family == Socket::AF_INET6
|
480
|
+
case zid
|
481
|
+
when nil, /\A%(\w+)\z/
|
482
|
+
@zone_id = zid
|
483
|
+
else
|
484
|
+
raise InvalidAddressError, "invalid zone identifier for address"
|
485
|
+
end
|
486
|
+
else
|
487
|
+
raise InvalidAddressError, "not an IPv6 address"
|
488
|
+
end
|
416
489
|
end
|
417
490
|
|
418
491
|
protected
|
@@ -424,11 +497,11 @@ class IPAddr
|
|
424
497
|
case family[0] ? family[0] : @family
|
425
498
|
when Socket::AF_INET
|
426
499
|
if addr < 0 || addr > IN4MASK
|
427
|
-
raise InvalidAddressError, "invalid address"
|
500
|
+
raise InvalidAddressError, "invalid address: #{@addr}"
|
428
501
|
end
|
429
502
|
when Socket::AF_INET6
|
430
503
|
if addr < 0 || addr > IN6MASK
|
431
|
-
raise InvalidAddressError, "invalid address"
|
504
|
+
raise InvalidAddressError, "invalid address: #{@addr}"
|
432
505
|
end
|
433
506
|
else
|
434
507
|
raise AddressFamilyError, "unsupported address family"
|
@@ -444,14 +517,21 @@ class IPAddr
|
|
444
517
|
def mask!(mask)
|
445
518
|
case mask
|
446
519
|
when String
|
447
|
-
|
520
|
+
case mask
|
521
|
+
when /\A(0|[1-9]+\d*)\z/
|
448
522
|
prefixlen = mask.to_i
|
523
|
+
when /\A\d+\z/
|
524
|
+
raise InvalidPrefixError, "leading zeros in prefix"
|
449
525
|
else
|
450
526
|
m = IPAddr.new(mask)
|
451
527
|
if m.family != @family
|
452
|
-
raise InvalidPrefixError, "address family is not same"
|
528
|
+
raise InvalidPrefixError, "address family is not same: #{@addr}"
|
453
529
|
end
|
454
530
|
@mask_addr = m.to_i
|
531
|
+
n = @mask_addr ^ m.instance_variable_get(:@mask_addr)
|
532
|
+
unless ((n + 1) & n).zero?
|
533
|
+
raise InvalidPrefixError, "invalid mask #{mask}: #{@addr}"
|
534
|
+
end
|
455
535
|
@addr &= @mask_addr
|
456
536
|
return self
|
457
537
|
end
|
@@ -461,13 +541,13 @@ class IPAddr
|
|
461
541
|
case @family
|
462
542
|
when Socket::AF_INET
|
463
543
|
if prefixlen < 0 || prefixlen > 32
|
464
|
-
raise InvalidPrefixError, "invalid length"
|
544
|
+
raise InvalidPrefixError, "invalid length: #{@addr}"
|
465
545
|
end
|
466
546
|
masklen = 32 - prefixlen
|
467
547
|
@mask_addr = ((IN4MASK >> masklen) << masklen)
|
468
548
|
when Socket::AF_INET6
|
469
549
|
if prefixlen < 0 || prefixlen > 128
|
470
|
-
raise InvalidPrefixError, "invalid length"
|
550
|
+
raise InvalidPrefixError, "invalid length: #{@addr}"
|
471
551
|
end
|
472
552
|
masklen = 128 - prefixlen
|
473
553
|
@mask_addr = ((IN6MASK >> masklen) << masklen)
|
@@ -511,11 +591,16 @@ class IPAddr
|
|
511
591
|
raise AddressFamilyError, "unsupported address family: #{family}"
|
512
592
|
end
|
513
593
|
end
|
514
|
-
prefix, prefixlen = addr.split('/')
|
594
|
+
prefix, prefixlen = addr.split('/', 2)
|
515
595
|
if prefix =~ /\A\[(.*)\]\z/i
|
516
596
|
prefix = $1
|
517
597
|
family = Socket::AF_INET6
|
518
598
|
end
|
599
|
+
if prefix =~ /\A(.*)(%\w+)\z/
|
600
|
+
prefix = $1
|
601
|
+
zone_id = $2
|
602
|
+
family = Socket::AF_INET6
|
603
|
+
end
|
519
604
|
# It seems AI_NUMERICHOST doesn't do the job.
|
520
605
|
#Socket.getaddrinfo(left, nil, Socket::AF_INET6, Socket::SOCK_STREAM, nil,
|
521
606
|
# Socket::AI_NUMERICHOST)
|
@@ -530,6 +615,7 @@ class IPAddr
|
|
530
615
|
@addr = in6_addr(prefix)
|
531
616
|
@family = Socket::AF_INET6
|
532
617
|
end
|
618
|
+
@zone_id = zone_id
|
533
619
|
if family != Socket::AF_UNSPEC && @family != family
|
534
620
|
raise AddressFamilyError, "address family mismatch"
|
535
621
|
end
|
@@ -560,8 +646,8 @@ class IPAddr
|
|
560
646
|
octets = m.captures
|
561
647
|
end
|
562
648
|
octets.inject(0) { |i, s|
|
563
|
-
(n = s.to_i) < 256 or raise InvalidAddressError, "invalid address"
|
564
|
-
s.match(/\A0./) and raise InvalidAddressError, "zero-filled number in IPv4 address is ambiguous"
|
649
|
+
(n = s.to_i) < 256 or raise InvalidAddressError, "invalid address: #{@addr}"
|
650
|
+
s.match(/\A0./) and raise InvalidAddressError, "zero-filled number in IPv4 address is ambiguous: #{@addr}"
|
565
651
|
i << 8 | n
|
566
652
|
}
|
567
653
|
end
|
@@ -578,19 +664,19 @@ class IPAddr
|
|
578
664
|
right = ''
|
579
665
|
when RE_IPV6ADDRLIKE_COMPRESSED
|
580
666
|
if $4
|
581
|
-
left.count(':') <= 6 or raise InvalidAddressError, "invalid address"
|
667
|
+
left.count(':') <= 6 or raise InvalidAddressError, "invalid address: #{@addr}"
|
582
668
|
addr = in_addr($~[4,4])
|
583
669
|
left = $1
|
584
670
|
right = $3 + '0:0'
|
585
671
|
else
|
586
672
|
left.count(':') <= ($1.empty? || $2.empty? ? 8 : 7) or
|
587
|
-
raise InvalidAddressError, "invalid address"
|
673
|
+
raise InvalidAddressError, "invalid address: #{@addr}"
|
588
674
|
left = $1
|
589
675
|
right = $2
|
590
676
|
addr = 0
|
591
677
|
end
|
592
678
|
else
|
593
|
-
raise InvalidAddressError, "invalid address"
|
679
|
+
raise InvalidAddressError, "invalid address: #{@addr}"
|
594
680
|
end
|
595
681
|
l = left.split(':')
|
596
682
|
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.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akinori MUSHA
|
8
8
|
- Hajimu UMEMOTO
|
9
|
-
autorequire:
|
10
|
-
bindir:
|
9
|
+
autorequire:
|
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: 2021-10-25 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,20 +21,16 @@ 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
|
-
post_install_message:
|
33
|
+
post_install_message:
|
80
34
|
rdoc_options: []
|
81
35
|
require_paths:
|
82
36
|
- lib
|
@@ -84,16 +38,15 @@ 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
|
-
|
96
|
-
signing_key:
|
48
|
+
rubygems_version: 3.2.22
|
49
|
+
signing_key:
|
97
50
|
specification_version: 4
|
98
51
|
summary: A class to manipulate an IP address in ruby
|
99
52
|
test_files: []
|
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__)
|