From 2b09cbbe4407ce84b23450b27b2c3b6f35e8ef1b Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Wed, 17 Oct 2018 12:42:54 -0400 Subject: [PATCH] Shush various interpreter warnings --- app/models/action_mailbox/inbound_email/message_id.rb | 2 +- lib/action_mailbox/base.rb | 2 +- lib/action_mailbox/test_helper.rb | 2 +- test/unit/mailbox/routing_test.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/action_mailbox/inbound_email/message_id.rb b/app/models/action_mailbox/inbound_email/message_id.rb index 590dbfc4d7..a1ec5c0437 100644 --- a/app/models/action_mailbox/inbound_email/message_id.rb +++ b/app/models/action_mailbox/inbound_email/message_id.rb @@ -13,7 +13,7 @@ module ActionMailbox::InboundEmail::MessageId private def extract_message_id(raw_email) mail_from_source(raw_email.read).message_id - rescue => e + rescue # FIXME: Add logging with "Couldn't extract Message ID, so will generating a new random ID instead" end end diff --git a/lib/action_mailbox/base.rb b/lib/action_mailbox/base.rb index 103bbc544c..01ddc9c59b 100644 --- a/lib/action_mailbox/base.rb +++ b/lib/action_mailbox/base.rb @@ -49,7 +49,7 @@ class ActionMailbox::Base inbound_email.processing! yield inbound_email.delivered! unless inbound_email.bounced? - rescue => exception + rescue inbound_email.failed! raise end diff --git a/lib/action_mailbox/test_helper.rb b/lib/action_mailbox/test_helper.rb index b1d7af33f9..a74ea8ef57 100644 --- a/lib/action_mailbox/test_helper.rb +++ b/lib/action_mailbox/test_helper.rb @@ -9,7 +9,7 @@ module ActionMailbox end def create_inbound_email_from_mail(status: :processing, **mail_options) - raw_email = Tempfile.new.tap { |raw_email| raw_email.write Mail.new(mail_options).to_s } + raw_email = Tempfile.new.tap { |io| io.write Mail.new(mail_options).to_s } create_inbound_email(raw_email, status: status) end diff --git a/test/unit/mailbox/routing_test.rb b/test/unit/mailbox/routing_test.rb index 320dee6aab..f30199b7af 100644 --- a/test/unit/mailbox/routing_test.rb +++ b/test/unit/mailbox/routing_test.rb @@ -23,7 +23,7 @@ class ActionMailbox::Base::RoutingTest < ActiveSupport::TestCase test "delayed routing" do perform_enqueued_jobs only: ActionMailbox::RoutingJob do - another_inbound_email = create_inbound_email_from_fixture("welcome.eml", status: :pending) + create_inbound_email_from_fixture "welcome.eml", status: :pending assert_equal "Discussion: Let's debate these attachments", $processed end end