Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filesystem location per user (for configuration data, or otherwise) #23

Open
MarkDBlackwell opened this issue Jul 1, 2016 · 2 comments

Comments

@MarkDBlackwell
Copy link

MarkDBlackwell commented Jul 1, 2016

If there are any other features you'd like, let me know, I'll do what I can to add them :)

Here's a relevant StackOverflow question. Quoting JP:

In Mac OS X I'll put user-specific files for my app in ~/Library/Application Data/{{MyApp}}/ and in Unix I'll put them in ~/.{{MyApp}}/ — where should I put them for Windows?

and quoting mikel's answer:

On Windows, it's ENV['APPDATA']

which I interpret as File.join((File.expand_path ENV['APPDATA']), '{{MyApp}}'). For me, this results in:

C:/Users/Mark/AppData/Roaming/{{MyApp}}

(For the above occurrences of {{MyApp}}, we should substitute the actual name of the application—of course.)

So, a cross-platform method, whose purpose would be to return the location where we should place user-specific files, perhaps optionally with (or without) the suffixes /{{MyApp}}/ or /.{{MyApp}}/, would be useful, and simple to use. (Also, IMO it falls in the bailiwick you've undertaken with this gem.)

Presumably, an attempt should be made to match existing practice. Often on Windows (in particular), configuration files (which comprise just one of the many kinds of user-specific files targeted by this suggested feature) are placed in one of two locations: ENV['APPDATA'] or ENV['HOMEPATH'].

BTW, when running the RubyInstaller's Ruby, the result of ENV['HOME'] seems set to the same location as ENV['HOMEPATH'].

@rdp
Copy link
Owner

rdp commented Jul 22, 2016

interesting idea...

@rdp
Copy link
Owner

rdp commented Jan 23, 2017

pull request welcome! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants