Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: seomoz/resque
base: master
...
head fork: processone/resque
  • 19 commits
  • 13 files changed
  • 0 commit comments
  • 4 contributors
Commits on Oct 26, 2011
Federico Romero federomero Add ' to "require resque/server" in README.markdown eb999e5
Commits on Feb 02, 2012
Terence Lee hone payload class is a string not a ruby constant
Fixes #500
deea948
Commits on Feb 07, 2012
Terence Lee hone Merge pull request #437 from federomero/patch-1
Add ' to "require resque/server" in README.markdown
ddfb5bb
Brian Morearty Add current directory to LOAD_PATH in demo for Ruby 1.9. 91c230a
Commits on Feb 09, 2012
Terence Lee hone fix rbx testing on travis 9b2125a
Terence Lee hone let's test on ruby 1.9.3 eef1125
Terence Lee hone test in both 1.8 and 1.9 mode of jruby 8aad2e1
Commits on Feb 17, 2012
Terence Lee hone add myself to gem author list c76e26a
Terence Lee hone Version 1.20.0 96bb1b2
Commits on Feb 28, 2012
Aaron Patterson tenderlove removing leftright, simplify test task 85167a6
Aaron Patterson tenderlove simplify reader and predicate method 5949eb3
Aaron Patterson tenderlove removing bundler and eliminating some test warnings 9624a63
Terence Lee hone Merge pull request #520 from tenderlove/warnings
removing bundler and eliminating some test warnings
e5deeed
Terence Lee hone Merge pull request #521 from tenderlove/simplify
simplify reader and predicate method
ea78953
Terence Lee hone Merge pull request #522 from tenderlove/testing
removing leftright, simplify test task
e4a2317
Aaron Patterson tenderlove using attr_writer rather than defining our own writers 25d11d8
Terence Lee hone Merge pull request #523 from tenderlove/writer
using attr_writer rather than defining our own writers
864bdea
Aaron Patterson tenderlove stop using global variables, eliminate warnings, reset monkey patch s…
…o that test time is correct
66a8b8b
Terence Lee hone Merge pull request #524 from tenderlove/mocking
eliminate global vars, warnings, and fix test time
4dbddcb
7 .travis.yml
View
@@ -1,5 +1,8 @@
rvm:
- 1.8.7
- 1.9.2
- - jruby
- - rbx-2.0
+ - 1.9.3
+ - jruby-18mode
+ - jruby-19mode
+ - rbx-18mode
+ - rbx-19mode
1  Gemfile
View
@@ -6,7 +6,6 @@ group :test do
gem "rake"
gem "rack-test", "~> 0.5"
gem "mocha", "~> 0.9.7"
- gem "leftright", :platforms => :mri_18
gem "yajl-ruby", "~>0.8.2", :platforms => :mri
gem "json", "~>1.5.3", :platforms => [:jruby, :rbx]
gem "hoptoad_notifier"
22 HISTORY.md
View
@@ -1,3 +1,25 @@
+## 1.20.0 (2012-02-17)
+
+* Fixed demos for ruby 1.9 (@BMorearty, #445)
+* Fixed `#requeue` tests (@hone, #500)
+* Web UI: optional trailing slashes of URLs (@elisehuard, #449)
+* Allow * to appear anywhere in queue list (@tapajos, #405, #407)
+* Wait for child with specific PID (@jacobkg)
+* #decode raise takes a string when re-raising as a different exception class (Trevor Hart)
+* Use Sinatra's `pubilc_folder` if it exists (@defunkt, #420, #421)
+* Assign the job's worker before calling `before_fork` (@quirkey)
+* Fix Resque::Helpers#constantize to work correctly on 1.9.2 (@rtlong)
+* Added before & after hooks for dequeue (@humancopy, #398)
+* daemonize support using `ENV["BACKGROUND"]` (@chrisleishman)
+* requeue and remove failed jobs by queue name (@evanwhalen)
+* `-r` flag for resque-web for redis connection (@gjastrab)
+* Added `Resque.enqueue_to`: allows you to specif the queue and still run hooks (@dan-g)
+* Web UI: Set the default encoding to UTF-8 (@elubow)
+* fix finding worker pids on JRuby (John Andrews + Andrew Grieser)
+* Added distributed redis support (@stipple)
+* Added better failure hooks (@raykrueger)
+* Added before & after dequeue hooks (@humancopy)
+
## 1.19.0 (2011-09-01)
* Added Airbrake (formerly Hoptoad) support.
2  README.markdown
View
@@ -491,7 +491,7 @@ HTTP basic auth).
### Rails 3
-You can also mount Resque on a subpath in your existing Rails 3 app by adding `require resque/server` to the top of your routes file or in an initializer then adding this to `routes.rb`:
+You can also mount Resque on a subpath in your existing Rails 3 app by adding `require 'resque/server'` to the top of your routes file or in an initializer then adding this to `routes.rb`:
``` ruby
mount Resque::Server.new, :at => "/resque"
17 Rakefile
View
@@ -20,18 +20,11 @@ require 'rake/testtask'
task :default => :test
-if command?(:rg)
- desc "Run the test suite with rg"
- task :test do
- Dir['test/**/*_test.rb'].each do |f|
- sh("rg #{f}")
- end
- end
-else
- Rake::TestTask.new do |test|
- test.libs << "test"
- test.test_files = FileList['test/**/*_test.rb']
- end
+Rake::TestTask.new do |test|
+ test.verbose = true
+ test.libs << "test"
+ test.libs << "lib"
+ test.test_files = FileList['test/**/*_test.rb']
end
if command? :kicker
1  examples/demo/Rakefile
View
@@ -1,4 +1,5 @@
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
+$LOAD_PATH.unshift File.dirname(__FILE__) unless $LOAD_PATH.include?(File.dirname(__FILE__))
require 'resque/tasks'
require 'job'
1  examples/demo/config.ru
View
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
require 'logger'
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
+$LOAD_PATH.unshift File.dirname(__FILE__) unless $LOAD_PATH.include?(File.dirname(__FILE__))
require 'app'
require 'resque/server'
23 lib/resque.rb
View
@@ -77,9 +77,7 @@ def before_first_fork(&block)
# Set a proc that will be called in the parent process before the
# worker forks for the first time.
- def before_first_fork=(before_first_fork)
- @before_first_fork = before_first_fork
- end
+ attr_writer :before_first_fork
# The `before_fork` hook will be run in the **parent** process
# before every job, so be careful- any changes you make will be
@@ -92,9 +90,7 @@ def before_fork(&block)
end
# Set the before_fork proc.
- def before_fork=(before_fork)
- @before_fork = before_fork
- end
+ attr_writer :before_fork
# The `after_fork` hook will be run in the child process and is passed
# the current job. Any changes you make, therefore, will only live as
@@ -107,25 +103,18 @@ def after_fork(&block)
end
# Set the after_fork proc.
- def after_fork=(after_fork)
- @after_fork = after_fork
- end
+ attr_writer :after_fork
def to_s
"Resque Client connected to #{redis_id}"
end
+ attr_accessor :inline
+
# If 'inline' is true Resque will call #perform method inline
# without queuing it into Redis and without any Resque callbacks.
# The 'inline' is false Resque jobs will be put in queue regularly.
- def inline?
- @inline
- end
- alias_method :inline, :inline?
-
- def inline=(inline)
- @inline = inline
- end
+ alias :inline? :inline
#
# queue manipulation
2  lib/resque/version.rb
View
@@ -1,3 +1,3 @@
module Resque
- Version = VERSION = '1.19.0'
+ Version = VERSION = '1.20.0'
end
2  lib/resque/worker.rb
View
@@ -89,6 +89,8 @@ def self.exists?(worker_id)
# removed without needing to restart workers using this method.
def initialize(*queues)
@queues = queues.map { |queue| queue.to_s.strip }
+ @shutdown = nil
+ @paused = nil
validate_queues
end
2  resque.gemspec
View
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
s.summary = "Resque is a Redis-backed queueing system."
s.homepage = "http://github.com/defunkt/resque"
s.email = "chris@ozmm.org"
- s.authors = [ "Chris Wanstrath" ]
+ s.authors = [ "Chris Wanstrath", "Terence Lee" ]
s.files = %w( README.markdown Rakefile LICENSE HISTORY.md )
s.files += Dir.glob("lib/**/*")
16 test/test_helper.rb
View
@@ -1,13 +1,13 @@
require 'rubygems'
-require 'bundler'
-Bundler.setup(:default, :test)
-Bundler.require(:default, :test)
dir = File.dirname(File.expand_path(__FILE__))
$LOAD_PATH.unshift dir + '/../lib'
$TESTING = true
require 'test/unit'
+require 'redis/namespace'
+require 'resque'
+
begin
require 'leftright'
rescue LoadError
@@ -147,12 +147,14 @@ def with_failure_backend(failure_backend, &block)
class Time
# Thanks, Timecop
class << self
+ attr_accessor :fake_time
+
alias_method :now_without_mock_time, :now
- def now_with_mock_time
- $fake_time || now_without_mock_time
+ def now
+ fake_time || now_without_mock_time
end
-
- alias_method :now, :now_with_mock_time
end
+
+ self.fake_time = nil
end
32 test/worker_test.rb
View
@@ -355,16 +355,22 @@ def self.exception
end
test "very verbose works in the afternoon" do
- require 'time'
- $last_puts = ""
- $fake_time = Time.parse("15:44:33 2011-03-02")
- singleton = class << @worker; self end
- singleton.send :define_method, :puts, lambda { |thing| $last_puts = thing }
+ begin
+ require 'time'
+ last_puts = ""
+ Time.fake_time = Time.parse("15:44:33 2011-03-02")
- @worker.very_verbose = true
- @worker.log("some log text")
+ @worker.extend(Module.new {
+ define_method(:puts) { |thing| last_puts = thing }
+ })
- assert_match /\*\* \[15:44:33 2011-03-02\] \d+: some log text/, $last_puts
+ @worker.very_verbose = true
+ @worker.log("some log text")
+
+ assert_match /\*\* \[15:44:33 2011-03-02\] \d+: some log text/, last_puts
+ ensure
+ Time.fake_time = nil
+ end
end
test "Will call an after_fork hook after forking" do
@@ -385,8 +391,8 @@ def self.exception
test "requeue failed queue" do
queue = 'good_job'
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, :payload => {'class' => GoodJob})
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => 'some_job', :payload => {'class' => SomeJob})
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, :payload => {'class' => 'GoodJob'})
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => 'some_job', :payload => {'class' => 'SomeJob'})
Resque::Failure.requeue_queue(queue)
assert Resque::Failure.all(0).has_key?('retried_at')
assert !Resque::Failure.all(1).has_key?('retried_at')
@@ -395,9 +401,9 @@ def self.exception
test "remove failed queue" do
queue = 'good_job'
queue2 = 'some_job'
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, :payload => {'class' => GoodJob})
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue2), :queue => queue2, :payload => {'class' => SomeJob})
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, :payload => {'class' => GoodJob})
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, :payload => {'class' => 'GoodJob'})
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue2), :queue => queue2, :payload => {'class' => 'SomeJob'})
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, :payload => {'class' => 'GoodJob'})
Resque::Failure.remove_queue(queue)
assert_equal queue2, Resque::Failure.all(0)['queue']
assert_equal 1, Resque::Failure.count

No commit comments for this range

Something went wrong with that request. Please try again.