Created
January 18, 2010 02:34
-
-
Save rjungemann/279742 to your computer and use it in GitHub Desktop.
Get the running script's absolute path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The current "best way" to get the absolute path of the current script in Ruby, | |
# as far as I know.... | |
require 'pathname' | |
$prefix = Pathname.new(File.dirname(__FILE__)).realpath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment