C
Chad Perrin
I've got a program that needs to access a file in the ~/etc/ directory.
This program currently accesses it like so:
file_path = File.expand_path("~#{ENV['USER']}/etc/#{filename}")
. . but that environment variable just looks hideous in there, at least
to me. In Perl, I'm used to using getpwuid() instead of $_ENV['user'].
Is there some equivalent to that in Ruby, or am I stuck with ENV['USER']?
This program currently accesses it like so:
file_path = File.expand_path("~#{ENV['USER']}/etc/#{filename}")
. . but that environment variable just looks hideous in there, at least
to me. In Perl, I'm used to using getpwuid() instead of $_ENV['user'].
Is there some equivalent to that in Ruby, or am I stuck with ENV['USER']?