guard-resque 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ .rvmrc
data/README.markdown CHANGED
@@ -40,6 +40,7 @@ You can customize the resque task via the following options:
40
40
  * `environment`: the rails environment to run the workers in (defaults to `"development"`)
41
41
  * `task`: the name of the rake task to use (defaults to `"resque:work"`)
42
42
  * `queue`: the resque queue to run (defaults to `"*"`)
43
+ * `count`: the number of workers to include (defaults to `"1"`)
43
44
  * `verbose`: whether to use verbose logging (defaults to `false`)
44
45
  * `trace`: whether to include `--trace` on the rake command (defaults to `false`)
45
46
  * `stop_signal`: how to kill the process when restarting (defaults to `KILL`)
data/lib/guard/resque.rb CHANGED
@@ -8,6 +8,7 @@ module Guard
8
8
  # :environment e.g. 'test'
9
9
  # :task .e.g 'resque:work'
10
10
  # :queue e.g. '*'
11
+ # :count e.g. 3
11
12
  # :verbose e.g. true
12
13
  # :trace e.g. true
13
14
  # :stop_signal e.g. KILL
@@ -70,6 +71,9 @@ module Guard
70
71
  # queue setting
71
72
  command << "QUEUE=#{@options[:queue] || '*'} "
72
73
 
74
+ #count setting
75
+ command << "COUNT=#{@options[:count] || '1'} "
76
+
73
77
  # verbose setting
74
78
  command << "VVERBOSE=1 " if @options[:verbose]
75
79
 
@@ -1,3 +1,9 @@
1
+ # other available options
2
+ # :task (defaults to resque:work)
3
+ # :verbose
4
+ # :trace
5
+ # :queue (defaults to "*")
6
+ # :count (defaults to 1)
1
7
  guard 'resque', :environment => 'development' do
2
8
  watch(%r{^app/(.+)\.rb})
3
9
  watch(%r{^lib/(.+)\.rb})
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module ResqueVersion
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -16,5 +16,36 @@ describe Guard::Resque do
16
16
  subject.start
17
17
  Dir.glob("tmp/pids/resque*.pid").should_not be_empty
18
18
  end
19
+
20
+ it "should accept environment option" do
21
+ obj = Guard::Resque.new [], :environment => 'foo'
22
+ obj.send(:cmd).should match /RAILS_ENV=foo/
23
+ end
24
+
25
+ it "should accept queue option" do
26
+ obj = Guard::Resque.new [], :queue => 'foo'
27
+ obj.send(:cmd).should match /QUEUE=foo/
28
+ end
29
+
30
+ it "should accept count option" do
31
+ obj = Guard::Resque.new [], :count => 2
32
+ obj.send(:cmd).should match /COUNT=2/
33
+ end
34
+
35
+ it "should accept verbose option" do
36
+ obj = Guard::Resque.new [], :verbose => true
37
+ obj.send(:cmd).should match /VVERBOSE=1/
38
+ end
39
+
40
+ it "should accept trace option" do
41
+ obj = Guard::Resque.new [], :trace => true
42
+ obj.send(:cmd).should match /--trace/
43
+ end
44
+
45
+ it "should accept task option" do
46
+ obj = Guard::Resque.new [], :task => 'environment foo'
47
+ obj.send(:cmd).should match /environment foo/
48
+ obj.send(:cmd).should_not match /resque:work/
49
+ end
19
50
  end
20
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-resque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-09-29 00:00:00.000000000Z
13
+ date: 2011-10-05 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: guard
17
- requirement: &2152972120 !ruby/object:Gem::Requirement
17
+ requirement: &2153606040 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0.8'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2152972120
25
+ version_requirements: *2153606040
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: resque
28
- requirement: &2152971620 !ruby/object:Gem::Requirement
28
+ requirement: &2153605480 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2152971620
36
+ version_requirements: *2153605480
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &2152970780 !ruby/object:Gem::Requirement
39
+ requirement: &2153604860 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.0.10
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2152970780
47
+ version_requirements: *2153604860
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rspec
50
- requirement: &2152970100 !ruby/object:Gem::Requirement
50
+ requirement: &2153604360 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 2.5.0
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2152970100
58
+ version_requirements: *2153604360
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: guard-rspec
61
- requirement: &2152969320 !ruby/object:Gem::Requirement
61
+ requirement: &2153603900 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 0.2.0
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2152969320
69
+ version_requirements: *2153603900
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: guard-bundler
72
- requirement: &2152968740 !ruby/object:Gem::Requirement
72
+ requirement: &2153603440 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,7 +77,7 @@ dependencies:
77
77
  version: 0.1.1
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *2152968740
80
+ version_requirements: *2153603440
81
81
  description: Guard::Resque automatically starts/stops/restarts resque worker
82
82
  email:
83
83
  - railsjedi@gmail.com
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: 1.3.6
119
119
  requirements: []
120
120
  rubyforge_project: guard-resque
121
- rubygems_version: 1.8.6
121
+ rubygems_version: 1.8.10
122
122
  signing_key:
123
123
  specification_version: 3
124
124
  summary: guard gem for resque