lib/guard/delayed.rb in guard-delayed-0.3.1 vs lib/guard/delayed.rb in guard-delayed-0.3.2
- old
+ new
@@ -1,7 +1,6 @@
-require 'guard'
-require 'guard/plugin'
+require "guard/compat/plugin"
module Guard
class Delayed < Plugin
# Allowable options are:
@@ -14,17 +13,16 @@
# :monitor Start monitor process.
# :sleep-delay N Amount of time to sleep in seconds when no jobs are found
# :prefix NAME String to be prefixed to worker process names
def initialize(options = {})
- @options = options
super
+ @options = options
end
def start
run_cmd("stop")
- UI.info "Starting up delayed_job..."
parameters = "start"
parameters << " --min-priority #{@options[:min_priority]}" if @options[:min_priority]
parameters << " --max-priority #{@options[:max_priority]}" if @options[:max_priority]
parameters << " --number_of_workers=#{@options[:number_of_workers]}" if @options[:number_of_workers]
parameters << " --pid-dir=#{@options[:pid_dir]}" if @options[:pid_dir]
@@ -35,17 +33,15 @@
run_cmd(parameters)
end
# Called on Ctrl-C signal (when Guard quits)
def stop
- UI.info "Stopping delayed_job..."
run_cmd("stop")
end
# Called on Ctrl-Z signal
# This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
def reload
- UI.info "Restarting delayed_job..."
restart
end
# Called on Ctrl-/ signal
# This method should be principally used for long action like running all specs/tests/...