expand_path

File.expand_path(file_name [, dir_string] ) â abs_file_name
Class Public methods

Converts a pathname to an absolute pathname. Relative paths are referenced from the current working directory of the process unless dir_string is given, in which case it will be used as the starting point. The given pathname may start with a â~'', which expands to the process owner's home directory (the environment variable HOME must be set correctly). â~user'' expands to the named user's home directory.

File.expand_path("~oracle/bin")           #=> "/home/oracle/bin"
File.expand_path("../../bin", "/tmp/x")   #=> "/bin"
doc_ruby_on_rails
2015-04-06 10:13:10
Comments
Leave a Comment

Please login to continue.