blazing-whenever 0.1.0 → 0.2.0
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.
data/README.md
CHANGED
@@ -23,11 +23,11 @@ options have precedence over recipe options.
|
|
23
23
|
# Options:
|
24
24
|
#
|
25
25
|
# :app (specify the app name, defaults to pwd name)
|
26
|
-
# :
|
26
|
+
# :targets (specify the targets this recipes runs on, can be array)
|
27
27
|
#
|
28
28
|
# Example:
|
29
29
|
|
30
|
-
recipe :update_crontab, :
|
30
|
+
recipe :update_crontab, :targets => :production
|
31
31
|
```
|
32
32
|
|
33
33
|
Authors
|
data/blazing-whenever.gemspec
CHANGED
@@ -4,7 +4,8 @@ class Blazing::Recipe::UpdateCrontab < Blazing::Recipe
|
|
4
4
|
|
5
5
|
def run(target_options = {})
|
6
6
|
super target_options
|
7
|
-
|
7
|
+
|
8
|
+
return if options[:targets] && !Array(options[:targets]).include?(target_options[:target_name])
|
8
9
|
info "updating crontab"
|
9
10
|
system "bundle exec whenever --update-crontab #{application} --set #{variables}"
|
10
11
|
end
|
data/spec/update_crontab_spec.rb
CHANGED
@@ -8,16 +8,18 @@ describe Blazing::Recipe::UpdateCrontab do
|
|
8
8
|
|
9
9
|
describe 'run' do
|
10
10
|
|
11
|
-
|
11
|
+
it 'should call whenever for updating crontab with params' do
|
12
12
|
@recipe = Blazing::Recipe::UpdateCrontab.new(:app => 'testing', :rails_env => 'development')
|
13
13
|
@recipe.stub(:info)
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'calls whenever for updating crontab with params' do
|
17
14
|
@recipe.should_receive(:system).with("bundle exec whenever --update-crontab testing --set environment=development")
|
18
15
|
@recipe.run
|
19
16
|
end
|
20
17
|
|
18
|
+
it 'should return early if targets is set and does not include current target' do
|
19
|
+
@recipe = Blazing::Recipe::UpdateCrontab.new(:app => 'testing', :rails_env => 'development', :targets => :production)
|
20
|
+
@recipe.should_not_receive(:system)
|
21
|
+
@recipe.run(:target_name => :development)
|
22
|
+
end
|
21
23
|
end
|
22
24
|
|
23
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blazing-whenever
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blazing
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.3.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.3.0
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: whenever
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|