-
Notifications
You must be signed in to change notification settings - Fork 240
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
Fixed watchdir option #287
Conversation
@@ -22,7 +30,9 @@ def _parts | |||
parts << _guard_formatter | |||
parts << "--failure-exit-code #{FAILURE_EXIT_CODE}" | |||
parts << options[:cmd_additional_args] || "" | |||
parts << paths.join(' ') | |||
paths.map do |dir, specs| | |||
"cd #{dir} && #{parts.join(' ')} #{specs.join(' ')}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
@@ -22,6 +22,11 @@ def _parts | |||
parts << _guard_formatter | |||
parts << "--failure-exit-code #{FAILURE_EXIT_CODE}" | |||
parts << options[:cmd_additional_args] || "" | |||
if chdir = options[:chdir] | |||
paths.each do |path| | |||
path.sub!("#{chdir}#{File::SEPARATOR}", '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
I think current watchdir option doesn't work as it should (please correct me if I'm missing something).
My recent project was consisted of many different modules each of them having it's own tests suite.
I've tried to use watchdir option but it didn't work as I expected.
I've created sample project and described steps to reproduce the issue and fix for the issue with my forks (https://github.com/lesniakania/guard and https://github.com/lesniakania/guard-rspec):
https://github.com/lesniakania/multiple-modules-with-guard
These changes depends on changes I've made in guard repo.