Merge pull request #33257 from utilum/ruby-warnings

Fix Ruby warnings tickled by the test suite
This commit is contained in:
Ryuta Kamizono 2018-06-30 17:58:02 +09:00 committed by GitHub
commit b3653aee94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

@ -1,22 +1,23 @@
# frozen_string_literal: true
require "queue_classic"
require "active_support/core_ext/module/redefine_method"
module QC
class Queue
def enqueue(method, *args)
redefine_method(:enqueue) do |method, *args|
receiver_str, _, message = method.rpartition(".")
receiver = eval(receiver_str)
receiver.send(message, *args)
end
def enqueue_in(seconds, method, *args)
redefine_method(:enqueue_in) do |seconds, method, *args|
receiver_str, _, message = method.rpartition(".")
receiver = eval(receiver_str)
receiver.send(message, *args)
end
def enqueue_at(not_before, method, *args)
redefine_method(:enqueue_at) do |not_before, method, *args|
receiver_str, _, message = method.rpartition(".")
receiver = eval(receiver_str)
receiver.send(message, *args)

View File

@ -1,11 +1,12 @@
# frozen_string_literal: true
require "sneakers"
require "active_support/core_ext/module/redefine_method"
module Sneakers
module Worker
module ClassMethods
def enqueue(msg)
redefine_method(:enqueue) do |msg|
worker = new(nil, nil, {})
worker.work(*msg)
end

View File

@ -8,5 +8,6 @@ class Visitor
has_secure_password(validations: false)
attr_accessor :password_digest, :password_confirmation
attr_accessor :password_digest
attr_reader :password_confirmation
end