Skip to content

Consider Extracting Ruby Specific Components #133

@johnallen3d

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-ruby plugin could check to see if there is a Gemfile in the working directory. If so then nib runs the desired command from nib-ruby
  • How will GLI deal with multiple commands of the same name? For example it's possible that nib-ruby implements it's own version of the shell command in order to wire up irbrc|pryrc files. If nib-ruby is "selected" and that configuration is loaded will the shell command in nib-ruby overwrite the shell command defined in nib proper?

/cc Zach Blankenship (@blankenshipz) Jack A Ross (@jackross) John Mason (@binarymason) for additional thoughts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions