Comments (18)
In understand. However, this is an old JRuby and we're just talking about the tests, right?
Does the library still work or is it also broken?
from highline.
Not sure since I only tried the tests, and I don't have a clear test case for the code. I'm doing this testing so that I can add the new version to Gentoo Linux. I can understand if you want to put this on hold until we upgrade to a new jruby version.
from highline.
Yeah, I actually think that may be older than what we now support. We use JLine under the hood and I can't seem to find when that was added to JRuby, but I believe it's recent-ish.
We couldn't really find another working option for JRuby support, so I think we need it unless someone offers up another solution.
from highline.
jline seems to have been in JRuby since about 1.6.0 or 1.6.1 (april 2011). Would it be more better if highline has its own jline bundled ? I.e. a highline-java version that includes jline (similar to jruby) ?
from highline.
That might be an option. Would JLine run on the older JRuby versions?
from highline.
I don't think jline integration needs a lot of jruby features, so it should work with, say, 1.5.6. Bigger problem is the bundling - the jline jar itself is somewhat big, so a highline-java or even highline-jruby-old variant (since with 1.6.x the separate jar is not needed anymore) might be a good idea ?
from highline.
Yeah, this is sounding like some hassle to support some pretty old stuff. I'm feeling like it's not worth the bother. Do you guys disagree?
from highline.
It looks like our jruby 1.5.6 already has jline support. Also, with that version all tests pass for highline 1.6.8 pass. So unless something changed accordingly in highline 1.6.9 it may still be another problem. In any case I'm fine with postponing this until we can test with jruby 1.6.
from highline.
OK, closing this for now.
from highline.
Okay I think I found the problem. The test contains:
@input = StringIO.new
@output = StringIO.new
@terminal = HighLine.new(@input, @output)
Unfortunately, in the case of JRUBY, the two parameters are ignored:
@java_input = Channels.newInputStream($stdin.to_channel)
@java_output = OutputStreamWriter.new(Channels.newOutputStream($stdout.to_channel))
@java_terminal = Terminal.getTerminal
@java_console = ConsoleReader.new(@java_input, @java_output)
@java_console.setUseHistory(false)
@java_console.setBellEnabled(true)
simply using @input.to_channel
and @output.to_channel
don't seem to work though.
from highline.
This issue should probably be re-opened because this hang still happens with jruby 1.6.7.2 (ruby-1.8.7-p357) (2012-05-17 fffffff) (OpenJDK 64-Bit Server VM 1.6.0_24) [linux-amd64-java]
from highline.
Forgot to add that this still happens with highline 1.6.13.
from highline.
I'll try to look into this when I have some time.
from highline.
I have faced this problem while working on the jruby 1.7 support. I have made some preliminary changes that will alleviate the hang, but 18 tests fail.
The problem as of now (mnzaki/highline@2daa26e) is that the output contains the input that was passed as well, so the asserts fail. I think this happens because when using jline the ConsoleReader echos the input (unless you explicitly turn it off) while other methods depend on the underlying system to echo characters. One solution I see is to not even create a ConsoleReader when @input.tty? is false
from highline.
Yeah, that sounds reasonable. I would welcome such a fix.
from highline.
It seems io/console is available on recent vesions of JRuby and it works pretty similar to how it works on MRI.
So I'm trying to unify the approaches for MRI and JRuby on this PR #149
The test suit just 'skips' the readline cases when at jruby. Because I couldn't figured out a way to test them. (If you know how to do it, please tell me so).
So the tests will not hang indefinitely (waiting for console user input).
But you can be sure that it is working fine by using rake acceptance
This rake task will show you some use cases of HighLine and ask you if it's working or not.
By skipping this particular readline case on test suit we have all tests passing in travis https://travis-ci.org/abinoam/highline (jruby-19mode)
Could you people interested in (and familiar to) JRuby support give some feedback about the PR #149 ?
Hooking anyone that has commented in any HighLine JRuby issue: @rsutphin @mnzaki @graaff @Flameeyes @tomdz @andlaz @jeremyd @rsutphin @kgx @thinkgareth @presidentbeef @JEG2 @alexch @stomar @BanzaiMan @ai @celeduc @oreoshake @antond @jcoyne @keshavkuruva @cfbrobak @astounding
from highline.
... and I think PR #149 also closes issue #51
from highline.
After PR #149 I think most of JRuby problems are gone. Closing.
from highline.
Related Issues (20)
- Docs not on RubyDoc.info as README states HOT 2
- Proc validation displays ruby object on invalid HOT 8
- Incosistent behavior when ask with a validator and readline=true HOT 9
- undefined method 'default_instance' HOT 3
- Default Highline Example on GithubGives Error HOT 5
- HighLine Terminal::IOConsole#restore_mode does not work with StringIO HOT 3
- System extensions depend on now-internalized JRuby dependencies HOT 14
- consider exposing Readline.completion_proc via HighLine::Question#selection HOT 3
- default value has to be a string HOT 14
- Ctrl-C improperly handled when q.echo = false HOT 6
- Issues with echo: false and not on TTY HOT 7
- Can't get terminal_size HOT 11
- echo=false or echo='*' requires extra character after enter on Windows HOT 6
- Possible to accept multiple selections with `.in` and `.default`? HOT 5
- test failing when ruby is built against libedit instead of readline HOT 3
- Have to set convert type in order for `.in` to work with array
- 2.1.0 was released, but tag is missing in repository HOT 2
- Make Highline Ruby 3.3 and reline compatible HOT 1
- Update tests for Reline (as the substitute of Readline)
- Add `abbrev` to gemspec HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highline.