Cross-platform means of getting user's home directory in Ruby? -


java has convienient system.getproperty("user.home") user's "home" directory in platform-independent way. what's equivalent in ruby? don't have windows box play around with, , feel relying on tildes in filenames isn't cleanest way. there alternatives?

the file.expand_path method uses unix convention of treating tilde (~) specially, ~ refers current user's home directory , ~foo refers foo's home directory.

i don't know if there's better or more idiomatic way, file.expand_path('~') should going.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -