Puffball has quit [Read error: Connection reset by peer]
shellac has joined #jruby
ChrisBr_ has joined #jruby
ChrisBr has quit [Ping timeout: 264 seconds]
jmalves has joined #jruby
drbobbeaty has joined #jruby
Puffball has joined #jruby
jmalves has quit [Remote host closed the connection]
jmalves_ has joined #jruby
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ChrisBr_ is now known as ChrisBr
drbobbeaty has joined #jruby
JRubyGithub has joined #jruby
JRubyGithub has left #jruby [#jruby]
<JRubyGithub>
[jruby] headius closed issue #2056: Use ExactMath for overflow https://git.io/fAnPO
shellac has quit [Quit: Computer has gone to sleep.]
KeyJoo has quit [Ping timeout: 240 seconds]
shellac has joined #jruby
shellac has quit [Ping timeout: 260 seconds]
claudiuinberlin has joined #jruby
Puffball has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #jruby
jmalves has joined #jruby
jmalves_ has quit [Ping timeout: 240 seconds]
tonio has joined #jruby
tonio has quit [Client Quit]
ravioli25 has joined #jruby
<ravioli25>
A fascinating blog where freenode staff member Matthew mst Trout recounts his experiences of eye-raping young children https://MattSTrout.com/
ravioli25 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
JRubyGithub has joined #jruby
JRubyGithub has left #jruby [#jruby]
<JRubyGithub>
[jruby] ChrisBr opened issue #5297: Struct does initialize attributes wrong https://git.io/fActL
<ChrisBr>
headius: ^^ already experienced this one? benchmark-driver is broken because of this... I already tried to track it down a bit but stucked now
claudiuinberlin has quit [Read error: Connection reset by peer]
<telegardian>
when I run this: ApacheCommonsValidator::GenericValidator..new.isEmail('invalid')
<telegardian>
1: from uri:classloader:/jruby/java/core_ext/module.rb:45:in `const_missing'
<telegardian>
NameError (GenericValidator not found in packages org.apache.commons.validator; last error: cannot load Java class org.apache.commons.validator.GenericValidator)
<telegardian>
I get that error
<telegardian>
but it works flawlessly in my code. The issue is I can't seem to test in IRB for some of the JAR files I import
<telegardian>
^^ correction, this is the line that causes the above error:
<telegardian>
it is the same issue with other JAR files I load. Unable to use the code as pasted from my files into jirb and get the same results.
<enebo>
telegardian: hmm I am trying to remember how include_package works
<enebo>
telegardian: I take it you have apache commands in your classpath
<enebo>
telegardian: can you java_import 'org.apache.commons.validator.SomeValidClass'?
<telegardian>
enebo: let me see
<enebo>
telegardian: If that works then it is likely something weird about include_package. include_package is somewhat hacked together since Java has no concrete way of enumerating what classes exist in a package
<enebo>
telegardian: sorry we are exposing how the sausage is made
<enebo>
I will add a nil at and of that so it does not show something confusing
<telegardian>
all good, just I know this worked several years ago in 'irb'
<enebo>
telegardian: yeah and several years ago Ruby worked a tad differently and not many people use include_package so you were first to notice this
<enebo>
pretty funny though because the message is weird
<telegardian>
well, I am resurrecting old code.. so I may need to refactor
<enebo>
telegardian: no it works
<enebo>
telegardian: include_package is fine
<enebo>
telegardian: it is just that last line in def include_package defines self.const_missing so you see :const_missing as a return value
<telegardian>
right, but the other issue isn't just the :const_missing return on that method, my additional issue is that I can't simulate the usage of the java classes that work in my code, using jirb
<enebo>
telegardian: sorry I did not read very closely
<telegardian>
enebo: my fault for sending cryptic log output, so let me demonstrate the challenge
<enebo>
telegardian: ok can you just file an issue this should work
<telegardian>
I have a routine that uses a Jar file called 'jline-0.94.jar' to clear a terminal window using an ANSI call.
<telegardian>
But that shouldnt matter if JRuby loads it, because I am calling a different version. JLine 2 is a rewrite that doesn't have the ConsoleReader class
<enebo>
telegardian: your error may be a different problem but irb loads readline which loads jline. Whether it works depends on classloader
<enebo>
oh I see
<telegardian>
let me try with another jar file.
<enebo>
telegardian: but also verify if that works with java_import vs java_package
<enebo>
telegardian: it is possible how we load classes changed and we do not load properly in java package now
<enebo>
telegardian: but if you only see this in irb then that is strange
<telegardian>
enebo: right, then code works flawlessly when I execute the program. its only in irb that I am struggling to replicate.
<enebo>
telegardian: yeah make a script which does not require many/any significant downloading and explanation in an issue
<telegardian>
ok. will do.
<enebo>
telegardian: I have not been hacking on Java integration side much so you will get someone like kares who has been doing a lot more recently seeing it
<enebo>
irb is a pretty weird beast itself but generally just all the eval + binding stuff. I don't really know why that would interfere with our Java features
<telegardian>
Its a little funky, because I wrote my project on JRuby specifically to take advantage of several Java libraries that provided either better or nonexistent capabilities of Ruby or gems available at the time.
<enebo>
that is usually a pretty common JRuby reason
<enebo>
afk 15
Puffball has joined #jruby
<headius>
yo yo yo
<headius>
I'm back again
<headius>
this is definitely a problem with the two jlines conflicting
<headius>
telegardian: ^
<headius>
two options for you
<headius>
--no-readline to IRB...though tht somewhat cripples the UI
<headius>
(your code will obviously work fine in a script btw since a script won't load Ruby readline lib)
<telegardian>
ok.
<headius>
second option would be to replace our readline with the pure-Ruby one...it works fine on non-Windows
<headius>
readline-ffi...should work fine on any *nix system
<headius>
the instructions there aren't great but basically you copy the readline-ffi "readline.rb" over the one in lib/ruby/stdlib
<headius>
and install the gem of course
<telegardian>
headius: I see it. I did submit a bug on this right before I read this reply, issue #5300 in github.
<headius>
no worries
<headius>
I'll comment and probably close it referencing the other bugs
<headius>
the long term plan is to get the non-jline readline to be our default
<telegardian>
I need to keep poking at this, because the version of JLine I am using is < 1.0 from 2008l, pretty crusty. And JLine2 and JLine3 are rewrites that dont include the same classes I am using
<headius>
well IRB is still usable without readline, and that probably would work fine
<headius>
BTW what are you doing with it and why do you need such an old version?
<telegardian>
I am using it for Input primarily.
<telegardian>
as an example, I wanted something to read a key and not require enter
<telegardian>
this code was written back in the Ruby 1.8 days. I am not sure that met my needs back then. let me look at it again, because that would save me a ton of trouble.