This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: Adding constants to Dir
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
I released win32-dir tonight. This was a simple package - it's just a bunch of Windows specific constants added to the Dir class. So, if you need to get to the hosts file you can do something like this:
Where Dir::WINDOWS could be 'C:\WINDOWS' or 'C:\WINNT' or whatever it was set to when the OS was installed. This is quite a bit easier than doing a bunch of File.exists? checks, eh?