From 303441e33e8404ece4a76406f7a5c6e6b0db3d26 Mon Sep 17 00:00:00 2001 From: "Jonathan W. Zaleski" Date: Thu, 26 Jun 2014 15:19:42 -0400 Subject: [PATCH] Rename "args_for_retry" to "retry_args" Done for consistency w/ the addition of the "retry_args_for_exception" method --- README.md | 4 ++-- lib/resque/plugins/retry.rb | 4 ++-- test/test_jobs.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index db11e6f..e65fcd4 100644 --- a/README.md +++ b/README.md @@ -332,7 +332,7 @@ job should retry. ### Retry Arguments -You may override `args_for_retry`, which is passed the current +You may override `retry_args`, which is passed the current job arguments, to modify the arguments for the next retry attempt. ```ruby class DeliverViaSMSC @@ -340,7 +340,7 @@ class DeliverViaSMSC @queue = :mt_smsc_messages # retry using the emergency SMSC. - def self.args_for_retry(smsc_id, mt_message) + def self.retry_args(smsc_id, mt_message) [999, mt_message] end diff --git a/lib/resque/plugins/retry.rb b/lib/resque/plugins/retry.rb index 7d1bdd3..4ff1622 100644 --- a/lib/resque/plugins/retry.rb +++ b/lib/resque/plugins/retry.rb @@ -154,7 +154,7 @@ def retry_job_delegate # @return [Array] new job arguments # # @api public - def args_for_retry(*args) + def retry_args(*args) args end @@ -166,7 +166,7 @@ def args_for_retry(*args) # # @api public def retry_args_for_exception(exception, *args) - args_for_retry(*args) + retry_args(*args) end # Convenience method to test whether you may retry on a given diff --git a/test/test_jobs.rb b/test/test_jobs.rb index cc830f4..8524cea 100644 --- a/test/test_jobs.rb +++ b/test/test_jobs.rb @@ -105,7 +105,7 @@ class InheritTestWithMoreExtraJob < InheritTestWithExtraJob class RetryWithModifiedArgsJob < RetryDefaultsJob @queue = :testing - def self.args_for_retry(*args) + def self.retry_args(*args) args.each { |arg| arg << 'bar' } end end