Project

General

Profile

Bug #9002 » 0001-Use-simpler-example-for-File.expand_path.patch

cha1tanya (Prathamesh Sonpatki), 10/19/2013 10:00 PM

View differences:

file.c
* user's home directory.
*
* File.expand_path("~oracle/bin") #=> "/home/oracle/bin"
* File.expand_path("../../bin", "/tmp/x") #=> "/bin"
*
* A simple example of using <i>dir_string</i> is as follows.
* File.expand_path("ruby", "/usr/bin") #=> "/usr/bin/ruby"
*
* A more complex example which also resolves parent directory is as follows.
*
* Lets say we are in <i>assets</i> directory of a Rails project
* Dir.pwd #=> "/home/cha1tanya/Projects/sources/codetriage/app/assets"
*
* Now to move to <i>models</i> directory directly, we can use
* File.exapnd_path("../models", Dir.pwd) # => "/home/cha1tanya/Projects/sources/codetriage/app/models"
*
* For understanding how this example worked, it can be broken into 2 steps.
*
* First move to <i>Dir.pwd</i>.
*
* Then move to <i>../models</i>
*/
VALUE
(2-2/2)