-
Notifications
You must be signed in to change notification settings - Fork 121
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
undefined method `extract_ruby_args=' for module IRB::Command (NoMethodError) #958
Comments
I assume there's a clash with the irb command |
|
I ran into the same thing when trying to assign some source code string to a variable named I was curious how python handles this: its repl also has some buildins. The |
In #824, we decided commands should always take precedence over variable names or methods (mostly my idea tbf). This is to avoid situations like having But now I think we can do a more sophisticated check to support this precedence order:
So in this example: help = 1
binding.irb when users type WDYT @tompng? |
I think it is hard to distinguish local variables defined in program context from local variables defined in IRB session, especially when using chws or rdbg command. And I think the behavior is complex/hard to understand for user. How about simply make the precedence:
(This will be a simpler version of #803 (comment)) irb> help = 1
=> 1
irb> help + 1
If you want to use help command, try irb_help instead
=> 2 |
That's a good point 🤔
I personally don't think that'd be the case as they are the ones who define the local variables.
Then we'll need to change that for
|
Less inconsistency is better, but I think it will be an enhancement even if there is an inconsistency. |
Just FYI I suspect I'm seeing this bug by following the usage example of the Rouge gem in IRB: require 'rouge'
=> true
source = File.read('README.md') This results in
Assigning to a var not named "source" fixes the problem. |
Description
In a rails console, running the following command fails
measure = Measure.first
But the following succeeds
m = Measure.first
The error message of the
measure = Measure.first
command isWhen I revert to using irb version 1.12.0 all commands work correctly, but on versions 1.13.0 and 1.13.1, the command fails as described above.
I have other models in my application but so far, only measure.rb fails in this way. I'm still testing to see if the problem affects any other model.
Result of irb_info
Terminal Emulator
What's your terminal emulator?
Kitty
Setting Files
Are you using
~/.irbrc
and~/.inputrc
?No
The text was updated successfully, but these errors were encountered: