Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capistrano v3.1 compatible improve: dependency solve #22

Merged
merged 1 commit into from
Dec 30, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion capistrano3-puma.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Gem::Specification.new do |spec|
spec.files = `git ls-files`.split($/)
spec.require_paths = ['lib']

spec.add_dependency 'capistrano', '~> 3.0.0'
spec.add_dependency 'capistrano', '~> 3.0'

end
5 changes: 1 addition & 4 deletions lib/capistrano/tasks/puma.cap
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
namespace :deploy do
after :finished, 'puma:smart_restart'
end

namespace :load do
task :defaults do
set :puma_role, :app
Expand Down Expand Up @@ -91,6 +87,7 @@ namespace :puma do
invoke 'puma:restart'
end
end
after 'deploy:finished', 'puma:smart_restart'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the advantage of this refactoring ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. in capistrano 3.1, after and before will immediately looking for the given task(see commit capistrano/capistrano@a58bb3b). That makes the after hook must be invoked after the task declared
  2. make 4 lines to 1 line
  3. After capistrano 3.1, you can write after 'deploy:finished', :smart_restart here(without current namespace 'puma'). But for the backward compatible, still use full name here


def puma_workers
fetch(:puma_workers) || 0
Expand Down