In my Ruby project I am using a mess of things like moving and editing files on several remote boxes and I really need something like a relative path to my root project directory. I have many processing folders which are used in many methods.
Right now I have paths hardcoded, but that makes me unhappy.
You can get current directory (directory of current file) with this
You can then join it with relative path to the root
Or you can use
expand_pathto convert relative path to absolute.Or you can calculate relative path between two dirs.