-
Notifications
You must be signed in to change notification settings - Fork 139
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
Dev-only CLI #2378
Dev-only CLI #2378
Conversation
We keep adding more scripts to /bin that are doing the same kinds of processing. Instead, this commit consolidates them all into a single CLI that shares the same logic so that we can consistently read files in the same way. It keeps around 2 binstubs for bin/lex and bin/parse since those are the most used and I'm sure people have built up muscle memory for those. Those scripts are now just wrappers for forwarding to bin/prism.
Seems like a good idea. |
@kddnewton Is there a possibility of us making a non-dev script so we can run and generate AST, etc... from the installed gem? |
Yeah we could do that. I don't think CRuby will want us to ship that with it so we'll need to take a little care to make sure it doesn't get copied over, but that's doable. Could you open an issue for it? |
@kddnewton yeah I only want it so I can trivially display AST without needing to bust back to dev env. Not sure on whether other tools will be useful but it is nice to display AST when debugging runtime issues. |
@noahgibbs I added jruby/jruby#8094 for that newly discovered ripper issue. |
@enebo if you have CRuby 3.3, you can run |
@kddnewton Yeah that works for MRI for sure. I have thought about adding similar thing to JRuby but have a bin/ast (which only currently works for legacy parser). |
It'd be quite convenient to have an executable, because that would then use the installed gem vs the version used in CRuby at CRuby build time. |
We keep adding more scripts to /bin that are doing the same kinds of processing. Instead, this commit consolidates them all into a single CLI that shares the same logic so that we can consistently read files in the same way.
It keeps around 2 binstubs for bin/lex and bin/parse since those are the most used and I'm sure people have built up muscle memory for those. Those scripts are now just wrappers for forwarding to bin/prism.