-
Notifications
You must be signed in to change notification settings - Fork 3
Description
One of the most useful features of nib is it's ability to maintain and wire up shell history automatically. This feature and other conveniences are potentially useful to anyone using docker-compose in development, not just Ruby developers. Because of this I propose extracting the Ruby specific commands/features from nib into nib-ruby. This would have the added benefit of allowing for other gems to be built on top of nib (eg. nib-rust).
Ideally this would be accomplished by introducing the concept of nib plugins. It would be desirable to continue typing nib console web, not nib-ruby console web. This likely means that nib would have to use "reflection" to discover installed plugins. The minitest library uses this exact approach and is well documented.
One important thing to explore is how GLI will handle "competing commands". It's conceivable that nib-ruby and nib-rust would implement a console command. Some things to consider and investigate:
- Perhaps each plugin can self select. For example the
nib-rubyplugin could check to see if there is aGemfilein the working directory. If so thennibruns the desired command fromnib-ruby - How will GLI deal with multiple commands of the same name? For example it's possible that
nib-rubyimplements it's own version of theshellcommand in order to wire upirbrc|pryrcfiles. Ifnib-rubyis "selected" and that configuration is loaded will theshellcommand innib-rubyoverwrite theshellcommand defined innibproper?
/cc Zach Blankenship (@blankenshipz) Jack A Ross (@jackross) John Mason (@binarymason) for additional thoughts