Skip to content

Commit 6cb3bde

Browse files
committed
Merge branch 'master' into 2.0
Conflicts: HISTORY.md
2 parents 3d3bec4 + cea6b3e commit 6cb3bde

File tree

13 files changed

+65
-68
lines changed

13 files changed

+65
-68
lines changed

CONTRIBUTORS

Lines changed: 0 additions & 32 deletions
This file was deleted.

HISTORY.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
* Resque now uses Unix Epoch Timestamps exclusively.
44

5+
## 1.8.3 (2010-05-17)
6+
7+
* Depend on redis-rb ~> 1.0.7
8+
9+
## 1.8.2 (2010-05-03)
10+
11+
* Bugfix: Include "tasks/" dir in RubyGem
12+
13+
## 1.8.1 (2010-04-29)
14+
15+
* Bugfix: Multiple failure backend did not support requeue-ing failed jobs
16+
* Bugfix: Fix /failed when error has no backtrace
17+
* Bugfix: Add `Redis::DistRedis` as a valid client
18+
519
## 1.8.0 (2010-04-07)
620

721
* Jobs that never complete due to killed worker are now failed.

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ For a list of available plugins see
662662

663663
If you'd like to write your own plugin, or want to customize Resque
664664
using hooks (such as `Resque.after_fork`), see
665-
[docs/HOOKS.md](http://github.com/defunkt/resque/blob/master/HOOKS.md).
665+
[docs/HOOKS.md](http://github.com/defunkt/resque/blob/master/docs/HOOKS.md).
666666

667667
To clear all hooks, set nil or false:
668668

Rakefile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $LOAD_PATH.unshift 'lib'
99
require 'resque/tasks'
1010

1111
def command?(command)
12-
system("type #{command} > /dev/null")
12+
system("type #{command} > /dev/null 2>&1")
1313
end
1414

1515

@@ -37,19 +37,11 @@ end
3737

3838

3939
#
40-
# Gem
40+
# Install
4141
#
4242

4343
task :install => [ 'redis:install', 'dtach:install' ]
4444

45-
begin
46-
require 'mg'
47-
MG.new("resque.gemspec")
48-
rescue LoadError
49-
warn "mg not available."
50-
warn "Install it with: gem i mg"
51-
end
52-
5345

5446
#
5547
# Documentation
@@ -58,7 +50,6 @@ end
5850
begin
5951
require 'sdoc_helpers'
6052
rescue LoadError
61-
puts "sdoc support not enabled. Please gem install sdoc-helpers."
6253
end
6354

6455

@@ -67,9 +58,11 @@ end
6758
#
6859

6960
desc "Push a new version to Gemcutter"
70-
task :publish => "gem:publish" do
61+
task :publish do
7162
require 'resque/version'
7263

64+
sh "gem build resque.gemspec"
65+
sh "gem push resque-#{Resque::Version}.gem"
7366
sh "git tag v#{Resque::Version}"
7467
sh "git push origin v#{Resque::Version}"
7568
sh "git push origin master"

lib/resque.rb

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,15 @@ module Resque
2929
# 3. An instance of `Redis`, `Redis::Client`, `Redis::DistRedis`,
3030
# or `Redis::Namespace`.
3131
def redis=(server)
32-
case server
33-
when String
32+
if server.respond_to? :split
3433
host, port, db = server.split(':')
3534
redis = Redis.new(:host => host, :port => port,
3635
:thread_safe => true, :db => db)
3736
@redis = Redis::Namespace.new(:resque, :redis => redis)
38-
when Redis, Redis::Client, Redis::DistRedis
39-
@redis = Redis::Namespace.new(:resque, :redis => server)
40-
when Redis::Namespace
41-
@redis = server
37+
elsif server.respond_to? :namespace=
38+
@redis = server
4239
else
43-
raise "I don't know what to do with #{server.inspect}"
40+
@redis = Redis::Namespace.new(:resque, :redis => server)
4441
end
4542
end
4643

@@ -87,8 +84,8 @@ def before_fork=(block)
8784
end
8885

8986
# The `after_fork` hook will be run in the child process and is passed
90-
# the current job. Any changes you make, therefor, will only live as
91-
# long as the job currently being processes.
87+
# the current job. Any changes you make, therefore, will only live as
88+
# long as the job currently being processed.
9289
#
9390
# Call with a block to set the hook.
9491
# Call with no arguments to return the hook.
@@ -125,7 +122,7 @@ def pop(queue)
125122
decode redis.lpop("queue:#{queue}")
126123
end
127124

128-
# Returns an int representing the size of a queue.
125+
# Returns an integer representing the size of a queue.
129126
# Queue name should be a string.
130127
def size(queue)
131128
redis.llen("queue:#{queue}").to_i
@@ -276,7 +273,8 @@ def info
276273
:workers => workers.size.to_i,
277274
:working => working.size,
278275
:failed => Stat[:failed],
279-
:servers => [redis.server]
276+
:servers => [redis.server],
277+
:environment => defined?(RAILS_ENV) ? RAILS_ENV : (ENV['RACK_ENV'] || 'development')
280278
}
281279
end
282280

lib/resque/failure/hoptoad.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def xml
8383
x.url "http://github.com/defunkt/resque"
8484
end
8585
x.error do
86-
x.class exception.class.name
86+
x.tag! "class", exception.class.name
8787
x.message "#{exception.class.name}: #{exception.message}"
8888
x.backtrace do
8989
fill_in_backtrace_lines(x)
@@ -109,7 +109,7 @@ def xml
109109
end
110110

111111
def fill_in_backtrace_lines(x)
112-
exception.backtrace.each do |unparsed_line|
112+
Array(exception.backtrace).each do |unparsed_line|
113113
_, file, number, method = unparsed_line.match(INPUT_FORMAT).to_a
114114
x.line :file => file,:number => number
115115
end

lib/resque/failure/redis.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def save
99
:payload => payload,
1010
:exception => exception.class.to_s,
1111
:error => exception.to_s,
12-
:backtrace => exception.backtrace,
12+
:backtrace => Array(exception.backtrace),
1313
:worker => worker.to_s,
1414
:queue => queue
1515
}

lib/resque/job.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ def perform
140140
else
141141
lambda do
142142
job.send(hook, *job_args) do
143-
job.perform(*job_args)
143+
result = job.perform(*job_args)
144144
job_was_performed = true
145+
result
145146
end
146147
end
147148
end

lib/resque/server/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def app
1111

1212
def self.should_respond_with_success
1313
test "should respond with success" do
14-
assert last_response.ok?
14+
assert last_response.ok?, last_response.errors
1515
end
1616
end
1717
end

lib/resque/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Resque
2-
Version = '1.8.0'
2+
Version = '1.8.5'
33
end

0 commit comments

Comments
 (0)