-
Notifications
You must be signed in to change notification settings - Fork 119
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
Proposal for quick shell execution #347
base: master
Are you sure you want to change the base?
Conversation
I am really unsure about this change. `cat .ruby-version` (e.g. using Kernel#`?..) As Pry has it, I assume people find it useful, but for now, I honestly fail to see the point. Second, I can see at least one potential problem: wouldn't this be conflicting with copy-paste of multi-line code, which most of the codebases currently format like this: [1, 2, 3]
.map(&:to_s) When trying to past it into the latest
...while the latest IRB, surprisingly, does the right thing:
In general, I respect Pry's approach, but for Ruby's default interactive console, I'd prefer every shortcoming ("this is just inconvenient to do") be first viewed as an opportunity to improve Ruby's behavior or core objects, and only if it doesn't lead to any interesting idea, it might be considered as a console-only feature. |
@zverok, thanks for the quick review! Here are some opiniated answers I can give you
Some of those I have in mind:
It would not, since the code example you gave is a whole statement group, and I check only for And if it were an issue, I’m sure I could fix it! As mentionned in the PR description, this may be a more complete feature depending on your reviews 🙂 EDIT: in fact one thing I’ll add to the description and may be really handy is that the result is not stored in
Definitely agree on the reasoning, and I like that part of irb where every commands are just ruby functions. There is an issue with that however, it is when one wants to give tokens directly to IRB. For instance I’ve stopped using the For instance GHCI (Haskell’s REPL) does that really well with their |
I really love this feature! 👏 I have to agree with @zverok on many points; but namely on the special IRB-specific syntax this adds. If this is accepted by the core team, I'd like to propose turning this off by default and allowing users to enable it with an IRB configuration. Personally I think the value-add is worth the addition of this, but would like to caution introducing new custom syntax that performs system calls. |
I’ve been using IRB way more than Pry lately, thanks for the great improvements ❤️
However, Pry still has what I call the quick shell execution feature, which IRB does not:
Hence this is a PR which adds such feature.
I’ve made the minimal required changed to add for now to see if you are interested. If so, I can add some features to it. For instance (please tell me which ones seems important to you):
_
Want to use it now?
Add this to your irbrc: