In Cygwin a space in a path has to be escaped with a backslash Not true in Windows, put the whole path in a quote
Is there a way to convert to this automatically in Ruby?
Otherwise, how in Ruby do I detect if I am running with Windows or Cygwin?
In Cygwin a space in a path has to be escaped with a backslash Not true in Windows, put the whole path in a quote
Is there a way to convert to this automatically in Ruby?
Otherwise, how in Ruby do I detect if I am running with Windows or Cygwin?
I found how to detect the platform at least - the RUBY_PLATFORM constant defines that.
Yes... RUBY_PLATFORM will report mswin on windows. Also within ruby on windows you can use
'C:/windows/Documents\ and\ Settings/'
or
'C:\\windows\\Documents\ and\ Settings\\'
sys.escape("foo bar")
# gives on Windows: '"foo bar"'
# other systems: 'foo\ bar'