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

[Truffle] Run irb instead of reading from stdin by default. #4376

Merged
merged 1 commit into from Dec 12, 2016

Conversation

chrisseaton
Copy link
Contributor

This continually confuses non-Ruby users who just run ruby and expect to see something.

I could be convinced to not commit this.

@chrisseaton
Copy link
Contributor Author

This is a really crazy set of failures for such a small change.

@eregon
Copy link
Member

eregon commented Dec 10, 2016

Maybe System.console() is not working as expected or there is some bug?
The laguage specs fail for instance with:

Global variable $?
- is read-only
- is thread-localirb(main):001:0> 

And it's just doing:

some/ruby -e "exit 0"

tryProcessArgumentsWithRubyopts();
if (getScriptFileName() == null && System.console() != null) {
Copy link
Member

Choose a reason for hiding this comment

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

You probably need to check for the case with -e here.

@enebo
Copy link
Member

enebo commented Dec 10, 2016

Does it still work as expected if you pipe input to the process?

cat mydata | jruby -ne '...'

@chrisseaton
Copy link
Contributor Author

Yes - that's what the System.console() != null check is for. It should be null if stdin is not connected directly to a terminal.

@enebo
Copy link
Member

enebo commented Dec 10, 2016

Ok I guess I was not aware one could tell the difference. If so I don't think anyone intentionally types Ruby without a pipe or redirection

@chrisseaton
Copy link
Contributor Author

chrisseaton commented Dec 10, 2016

I don't think anyone intentionally types Ruby without a pipe or redirection

This is actually in response to user testing with real people doing that and then sitting there staring at it for ages waiting for it to do something. They tend to be non Ruby programmers just wanting to experiment with Ruby like they do with Python and Node.js.

@enebo
Copy link
Member

enebo commented Dec 10, 2016

Ah I came from awk, Perl, and all the languages which do sit there. I agree that if you can know this case it seems like a good idea to enter a repl. It might be worth also creating an RFE on Ruby lang

@eregon eregon merged commit c6addb0 into truffle-head Dec 12, 2016
@eregon eregon deleted the truffle-default-irb branch December 12, 2016 10:49
@enebo enebo modified the milestone: truffle-dev Jan 10, 2017
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
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.

None yet

4 participants