Permalink
Browse files

fail if use soap4r-ruby1.9-2.0.0 (@@handlers conflict)

  • Loading branch information...
1 parent 33e616b commit f4fd698c2e6a6c83ce00c1605be8d0f6c405140e @arion committed Jun 24, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/stalker.rb
View
@@ -22,8 +22,8 @@ def enqueue(job, args={}, opts={})
end
def job(j, &block)
- @@handlers ||= {}
- @@handlers[j] = block
+ @@stalk_handlers ||= {}
+ @@stalk_handlers[j] = block
end
def before(&block)
@@ -39,13 +39,13 @@ class NoJobsDefined < RuntimeError; end
class NoSuchJob < RuntimeError; end
def prep(jobs=nil)
- raise NoJobsDefined unless defined?(@@handlers)
+ raise NoJobsDefined unless defined?(@@stalk_handlers)
@@error_handler = nil unless defined?(@@error_handler)
jobs ||= all_jobs
jobs.each do |job|
- raise(NoSuchJob, job) unless @@handlers[job]
+ raise(NoSuchJob, job) unless @@stalk_handlers[job]
end
log "Working #{jobs.size} jobs: [ #{jobs.join(' ')} ]"
@@ -70,7 +70,7 @@ def work_one_job
job = beanstalk.reserve
name, args = JSON.parse job.body
log_job_begin(name, args)
- handler = @@handlers[name]
+ handler = @@stalk_handlers[name]
raise(NoSuchJob, name) unless handler
begin
@@ -173,15 +173,15 @@ def exception_message(e)
end
def all_jobs
- @@handlers.keys
+ @@stalk_handlers.keys
end
def error_handler
@@error_handler
end
def clear!
- @@handlers = nil
+ @@stalk_handlers = nil
@@before_handlers = nil
@@error_handler = nil
end

0 comments on commit f4fd698

Please sign in to comment.