-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support multiple exclusion options #3
Support multiple exclusion options #3
Conversation
4a0281d
to
f75d6c3
Compare
@afonsograca would be great if you could review this... |
hey @tero2222, |
cmd << ["--exclusion #{params[:exclusion]}"] if params[:exclusion] | ||
if params[:exclusion] | ||
Array(params[:exclusion]).each {|exclusion| | ||
cmd << ["--exclusion #{exclusion}"] } |
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.
@tero2222 would your solution work for pathnames with spaces in it? don't you think it would be better if you enclose the exclusion in quotes? So that the command would look like this:
$ synx -p --exclusion "/OCMock/Core Mocks" Source/OCMock.xcodeproj/
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.
@afonsograca Thanks for review!
I think that it would be better to use Shellwords.join().
Example
Shellwords.join([
"synx",
"-p",
"--exclusion",
"/OCMock/Core Mocks",
"Source/OCMock.xcodeproj/"])
#=> synx -p --exclusion /OCMock/Core\ Mocks Source/OCMock.xcodeproj/
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.
I fixed to use shellwords.
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.
And separated key and value of exclusion option.
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.
cool! it looks neat!
Just a final remark, can you replace the curly braces {}
with do...end
on the each loop? Just to keep the ruby code style conventions.
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.
Thanks!
I fixed the coding style.
I fixed issue #2.
Multiple exclusion options are not support by environment variable.
Please review this.
code example: