mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 13:27:09 +02:00
42 lines
1.1 KiB
Diff
42 lines
1.1 KiB
Diff
Patch-Source: https://github.com/ipaddress-gem/ipaddress/pull/106
|
|
--
|
|
From c04ad33891ef2d183a0135ef02894b30659318ba Mon Sep 17 00:00:00 2001
|
|
From: Adam21e <Adam21e@users.noreply.github.com>
|
|
Date: Wed, 5 Dec 2018 11:19:00 +1100
|
|
Subject: [PATCH] convert Fixnum to Integer for Ruby >= 2.4
|
|
|
|
---
|
|
lib/ipaddress/prefix.rb | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/lib/ipaddress/prefix.rb b/lib/ipaddress/prefix.rb
|
|
index f3d585d..fe3efc1 100644
|
|
--- a/lib/ipaddress/prefix.rb
|
|
+++ b/lib/ipaddress/prefix.rb
|
|
@@ -55,10 +55,10 @@ def <=>(oth)
|
|
|
|
#
|
|
# Sums two prefixes or a prefix to a
|
|
- # number, returns a Fixnum
|
|
+ # number, returns a Integer
|
|
#
|
|
def +(oth)
|
|
- if oth.is_a? Fixnum
|
|
+ if oth.is_a? Integer
|
|
self.prefix + oth
|
|
else
|
|
self.prefix + oth.prefix
|
|
@@ -68,10 +68,10 @@ def +(oth)
|
|
#
|
|
# Returns the difference between two
|
|
# prefixes, or a prefix and a number,
|
|
- # as a Fixnum
|
|
+ # as a Integer
|
|
#
|
|
def -(oth)
|
|
- if oth.is_a? Fixnum
|
|
+ if oth.is_a? Integer
|
|
self.prefix - oth
|
|
else
|
|
(self.prefix - oth.prefix).abs
|