resque 1.2.3 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of resque might be problematic. Click here for more details.

data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  *.gemspec
2
2
  pkg
3
+ nbproject
@@ -0,0 +1,14 @@
1
+ * Chris Wanstrath
2
+ * John Barnette
3
+ * Adam Cooke
4
+ * Rob Hanlon
5
+ * Jason Amster
6
+ * jgeiger
7
+ * Aaron Quint
8
+ * Ben VandenBos
9
+ * PJ Hyett
10
+ * Arthur Zapparoli
11
+ * Simon Rozet
12
+ * Brian P O'Rourke
13
+ * Dave Hoover
14
+ * Michael Dwan
data/HISTORY.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 1.3.0 (2010-01-11)
2
+
3
+ * Use Vegas for resque-web
4
+ * Web Bugfix: Show proper date/time value for failed_at on Failures
5
+ * Web Bugfix: Make the / route more flexible
6
+ * Add Resque::Server.tabs array (so plugins can add their own tabs)
7
+ * Start using [Semantic Versioning](http://semver.org/)
8
+
9
+ ## 1.2.4 (2009-12-15)
10
+
11
+ * Web Bugfix: fix key links on stat page
12
+
1
13
  ## 1.2.3 (2009-12-15)
2
14
 
3
15
  * Bugfix: Fixed `rand` seeding in child processes.
@@ -722,6 +722,8 @@ Meta
722
722
  * Chat: <irc://irc.freenode.net/resque>
723
723
  * Gems: <http://gemcutter.org/gems/resque>
724
724
 
725
+ This project uses [Semantic Versioning][sv].
726
+
725
727
 
726
728
  Author
727
729
  ------
@@ -731,3 +733,4 @@ Chris Wanstrath :: chris@ozmm.org :: @defunkt
731
733
  [0]: http://github.com/blog/542-introducing-resque
732
734
  [1]: http://help.github.com/forking/
733
735
  [2]: http://github.com/defunkt/resque/issues
736
+ [sv]: http://semver.org/
data/Rakefile CHANGED
@@ -40,6 +40,8 @@ begin
40
40
 
41
41
  gemspec.add_dependency "redis"
42
42
  gemspec.add_dependency "redis-namespace"
43
+ gemspec.add_dependency "vegas", ">=0.1.2"
44
+ gemspec.add_dependency "sinatra", ">=0.9.2"
43
45
  gemspec.add_development_dependency "jeweler"
44
46
  end
45
47
  rescue LoadError
@@ -1,44 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- __DIR__ = File.expand_path(File.dirname(__FILE__))
3
+ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
4
+ begin
5
+ require 'vegas'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'vegas'
9
+ end
10
+ require 'resque/server'
4
11
 
5
- if `which rackup`.empty?
6
- abort "** Can't find `rackup` in PATH."
7
- end
8
12
 
9
- if ARGV.include?('-h')
10
- puts <<-usage
11
- Usage: resque-web [ruby options] [rack options] [resque config]
12
-
13
- Starts a Resque front-end by way of `rackup`.
14
-
15
- Ruby options:
16
- -e, --eval LINE evaluate a LINE of code
17
- -d, --debug set debugging flags (set $DEBUG to true)
18
- -w, --warn turn warnings on for your script
19
- -I, --include PATH specify $LOAD_PATH (may be used more than once)
20
- -r, --require LIBRARY require the library, before executing your script
21
- Rack options:
22
- -s, --server SERVER serve using SERVER (webrick/mongrel)
23
- -o, --host HOST listen on HOST (default: 0.0.0.0)
24
- -p, --port PORT use PORT (default: 9292)
25
- -E, --env ENVIRONMENT use ENVIRONMENT for defaults (default: development)
26
- -D, --daemonize run daemonized in the background
27
- -P, --pid FILE file to store PID (default: rack.pid)
28
- Common options:
29
- -h, --help Show this message
30
- --version Show version
31
- usage
32
- else
33
- if !ENV['RESQUECONFIG']&&ARGV[-1]&&ARGV[-1][0]!=?-&&(ARGV[-2]?ARGV[-2][0]!=?-:true)
34
- if File.file?(file = File.expand_path(ARGV[-1]))
35
- ARGV.delete_at(-1)
36
- ENV['RESQUECONFIG'] = file
37
- else
38
- abort "** Can't find #{file}"
39
- end
40
- end
41
-
42
- ARGV.push File.expand_path(File.dirname(__FILE__) + "/../config.ru")
43
- exec "rackup", *ARGV
44
- end
13
+ Vegas::Runner.new(Resque::Server, 'resque-web', {
14
+ :before_run => lambda {|v|
15
+ path = (ENV['RESQUECONFIG'] || v.args.first).strip
16
+ load path if path
17
+ }
18
+ })
data/config.ru CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'logger'
3
3
 
4
- $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/lib')
4
+ $LOAD_PATH.unshift ::File.expand_path(::File.dirname(__FILE__) + '/lib')
5
5
  require 'resque/server'
6
6
 
7
7
  # Set the RESQUECONFIG env variable if you've a `resque.rb` or similar
8
8
  # config file you want loaded on boot.
9
- if ENV['RESQUECONFIG'] && File.exists?(File.expand_path(ENV['RESQUECONFIG']))
10
- load File.expand_path(ENV['RESQUECONFIG'])
9
+ if ENV['RESQUECONFIG'] && ::File.exists?(::File.expand_path(ENV['RESQUECONFIG']))
10
+ load ::File.expand_path(ENV['RESQUECONFIG'])
11
11
  end
12
12
 
13
13
  use Rack::ShowExceptions
data/deps.rip CHANGED
@@ -2,4 +2,5 @@ git://github.com/ezmobius/redis-rb.git eed200ad
2
2
  git://github.com/brianmario/yajl-ruby.git 0.6.3
3
3
  git://github.com/sinatra/sinatra.git 0.9.4
4
4
  git://github.com/rack/rack.git 1.0
5
+ git://github.com/quirkey/vegas.git v0.1.2
5
6
  rake
@@ -5,7 +5,7 @@ module Resque
5
5
  class Redis < Base
6
6
  def save
7
7
  data = {
8
- :failed_at => Time.now.to_s,
8
+ :failed_at => Time.now.strftime("%Y/%m/%d %H:%M:%S"),
9
9
  :payload => payload,
10
10
  :error => exception.to_s,
11
11
  :backtrace => exception.backtrace,
@@ -41,6 +41,10 @@ module Resque
41
41
  "<li #{class_if_current(dname)}><a href='#{url dname}'>#{name}</a></li>"
42
42
  end
43
43
 
44
+ def tabs
45
+ Resque::Server.tabs
46
+ end
47
+
44
48
  def redis_get_size(key)
45
49
  case Resque.redis.type(key)
46
50
  when 'none'
@@ -102,7 +106,7 @@ module Resque
102
106
  end
103
107
 
104
108
  # to make things easier on ourselves
105
- get "/" do
109
+ get "/?" do
106
110
  redirect url(:overview)
107
111
  end
108
112
 
@@ -170,5 +174,9 @@ module Resque
170
174
  def resque
171
175
  Resque
172
176
  end
177
+
178
+ def self.tabs
179
+ @tabs ||= ["Overview", "Working", "Failed", "Queues", "Workers", "Stats"]
180
+ end
173
181
  end
174
182
  end
@@ -11,12 +11,9 @@
11
11
  <body>
12
12
  <div class="header">
13
13
  <ul class='nav'>
14
- <%= tab "Overview" %>
15
- <%= tab "Working" %>
16
- <%= tab "Failed" %>
17
- <%= tab "Queues" %>
18
- <%= tab "Workers" %>
19
- <%= tab "Stats" %>
14
+ <% tabs.each do |tab_name| %>
15
+ <%= tab tab_name %>
16
+ <% end %>
20
17
  </ul>
21
18
  </div>
22
19
 
@@ -35,7 +35,7 @@
35
35
  </tr>
36
36
  <% end %>
37
37
  </table>
38
-
38
+
39
39
  <% elsif params[:id] == 'keys' %>
40
40
 
41
41
  <h1>Keys owned by <%= resque %></h1>
@@ -49,7 +49,7 @@
49
49
  <% for key in resque.keys.sort %>
50
50
  <tr>
51
51
  <th>
52
- <a href="/stats/keys/<%= key %>"><%= key %></a>
52
+ <a href="<%=u "/stats/keys/#{key}" %>"><%= key %></a>
53
53
  </th>
54
54
  <td><%= resque.redis.type key %></td>
55
55
  <td><%= redis_get_size key %></td>
@@ -1,3 +1,3 @@
1
1
  module Resque
2
- Version = '1.2.3'
2
+ Version = '1.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-15 00:00:00 -08:00
12
+ date: 2010-01-11 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -32,6 +32,26 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: "0"
34
34
  version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: vegas
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 0.1.2
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: sinatra
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 0.9.2
54
+ version:
35
55
  - !ruby/object:Gem::Dependency
36
56
  name: jeweler
37
57
  type: :development
@@ -55,6 +75,7 @@ extra_rdoc_files:
55
75
  files:
56
76
  - .gitignore
57
77
  - .kick
78
+ - CONTRIBUTORS
58
79
  - HISTORY.md
59
80
  - LICENSE
60
81
  - README.markdown