-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1629c5
commit ccddb80
Showing
5 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
lib/potassium/templates/application/recipes/asks/delayed_job.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
use_delayed_job = Ask.confirm "Do you want to use delayed jobs?" | ||
set(:delayed_job, use_delayed_job) |
17 changes: 17 additions & 0 deletions
17
lib/potassium/templates/application/recipes/delayed_job.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
if selected?(:delayed_job) | ||
gather_gem "daemons" | ||
gather_gem "delayed_job_active_record" | ||
|
||
delayed_job_config = "config.active_job.queue_adapter = :delayed_job" | ||
application(delayed_job_config) | ||
|
||
after(:gem_install) do | ||
generate "delayed_job:active_record" | ||
|
||
if selected?(:heroku) | ||
gsub_file "Procfile", /^.*$/m do |match| | ||
"#{match}worker: bundle exec rake jobs:work" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters