[Proposal] Slightly changed message upon (re)installing a specific gem #8442
rubyFeedback
started this conversation in
Ideas
Replies: 1 comment
-
I'm cool with this improvement. To sum up, if RubyGems is rewritting an existing installation, mention so explicitly (rather than just "Successfully installed gem X"). If on the other hand, RubyGems is skipping installation because a previous installation exists, mention so as well (rather than just "Successfully installed gem X"). I'd need to check what the actual behavior is, but either of them could use a reword. Makes sense to me, and contributions are welcomed! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey folks,
This is mostly for David (as he seems to do most of the recent work), but, of course, it is also for everyone else, so feel free to comment if you want to.
Before I explain the suggestion, let me briefly explain the background.
I keep on messing up my primary operating system (Linux), due to self-written ruby code not being super-perfect (so, this is on me). So, for this, and various other reasons, I tend to have to recompile a lot of things (on that note, did you guys know that automatically resymlinking into /usr/ hierarchy with the very same name, and also force-deleting old targets, is not the best idea? That actually happened not deliberately per se, but due to a wrong check I made that was ignored when a prior assumption was suddenly incorrect, due to an "innocent" change I did elsewhere - always check your dangerous logic a few times, before proceeding a path ... but that's an aside); this time I wanted to keep a backup-ruby, so I proceeded to compile it into a versioned appdir prefix.
When I thus need a new ruby, I install various gems: hexapdf, sinatra, kramdown and so forth - really many gems. A few of these gems have to be compiled, e. g. ruby-gtk bindings as wrapper over glib, gtk etc....
I also multitask a lot, so my brain is quickly confused. Do I need to reinstall sinatra? Well, we can just install it, right? So I did this:
Hmm. Yeah, it reports ^^^ that it installed it. Right? So I am sure it HAD to be installed.
But then I did the same again:
So, the message is the same, and I believe it has reinstalled sinatra - again.
I am fine with this behaviour, mind you. But what happened to the old files? Were they overwritten?
Also, the above shows no indicator that a previous installation happened.
So, the behaviour can be retained, that is fine, but I would like to propose a slightly changed output.
I don't know what it does internally, so please adjust what I will suggest accordingly to how the code is written. I'll give a short rationale and use case about the proposed change.
IF it overwrites a previous sinatra installation, then I would like to suggest something like:
Successfully installed sinatra-4.1.1, overwriting the previous installation of sinatra-4.1.1 (from 03.03.2024) # date may be useful in that case.
^^^ this would only show if there was anything overwritten. If the time stamp is not kept, then simply omit the time-display.
The reason I suggest this to extend the current line, is to not make it too spammy. I think ruby users don't want too much information either.
IF nothing is overwritten, but rubygems realises that an old sinatra existed, then this should be briefly indicated, aka on the second run:
Successfully installed sinatra-4.1.1
1 gem installed (a previous sinatra gem with the same version existed) # or some similar indicator; could be an extra line above the "1 gem installed" summary
That's it. So it is a fairly minor suggestion.
I believe rubygems already covers the situation when multiple versions exist, and prompts for input, so my suggestion should not change anything like that, as this is already handled separately. My suggestion is primarily for giving that little additional information. I guess everyone wants it to be short, so my above suggestions can probably be made even shorter somehow.
IF this is not ok for the default behaviour - which I can understand, then perhaps we can have a "gem verbose" mode, e. g. --verbose and/or ruby-opt entries to make the default gem commands slightly more verbose in general (and thus helpful). That way we can retain the current behaviour, but if the verbose flag is used or rubyopt set, then more info can be shown (and document this somewhere internally; I have a hard time finding anything via google search these days, so we need to improve ruby projects internally with more high quality documentation + links to it).
Now as for the use case or rationale:
I believe this slight change would be slightly helpful in notifying users that an older installation already existed. It may not be the most important change in the world, I get it, and gems can just be reinstalled anyway, but there may be use cases to be had here, in particular for people who may install multiple ruby versions and/or jruby, rvm, system-ruby version ruby in the home-dir, different gem paths and so forth. (I'd even then suggest to display to the user WHERE the gem was installed, perhaps via the --verbose flag, but I want to keep this proposal simple and thus easier to consider and perhaps add; so, right now we are in the discussion stage I suppose to hope). Thanks for reading, and please do feel free to close the issue at any moment in time for any reason!
Beta Was this translation helpful? Give feedback.
All reactions