Giter Site home page Giter Site logo

Comments (18)

JEG2 avatar JEG2 commented on July 18, 2024

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.

graaff avatar graaff commented on July 18, 2024

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.

JEG2 avatar JEG2 commented on July 18, 2024

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.

tomdz avatar tomdz commented on July 18, 2024

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.

JEG2 avatar JEG2 commented on July 18, 2024

That might be an option. Would JLine run on the older JRuby versions?

from highline.

tomdz avatar tomdz commented on July 18, 2024

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.

JEG2 avatar JEG2 commented on July 18, 2024

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.

graaff avatar graaff commented on July 18, 2024

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.

JEG2 avatar JEG2 commented on July 18, 2024

OK, closing this for now.

from highline.

Flameeyes avatar Flameeyes commented on July 18, 2024

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.

graaff avatar graaff commented on July 18, 2024

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.

graaff avatar graaff commented on July 18, 2024

Forgot to add that this still happens with highline 1.6.13.

from highline.

JEG2 avatar JEG2 commented on July 18, 2024

I'll try to look into this when I have some time.

from highline.

mnzaki avatar mnzaki commented on July 18, 2024

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.

JEG2 avatar JEG2 commented on July 18, 2024

Yeah, that sounds reasonable. I would welcome such a fix.

from highline.

abinoam avatar abinoam commented on July 18, 2024

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.

abinoam avatar abinoam commented on July 18, 2024

... and I think PR #149 also closes issue #51

from highline.

abinoam avatar abinoam commented on July 18, 2024

After PR #149 I think most of JRuby problems are gone. Closing.

from highline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.