Add custom package support to RelinePac configuration#3
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds the ability for users to define custom packages (methods) for Reline::LineEditor through a new add_package configuration method. This enhances the extensibility of RelinePac by allowing users to create their own keybind handlers beyond the built-in packages.
Changes:
- Added
Config#add_packagemethod to dynamically add custom methods to Reline::LineEditor - Created
Packages::Custommodule to hold user-defined methods - Changed from
Reline.send(:core)toReline.corefor accessing Reline's internal configuration - Updated documentation with examples of custom package usage
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/reline_pac/config.rb | Added add_package method for custom package registration and changed Reline.core access from send to direct call |
| lib/reline_pac/packages/custom.rb | New module to hold user-defined custom packages |
| lib/reline_pac/packages.rb | Added require for custom packages module |
| spec/reline_pac/config_spec.rb | New comprehensive test suite for add_package functionality |
| spec/reline_pac_spec.rb | Updated mock to match direct Reline.core call |
| README.md | Added example demonstrating custom package usage |
| README_ja.md | Added Japanese example of custom package usage |
| bin/console | Reordered requires and updated comment to English |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
# Conflicts: # README.md # README_ja.md
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a more streamlined and customizable approach for configuring
reline_pacin IRB and Pry. The main changes include simplifying the installation and setup instructions, enabling users to easily add custom keybindings and packages, and improving internal support for custom packages. Documentation and examples have been updated to reflect these enhancements, and new tests ensure the robustness of custom package functionality.Documentation and Example Improvements:
README.mdandREADME_ja.md, replacing manual configuration code with a download link for an example.irbrcand clearly outlining three usage options: default keybindings, customization, and adding custom packages. [1] [2]examples/.irbrcto guide users through default, customized, and custom package configurations, making the setup process clearer and more flexible. [1] [2]Custom Package Support:
RelinePac::Config#add_package, allowing users to define custom methods for keybindings, which are dynamically added toReline::LineEditorvia the newRelinePac::Packages::Custommodule. [1] [2] [3]Internal Codebase Updates:
Reline.core.configinstead of the previousReline.send(:core).configfor improved clarity and compatibility. [1] [2]Testing Enhancements:
add_packagecovering method addition, invocation, overriding, and error handling, ensuring reliability of custom package functionality.