|
1 | 1 | #!/usr/bin/env ruby
|
2 | 2 |
|
3 | 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' |
11 |
| - |
12 | 4 |
|
13 |
| -Vegas::Runner.new(Resque::Server, 'resque-web', { |
14 |
| - :before_run => lambda {|v| |
15 |
| - path = (ENV['RESQUECONFIG'] || v.args.first) |
16 |
| - load path.to_s.strip if path |
17 |
| - } |
18 |
| -}) do |runner, opts, app| |
19 |
| - opts.on('-N NAMESPACE', "--namespace NAMESPACE", "set the Redis namespace") {|namespace| |
20 |
| - runner.logger.info "Using Redis namespace '#{namespace}'" |
21 |
| - Resque.redis.namespace = namespace |
22 |
| - } |
23 |
| - opts.on('-r redis-connection', "--redis redis-connection", "set the Redis connection string") {|redis_conf| |
24 |
| - runner.logger.info "Using Redis connection '#{redis_conf}'" |
25 |
| - Resque.redis = redis_conf |
26 |
| - } |
27 |
| - opts.on('-a url-prefix', "--append url-prefix", "set reverse_proxy friendly prefix to links") {|url_prefix| |
28 |
| - runner.logger.info "Using URL Prefix '#{url_prefix}'" |
29 |
| - Resque::Server.url_prefix = url_prefix |
30 |
| - } |
| 5 | +if !!(RUBY_PLATFORM =~ /(mingw|bccwin|wince|mswin32)/i) |
| 6 | + begin |
| 7 | + require 'win32/process' |
| 8 | + rescue |
| 9 | + puts "Sorry, in order to use resque-web on Windows you need the win32-process gem:", |
| 10 | + "gem install win32-process" |
| 11 | + end |
31 | 12 | end
|
| 13 | +require 'resque/web_runner' |
| 14 | + |
| 15 | +Resque::WebRunner.new(*ARGV) |
0 commit comments