Skip to content

Add custom package support to RelinePac configuration#3

Merged
Syati merged 7 commits into
mainfrom
custom_package
Jan 19, 2026
Merged

Add custom package support to RelinePac configuration#3
Syati merged 7 commits into
mainfrom
custom_package

Conversation

@Syati
Copy link
Copy Markdown
Owner

@Syati Syati commented Jan 17, 2026

This pull request introduces a more streamlined and customizable approach for configuring reline_pac in 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:

  • Simplified the installation and setup instructions in both README.md and README_ja.md, replacing manual configuration code with a download link for an example .irbrc and clearly outlining three usage options: default keybindings, customization, and adding custom packages. [1] [2]
  • Expanded comments and organization in examples/.irbrc to guide users through default, customized, and custom package configurations, making the setup process clearer and more flexible. [1] [2]

Custom Package Support:

  • Added RelinePac::Config#add_package, allowing users to define custom methods for keybindings, which are dynamically added to Reline::LineEditor via the new RelinePac::Packages::Custom module. [1] [2] [3]
  • Ensured that custom packages are only added if a block is provided, and that later definitions override earlier ones.

Internal Codebase Updates:

  • Updated internal references to use Reline.core.config instead of the previous Reline.send(:core).config for improved clarity and compatibility. [1] [2]

Testing Enhancements:

  • Added a comprehensive spec for add_package covering method addition, invocation, overriding, and error handling, ensuring reliability of custom package functionality.

Copilot AI review requested due to automatic review settings January 17, 2026 13:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_package method to dynamically add custom methods to Reline::LineEditor
  • Created Packages::Custom module to hold user-defined methods
  • Changed from Reline.send(:core) to Reline.core for 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.

Comment thread spec/reline_pac/config_spec.rb Outdated
Comment thread lib/reline_pac/config.rb
Comment thread lib/reline_pac/config.rb Outdated
Comment thread lib/reline_pac/config.rb
Syati and others added 5 commits January 17, 2026 22:17
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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread spec/reline_pac/config_spec.rb Outdated
@Syati Syati merged commit 5fb6c4c into main Jan 19, 2026
3 checks passed
@Syati Syati deleted the custom_package branch January 19, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants