capsum 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/capsum/whenever.rb +4 -2
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.4
1
+ 0.4.0
@@ -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 #{application} --set \"environment=#{rails_env}&%s\"; fi"
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
- run "if [ -e #{current_path}/config/schedule.rb ]; then cd #{current_path}; RAILS_ENV=#{rails_env} whenever --update-crontab #{application} --load-file /dev/null; fi"
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.3.4
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-12 00:00:00 +08:00
13
+ date: 2011-04-21 00:00:00 +08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency