Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Rails console's IRB autocompletion control #50814

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

st0012
Copy link
Contributor

@st0012 st0012 commented Jan 19, 2024

Motivation / Background

This is a follow up PR for this comment and other small refactors.

Detail

I made small improvements on Rails console related tests and avoided using ENV to control IRB's autocompletion toggle. But none of the change should affect end users.

I explained each change in their own commits. I can also split them into another PRs if that's preferred.

Additional information

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Copy link
Member

@byroot byroot left a comment

Choose a reason for hiding this comment

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

One nitpick

railties/lib/rails/commands/console/console_command.rb Outdated Show resolved Hide resolved
Setting `TERM=dumb` is enough to disable colorization in those tests.

Mocked app should also load console helpers

Move console method extension to IRBConsole's constructor

Test IRB autocompletion control without mutating ENV

Control IRB autocompletion without mutating ENV

Correct local variable name
@byroot byroot merged commit fcab061 into rails:main Jan 20, 2024
4 checks passed
@st0012 st0012 deleted the improve-rails-console branch January 20, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants