|
|
ef5169 |
From e8fde9cf1d77ee7e465c12e809501df8d27e8451 Mon Sep 17 00:00:00 2001
|
|
|
ef5169 |
From: Koichi ITO <koic.ito@gmail.com>
|
|
|
ef5169 |
Date: Sun, 4 Dec 2016 12:33:06 +0800
|
|
|
ef5169 |
Subject: [PATCH] Fix deprecated warnings in Ruby 2.4.0+
|
|
|
ef5169 |
|
|
|
ef5169 |
---
|
|
|
ef5169 |
lib/mail/attachments_list.rb | 2 +-
|
|
|
ef5169 |
lib/mail/multibyte/chars.rb | 4 ++--
|
|
|
ef5169 |
lib/mail/network/retriever_methods/test_retriever.rb | 2 +-
|
|
|
ef5169 |
3 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
ef5169 |
|
|
|
ef5169 |
diff --git a/lib/mail/attachments_list.rb b/lib/mail/attachments_list.rb
|
|
|
ef5169 |
index bb34a85..14fe31c 100644
|
|
|
ef5169 |
--- a/lib/mail/attachments_list.rb
|
|
|
ef5169 |
+++ b/lib/mail/attachments_list.rb
|
|
|
ef5169 |
@@ -30,7 +30,7 @@ module Mail
|
|
|
ef5169 |
# mail.attachments['test.png'].filename #=> 'test.png'
|
|
|
ef5169 |
# mail.attachments[1].filename #=> 'test.jpg'
|
|
|
ef5169 |
def [](index_value)
|
|
|
ef5169 |
- if index_value.is_a?(Fixnum)
|
|
|
ef5169 |
+ if index_value.is_a?(Integer)
|
|
|
ef5169 |
self.fetch(index_value)
|
|
|
ef5169 |
else
|
|
|
ef5169 |
self.select { |a| a.filename == index_value }.first
|
|
|
ef5169 |
diff --git a/lib/mail/multibyte/chars.rb b/lib/mail/multibyte/chars.rb
|
|
|
ef5169 |
index bb39897..2e431ca 100644
|
|
|
ef5169 |
--- a/lib/mail/multibyte/chars.rb
|
|
|
ef5169 |
+++ b/lib/mail/multibyte/chars.rb
|
|
|
ef5169 |
@@ -269,12 +269,12 @@ module Mail #:nodoc:
|
|
|
ef5169 |
@wrapped_string[*args] = replace_by
|
|
|
ef5169 |
else
|
|
|
ef5169 |
result = Unicode.u_unpack(@wrapped_string)
|
|
|
ef5169 |
- if args[0].is_a?(Fixnum)
|
|
|
ef5169 |
+ if args[0].is_a?(Integer)
|
|
|
ef5169 |
raise IndexError, "index #{args[0]} out of string" if args[0] >= result.length
|
|
|
ef5169 |
min = args[0]
|
|
|
ef5169 |
max = args[1].nil? ? min : (min + args[1] - 1)
|
|
|
ef5169 |
range = Range.new(min, max)
|
|
|
ef5169 |
- replace_by = [replace_by].pack('U') if replace_by.is_a?(Fixnum)
|
|
|
ef5169 |
+ replace_by = [replace_by].pack('U') if replace_by.is_a?(Integer)
|
|
|
ef5169 |
elsif args.first.is_a?(Range)
|
|
|
ef5169 |
raise RangeError, "#{args[0]} out of range" if args[0].min >= result.length
|
|
|
ef5169 |
range = args[0]
|
|
|
ef5169 |
diff --git a/lib/mail/network/retriever_methods/test_retriever.rb b/lib/mail/network/retriever_methods/test_retriever.rb
|
|
|
ef5169 |
index 9bb3e1a..dfbc909 100644
|
|
|
ef5169 |
--- a/lib/mail/network/retriever_methods/test_retriever.rb
|
|
|
ef5169 |
+++ b/lib/mail/network/retriever_methods/test_retriever.rb
|
|
|
ef5169 |
@@ -25,7 +25,7 @@ module Mail
|
|
|
ef5169 |
emails_index.reverse! if options[:what] == :last
|
|
|
ef5169 |
emails_index = case count = options[:count]
|
|
|
ef5169 |
when :all then emails_index
|
|
|
ef5169 |
- when Fixnum then emails_index[0, count]
|
|
|
ef5169 |
+ when Integer then emails_index[0, count]
|
|
|
ef5169 |
else
|
|
|
ef5169 |
raise 'Invalid count option value: ' + count.inspect
|
|
|
ef5169 |
end
|
|
|
ef5169 |
--
|
|
|
ef5169 |
2.11.0
|
|
|
ef5169 |
|