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

handle windows platform #23

Merged
merged 1 commit into from
Apr 16, 2016
Merged

handle windows platform #23

merged 1 commit into from
Apr 16, 2016

Conversation

jonyeezs
Copy link
Contributor

@jonyeezs jonyeezs commented Apr 6, 2016

I believe this might solve #22

Instead of using process, I can just send a shell command to do the job.

Althought its not async like Process but it is a workaround.

@jonyeezs
Copy link
Contributor Author

jonyeezs commented Apr 6, 2016

The only thing would be: the version of windows it runs on need to support the command taskkill

@dblock
Copy link
Owner

dblock commented Apr 6, 2016

It's promising. I cannot believe there's no gem that handles processes cross-platform though?

Start by fixing the *nix build either way.

@jonyeezs
Copy link
Contributor Author

jonyeezs commented Apr 9, 2016

@dblock spoon does handle windows. But the unfortunate problem is how cmd.exe handles .bat files. It won't let you interrupt it without the user input "Terminate batch job (Y/N)?"

Which is the root of the problem.

There might be another way to interrupt the process...I'll look into it as well

@jonyeezs
Copy link
Contributor Author

An alternative i was trying that wouldn't need such a big change in the runner was to run rackup not from a batch but straight off the .rb file (taken from this blog)

Unfortunately that didn't work or i couldn't get it to work. Still ended up with this:

Maximum connections set to 1024
Listening on 0.0.0.0:9292, CTRL+C to stop
[1] guard(main)> change server.rb
[2] guard(main)>
21:07:52 - INFO - Restarting Rack...

^C^CTerminate batch job (Y/N)? Terminate batch job (Y/N)? Y
Y
C:\>

So this still looks to be the best way I've found.

@dblock
Copy link
Owner

dblock commented Apr 10, 2016

I am cool with merging this. It needs an entry in CHANGELOG, please.

If you have time though, and want to make things cleaner, refactor the nix/win parts into a Process class or something like that, and instantiate Process::Nix vs. Process::Windows, which will simplify the tests as well quite a bit since you can write a single test for the runner and separate tests per platform for terminating processes.

@dblock
Copy link
Owner

dblock commented Apr 10, 2016

Squash your commits, too.

@@ -1,7 +1,7 @@
2.2.0 (Next)
2.2.0 (04/13/2016)
Copy link
Owner

Choose a reason for hiding this comment

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

Put this back please, Next, you're not making a release.

@dblock
Copy link
Owner

dblock commented Apr 13, 2016

I like it! Just amend changelog please, and you should edit the commit message in the commit here to say what this really does, aka support Windows.

@dblock
Copy link
Owner

dblock commented Apr 16, 2016

Looks good, merging.

@dblock dblock merged commit d111849 into dblock:master Apr 16, 2016
@dblock
Copy link
Owner

dblock commented Apr 16, 2016

I've cut a release, 2.2.0.

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