Hi,
Depenbding on whether running under windows or unix/mac I obviously need
to use the \ instead of the / character for shell commands so I have 2
questions really
1) I would love to know if anyone has a neat way of dealing with
converting paths to use '\' instead of '/' for use with command line
calls like command and backtick?
path.gsub('/', '\\')
Actually, you may need 4 backslashes instead of 2; Ruby does weird thing
with backslashes. But that should get you going.
Depenbding on whether running under windows or unix/mac I obviously need
to use the \ instead of the / character for shell commands so I have 2
questions really
1) I would love to know if anyone has a neat way of dealing with
converting paths to use '\' instead of '/' for use with command line
calls like command and backtick?
Split it into segments and use File.join()...that's what it's there for.
Hi,
Depenbding on whether running under windows or unix/mac I obviously need
to use the \ instead of the / character for shell commands so I have 2
questions really
1) I would love to know if anyone has a neat way of dealing with
converting paths to use '\' instead of '/' for use with command line
calls like command and backtick?
path.gsub('/', '\\')
Actually, you may need 4 backslashes instead of 2; Ruby does weird thing
with backslashes. But that should get you going.
path.gsub would do the job. Thankyou.
I need to know how to determine the current operating system in order to
decide whether or not to call the gsub routine. Any ideas?
I'm thinking that Rails must have a way of dealing with this otherwise
it wouldn't run on Windows.
I think you're making a mountain out of a molehill. Ruby interprets the
path properly. Keep it to '/' and do input sanitation when the user
tries to give you a '\'
I think you're making a mountain out of a molehill. Ruby interprets the
path properly. Keep it to '/' and do input sanitation when the user
tries to give you a '\'
Yet, I don't know what you're doing, so..
No mountain, no molehill
What I'm doing was clearly (I hope) explained in my 2 opening posts but
just to be clear here it is again
I'm actually trying to call cap deploy with the result of this function