Windows fixes....
Reported by TheCompWiz | July 1st, 2011 @ 04:31 PM
I know not everyone in here is a fan of Windows... and I also know that this issue has been addressed in the past & not deemed worthy to take into consideration... (as the fix that was recommended didn't work across all platforms)... but here's my attempt to make redcar more windows-friendly.
Fix 1... in redcar.bat replace
@"ruby.exe" "%~dpn0" %*
with
SET STARTUP=%*
IF NOT "X"%STARTUP% == "X" SET STARTUP=%STARTUP:"="""%
@"ruby.exe" "%~dpn0" %STARTUP%
Why?... well... windows commonly uses a lot of spaces in directories & files... and currently redcar doesn't take this into consideration... so something like 'redcar "c:\my path\my file.rb"' fails to find & open the file... because it assumes the file is "c:\my" and both "my\path" and "file.rb" are parameters of some sort... which is wrong. By replacing the single quote mark with 3... the result is that the first two are interpreted as a literal ", and the third is eaten up by the interpreter. This will not affect parameters as far as I can think of... but honestly, I don't use any additional parameters (yet) when I start redcar. I can't see anything that would be affected beyond that.
Fix 2... fork the process from the dos-box... I LOVE bash... (and other *nix shells) for their amazing abilities to easily fork. Windows isn't so lucky... so we're left with a cludge... change the last line in redcar.bat that actually starts redcar to use the "start" command.
If you don't use the patch from fix 1... it would look like
this:
start "RedCar" ruby.exe "%~dpn0" %*
With the patch from fix 1...
start "RedCar" ruby.exe "%~dpn0" %STARTUP%
Fix 3... start java with javaw in windows
(only) I realize that non windows platforms don't use the javaw
client... so it should be platform dependent. So... in
lib\redcar\runner.rb replace
command=["java"]
with
command = (RUBY_PLATFORM.downcase =~ /mswin|mingw|win32/ ? ["javaw"] : ["java"])
This should only affect any platform identifying itself as mswin, mingw or win32. the rest will use the good ole' java client.
Fix 4... if you adopted everything above... especially the javaw fix... you also want ruby to use rubyw in the redcar.bat file
start "RedCar" rubyw.exe "%~dpn0" %STARTUP%
Now... this behaves a lot more like other OSes...
Comments and changes to this ticket
-
frzjubgjvzjjvz July 6th, 2011 @ 05:10 PM
Would you mind creating a github clone of redcar, commiting your changes there and do a pull request?
-
mscharley July 7th, 2011 @ 08:59 AM
Re: Fix 3,
Redcar already has built in platform detection, you should really use that.
Also, out of curiosity, what benefit does javaw bring over just java.exe which also exists on Windows pc's?
-
TheCompWiz July 14th, 2011 @ 06:16 PM
@mscharley using java.exe spawns a console. Using javaw.exe does not. For a cleaner look without a bunch of consoles (that imho aren't needed...) looks very cluttered.
@linopolus I've made my pull request... sorry it took so long... I've never used github as a contributer before :D
The fixes I've applied switch to using javaw for Windows only platforms... (linux/mac/??? should still use java instead of javaw) Also, during the install phase of redcar, the redcar.bat file is replaced with a modified version that should apply the fixes I outlined above.
-
Daniel Lucraft July 20th, 2011 @ 09:18 PM
- State changed from new to resolved
Merged this. Should be in 0.12
-
Wardrop July 27th, 2011 @ 07:25 AM
I'd imagine Windows would be one of the primary platforms Redcar is used on. OS X has textmate, but what does Windows have to fill the Ruby void? Only cludgy IDE's or very vanilla text editors who's only features are syntax highlighting. That's why I'm using redcar on Windows, because I've got no other choice. I find redcar to be a little unstable as it's still early in development, but despite looking for alternatives many times over the last few months, I've found nothing better. I just can't wait now for redcar to get some of those core features rock-solid, like syntax highlighting and undo/redo.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A programmer's text editor for Gnome.