Open wilmoore opened 10 years ago
Storing rubies in ~/.local/share/rubies/
might be acceptable. ~/.rubies/
was choosen since it was the defacto directory that people were already using in the wild. We would have to support both dirs for a while, until people transitioned to ~/.local/share/
.
One argument for ~/src/
is it does not hide the downloaded/uncompressed source. Users might forget that ruby-install downloads/uncompresses into ~/.cache/ruby-install/
and allow it to slowly bloat up thier /home
partition.
One argument for ~/src/ is it does not hide the downloaded/uncompressed source. Users might forget that ruby-install downloads/uncompresses into ~/.cache/ruby-install/ and allow it to slowly bloat up thier /home partition.
I can get behind that argument. I think a nice middle-ground then would be to keep the default as-is but allow it to be configurable. The user can then choose to use their already defined $XDG_CACHE_HOME
directory to build the final path string if they wish.
Slowly getting there! ruby-install 0.6.0 downloads versions/checksums into ~/.cache/ruby-install
. Eventually will move the downloaded files into there. Might have to add a --clean-cache
option to avoid files building up.
I guess chruby
also needs to look at both ~/.local/share/rubies
and ~/.rubies
?
I guess
chruby
also needs to look at both~/.local/share/rubies
and~/.rubies
?
This is already part of https://github.com/postmodern/chruby/issues/405.
If/when chruby
1.0.0 is released, it may even default to ~/.local/share/rubies
instead of ~/.rubies
, see https://github.com/postmodern/chruby/commit/97e83c7e95a4d2b7451c1cd73b8b42cf92ef0b1e (docs) and https://github.com/postmodern/chruby/commit/0745073a1d54ceae4ec1267674836014cc05dbe6 (code).
I'm starting to have second thoughts on ~/.local/share/rubies
, since most macOS users do not use or are not used to XDG directories. This could create friction with macOS users.
Lots of ideas and good arguments here: https://stackoverflow.com/questions/3373948/equivalents-of-xdg-config-home-and-xdg-data-home-on-mac-os-x
My 2 cents on where to install rubies after reading that (and Apple's docs about Library/
linked from there):
$XDG_DATA_HOME
is defined: $XDG_DATA_HOME/rubies
~/Library/rubies
or ~/Library/Application Support/rubies
~/.local/share/rubies
Honestly I would not mind any default as long as $XDG_DATA_HOME
gets honored.
If you really want to make the rubies directory more discoverable by macOS users that are unware of the XDG base dir spec and also do not read documentation, I guess ~/.rubies
or even ~/rubies
(cross.platform, non-Unix users should not have to know about dotfiles either after all) is better really, but please only as a fallback then.
most macOS users do not use or are not used to XDG directories
Is there a specific “scenario of frustration” in your mind, if we default to the XDG directories? In other words, when would users find it confusing?
Is there a specific “scenario of frustration” in your mind, if we default to the XDG directories? In other words, when would users find it confusing?
More concerned about surprising users with a sudden switch to XDG directories, when most macOS users are not familiar with XDG directories since they were created by FreeDesktop.org specifically for Linux Desktop Environments; although more Linux/*nix software has become available on macOS thanks to homebrew and thus exposed more macOS to the concept of XDG directories.
What I will likely have to do is slowly introduce XDG support in both ruby-install
and chruby
. At first optionally supporting/honoring XDG directories if they exist. Then eventually defaulting to using XDG directories, but still have chruby
recognize rubies installed in ~/.rubies/
. Then in a 1.0.0 release, drop support for ~/.rubies/
and ~/src/
entirely in favor of XDG directories.
My solution for XDG is to install things under appropriate XDG directories, and then symlink them to dot files or directories in $HOME for convenience. For example, symlinking .config/chruby/default-ruby to ~/.ruby-version follows XDG conventions (which are not universally loved) but still follow the principle of least surprise. Worth considering?
My initial thinking is that if
$XDG_DATA_HOME
is set rubies would be installed into$XDG_DATA_HOME/rubies
and if not set, they would be installed to~/.local/share/rubies
.It would also be great if instead of
~/src/*
sources were put into$XDG_CACHE_HOME/ruby/*
if that variable is set or if not set~/.cache/ruby/*
.In other words, try to avoid unnecessarily adding to the clutter of the
$HOME
directory.XDG Base Directory Specification