How to find the current path?

P

Paatsch, Bernd

------_=_NextPart_001_01C62E69.EC9E02E4
Content-Type: text/plain

Hello,

I am fairly new to ruby and wonder if there is a class/method that returns
the absolute path of the current directory (the directory I execute the ruby
script from)?


Thanks,
--Bernd


------_=_NextPart_001_01C62E69.EC9E02E4--
 
J

James Edward Gray II

Hello,

I am fairly new to ruby and wonder if there is a class/method that
returns
the absolute path of the current directory (the directory I execute
the ruby
script from)?

I believe this is what you are after:

$ ruby -e 'p Dir.pwd'
"/Users/james"

Hope that helps.

James Edward Gray II
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top