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

Fix nginx config task work with roles #72

Merged
merged 2 commits into from
Oct 5, 2014
Merged

Fix nginx config task work with roles #72

merged 2 commits into from
Oct 5, 2014

Conversation

hnatt
Copy link
Contributor

@hnatt hnatt commented Oct 5, 2014

Fixes #71

hnatt added 2 commits October 5, 2014 13:29
* fix a typo in puma_nginx role assignment;
* move role assignment to nginx.cap;
* show error message when puma_nginx role not set;
* add few lines about the role in README.
namespace :puma do
desc "Setup nginx configuration"
task :nginx_config do
fail ":puma_nginx role not set!" if roles(:puma_nginx).empty?
Copy link
Owner

Choose a reason for hiding this comment

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

Do we really need that ?
.empty? is defined in activesupport unless it an array.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But roles returns an Array, isn't it? ActiveSupport not involved.

Copy link
Owner

Choose a reason for hiding this comment

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

Right. But i think it better if we don't raise a error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With no :web or :puma_nginx roles defined, the user won't know why the config wasn't uploaded. The task will be executed like it's okay. But if you insist, I'll remove this line.

Copy link
Owner

Choose a reason for hiding this comment

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

Let keep it then.

seuros added a commit that referenced this pull request Oct 5, 2014
Fix nginx config task work with roles
@seuros seuros merged commit 0de6aec into seuros:master Oct 5, 2014
@hnatt hnatt deleted the fix-nginx-config-task branch October 5, 2014 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nginx_config fails quietly if puma_nginx role not set
2 participants