mina-whenever-env 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mina/whenever/tasks.rb +5 -3
- data/lib/mina/whenever/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bab4d892005ed9797e5561f9412c5408a70b4a8166eb9874f515d12f767f605
|
4
|
+
data.tar.gz: 5e07713827bf9b239a2b2c77fd5e0ff3656f1743b0814eb14e857582c5d46423
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa3d9e379a6e9ba3c3a4d859b69768e28974066ed22609ad071f617fb892c4897b71ba1452dd663f8bac7d65c7ecf241a7c701dea1b1727a1ebec245c3cba6f7
|
7
|
+
data.tar.gz: 1f859d668ebca696ba5f6662e22fb9e369b3f906229c68291f141c472e393fdea86bae3f13089c6b22dfb4ce4e12911e914afcc67b3aa66683537113a7021d14
|
data/lib/mina/whenever/tasks.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
set :whenever_environment_variable, -> { fetch(:environment_variable) || 'RAILS_ENV' }
|
2
|
+
set :whenever_environment, -> { fetch(fetch(:environment_variable).downcase.to_sym) }
|
1
3
|
set :whenever_name, -> { "#{fetch(:application_name)}_#{fetch(:rails_env)}" }
|
2
4
|
|
3
5
|
namespace :whenever do
|
@@ -5,7 +7,7 @@ namespace :whenever do
|
|
5
7
|
task clear: :remote_environment do
|
6
8
|
comment "Clear contrab for #{fetch(:whenever_name)}"
|
7
9
|
in_path fetch(:current_path) do
|
8
|
-
command "#{fetch(:bundle_bin)} exec whenever --clear-crontab #{fetch(:whenever_name)}
|
10
|
+
command "#{fetch(:whenever_environment_variable)}=#{fetch(:rails_env)} #{fetch(:bundle_bin)} exec whenever --clear-crontab #{fetch(:whenever_name)}"
|
9
11
|
end
|
10
12
|
end
|
11
13
|
|
@@ -13,7 +15,7 @@ namespace :whenever do
|
|
13
15
|
task update: :remote_environment do
|
14
16
|
comment "Update crontab for #{fetch(:whenever_name)}"
|
15
17
|
in_path fetch(:current_path) do
|
16
|
-
command "#{fetch(:bundle_bin)} exec whenever --update-crontab #{fetch(:whenever_name)}
|
18
|
+
command "#{fetch(:whenever_environment_variable)}=#{fetch(:rails_env)} #{fetch(:bundle_bin)} exec whenever --update-crontab #{fetch(:whenever_name)}"
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
@@ -21,7 +23,7 @@ namespace :whenever do
|
|
21
23
|
task write: :remote_environment do
|
22
24
|
comment "Write crontab for #{fetch(:whenever_name)}"
|
23
25
|
in_path fetch(:current_path) do
|
24
|
-
command "#{fetch(:bundle_bin)} exec whenever --write-crontab #{fetch(:whenever_name)}
|
26
|
+
command "#{fetch(:whenever_environment_variable)}=#{fetch(:rails_env)} #{fetch(:bundle_bin)} exec whenever --write-crontab #{fetch(:whenever_name)}"
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|