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

Use the configured streams on JRuby with JLine #67

Merged
merged 1 commit into from
Feb 23, 2013

Conversation

rsutphin
Copy link
Contributor

Without this change, the input and output parameters to HighLine.new are ignored for #ask (both for specifying the input stream and for displaying the prompt).

This addresses issue #31, though not completely — while it allows the tests to run on JRuby, many of them fail.

With this patch applied, the tests run to completion on JRuby 1.7.3:

94 tests, 743 assertions, 22 failures, 1 errors, 0 skips

On JRuby 1.6.8, they get further than they do without the patch, but many of them error out (as opposed to failing). The test run slows and eventually hangs before completing. The problem on 1.6.8 seems to be that the runner is running out of heap space.

For both JRuby 1.7.3 and 1.6.8, though, HighLine does better with this patch than without it so I'm submitting it for review.

Before this commit, the input and output parameters to HighLine.new
were ignored for #ask (both for specifying the input stream and for
displaying the prompt).

This commit fixes issue JEG2#31, which was introduced by PR JEG2#27. Since
then, the HighLine tests have been unable to run on JRuby. With this
change, the tests run on JRuby 1.7.3 but many of them fail. No tests
fail on JRuby 1.7.3 using the version of HighLine from immediately
before JEG2#27 was merged, so it seems likely the failures were caused
by JEG2#27 also.

This commit stops using `SystemExtensions#initialize` to set up JLine.
It would have been possible to pass the input and output parameters to
the `super` call, but that seemed to me like an abuse of inheritance.
Instead, following the pattern of the rest of SystemExtensions, I
added a method called `initialize_system_extensions` which is defined
on a per-platform basis (currently for JRuby only) and invoked by
`HighLine#initialize` when present.
JEG2 added a commit that referenced this pull request Feb 23, 2013
Use the configured streams on JRuby with JLine
@JEG2 JEG2 merged commit 2012c16 into JEG2:master Feb 23, 2013
@rsutphin rsutphin deleted the use_configured_streams_for_jruby branch March 1, 2013 22:01
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.

2 participants