guard-resque-scheduler 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ ## 0.0.2
2
+
3
+ * Added ability to start/stop the scheduler thread
4
+
1
5
  ## 0.0.1
2
6
 
3
7
  * Initial release
@@ -10,15 +10,16 @@ module Guard
10
10
 
11
11
  # Allowable options are:
12
12
  # - :environment e.g. 'test'
13
- # - :task .e.g 'resque:work'
13
+ # - :task e.g 'resque:scheduler'
14
14
  # - :verbose e.g. true
15
- # - :trace e.g. true
15
+ # - :trace e.g. true
16
16
  # - :stop_signal e.g. :QUIT or :SIGQUIT
17
17
  def initialize(watchers = [], options = {})
18
18
  @options = options
19
19
  @pid = nil
20
20
  @stop_signal = options[:stop_signal] || DEFAULT_SIGNAL
21
21
  @options[:task] ||= DEFAULT_TASK
22
+ @first_start = true
22
23
  super
23
24
  end
24
25
 
@@ -28,7 +29,9 @@ module Guard
28
29
  UI.info [ cmd, env.map{|v| v.join('=')} ].join(' ')
29
30
 
30
31
  # Launch ResqueScheduler
31
- @pid = spawn(env, cmd)
32
+ @first_start ?
33
+ @first_start = false :
34
+ @pid = spawn(env, cmd)
32
35
  end
33
36
 
34
37
  def stop
@@ -55,7 +58,7 @@ module Guard
55
58
  # Called on Ctrl-Z signal
56
59
  def reload
57
60
  UI.info 'Restarting resque-scheduler...'
58
- restart
61
+ @pid ? stop : start
59
62
  end
60
63
 
61
64
  # Called on Ctrl-/ signal
@@ -95,4 +98,3 @@ module Guard
95
98
  end
96
99
  end
97
100
  end
98
-
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module ResqueSchedulerVersion
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-resque-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: