capsum 0.3.4 → 0.4.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/VERSION +1 -1
- data/lib/capsum/whenever.rb +4 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/lib/capsum/whenever.rb
CHANGED
@@ -4,6 +4,7 @@ Capistrano::Configuration.instance(true).load do
|
|
4
4
|
namespace :whenever do
|
5
5
|
desc 'Update the crontab'
|
6
6
|
task :update do
|
7
|
+
identifier = fetch(:whenever_identifier, deploy_to)
|
7
8
|
find_servers(:roles => :app).each do |server|
|
8
9
|
whenever_settings = server.options[:whenever]
|
9
10
|
if whenever_settings
|
@@ -12,7 +13,7 @@ Capistrano::Configuration.instance(true).load do
|
|
12
13
|
variables = whenever_settings.map{ |key, value| "#{key}=#{value}" }.join("&")
|
13
14
|
end
|
14
15
|
|
15
|
-
command = "if [ -e #{current_path}/config/schedule.rb ]; then cd #{current_path}; RAILS_ENV=#{rails_env} whenever --update-crontab #{
|
16
|
+
command = "if [ -e #{current_path}/config/schedule.rb ]; then cd #{current_path}; RAILS_ENV=#{rails_env} whenever --update-crontab #{identifier} --set \"environment=#{rails_env}&%s\"; fi"
|
16
17
|
run (command % variables), :hosts => server.host
|
17
18
|
end
|
18
19
|
end
|
@@ -20,7 +21,8 @@ Capistrano::Configuration.instance(true).load do
|
|
20
21
|
|
21
22
|
desc 'Cleanup the crontab'
|
22
23
|
task :cleanup, :roles => :app do
|
23
|
-
|
24
|
+
identifier = fetch(:whenever_identifier, deploy_to)
|
25
|
+
run "if [ -e #{current_path}/config/schedule.rb ]; then cd #{current_path}; RAILS_ENV=#{rails_env} whenever --update-crontab #{identifier} --load-file /dev/null; fi"
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: capsum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.4.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sunteya
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-21 00:00:00 +08:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|