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

Split up which for Unix and Windows #304

Merged
merged 1 commit into from Aug 9, 2015
Merged

Split up which for Unix and Windows #304

merged 1 commit into from Aug 9, 2015

Conversation

maxmeyer
Copy link
Member

@maxmeyer maxmeyer commented Aug 9, 2015

Unix and Windows need a separate logic to find executables in PATH. This splits up the original implementation and uses Aruba.platform to decide which implementation to use.

maxmeyer added a commit that referenced this pull request Aug 9, 2015
@maxmeyer maxmeyer merged commit ca4fb75 into cucumber:master Aug 9, 2015
@maxmeyer
Copy link
Member Author

maxmeyer commented Aug 9, 2015

We now only need to make sure, that the logic is correct on windows.

@maxmeyer
Copy link
Member Author

maxmeyer commented Aug 9, 2015

@weedySeaDragon I took your comments about the #match? into account. Now there's a default-class which just fails. All other classes use a matcher which checks specific things.

@maxmeyer
Copy link
Member Author

maxmeyer commented Aug 9, 2015

Ashley, would you mind to have a look into the windows implementation? It is still failing, but Appveyor-builds took too long to use them for fixing bugs.

@weedySeaDragon
Copy link
Contributor

I see 2 things immediately:

  1. The full path to cmd.exe is not necessary. (Windows will always know where to find cmd.exe). So WindowsCommandString.initialize can be changed to: __setobj__ format('cmd.exe /c "%s"', cmd)
  2. You are only passing 1 argument to ChildProcess (the entire command string). In Windows, ChildProcess requires you to pass each of the string components as a separate argument:
process = ChildProcess.build("cmd.exe", "/c", "path\to\command\cat")

(also see the first comment in #283)

@maxmeyer
Copy link
Member Author

  1. The full path to cmd.exe is not necessary.

For now: Unfortunately yes... The current code is not wrapped with with_environment. This is part of another PR of mine... This will be removed if the PR is merged.

  1. You are only passing 1 argument to ChildProcess (the entire command string). In Windows,

Oh. Will fix this.

Thanks.

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.

2 participants