Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

absolute path to itself

// returns absolute path to the file from which the code was executed

require 'pathname'
puts(Pathname.new($0).realpath)
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS