Skip to content

Commit

Permalink
Limit what we require from ActiveSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
albus522 committed Dec 29, 2015
1 parent 72ea5ec commit 015fb73
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/delayed/backend/shared_spec.rb
@@ -1,6 +1,6 @@
require File.expand_path('../../../../spec/sample_jobs', __FILE__)

require 'active_support/core_ext'
require 'active_support/core_ext/numeric/time'

shared_examples_for 'a delayed_job backend' do
let(:worker) { Delayed::Worker.new }
Expand Down
8 changes: 4 additions & 4 deletions lib/delayed/performable_method.rb
@@ -1,11 +1,7 @@
require 'active_support/core_ext/module/delegation'

module Delayed
class PerformableMethod
attr_accessor :object, :method_name, :args

delegate :method, :to => :object

def initialize(object, method_name, args)
raise NoMethodError, "undefined method `#{method_name}' for #{object.inspect}" unless object.respond_to?(method_name, true)

Expand All @@ -30,6 +26,10 @@ def perform
object.send(method_name, *args) if object
end

def method(sym)
object.method(sym)
end

def method_missing(symbol, *args)
object.send(symbol, *args)
end
Expand Down
5 changes: 2 additions & 3 deletions lib/delayed/worker.rb
@@ -1,8 +1,7 @@
require 'timeout'
require 'active_support/dependencies'
require 'active_support/core_ext/numeric/time'
require 'active_support/core_ext/class/attribute_accessors'
require 'active_support/core_ext/kernel'
require 'active_support/core_ext/enumerable'
require 'logger'
require 'benchmark'

Expand Down Expand Up @@ -172,7 +171,7 @@ def start # rubocop:disable CyclomaticComplexity, PerceivedComplexity
end
end

count = @result.sum
count = @result[0] + @result[1]

if count.zero?
if self.class.exit_on_complete
Expand Down
1 change: 0 additions & 1 deletion lib/delayed_job.rb
@@ -1,4 +1,3 @@
require 'active_support'
require 'delayed/compatibility'
require 'delayed/exceptions'
require 'delayed/message_sending'
Expand Down

0 comments on commit 015fb73

Please sign in to comment.