00:10
<
telegardian >
Is there a way to access the built in version of JLine supplied with JRuby?
00:12
<
telegardian >
irb(main):010:0> require 'jline/jline/2.11/jline-2.11.jar'
00:13
<
telegardian >
=> false
00:13
<
telegardian >
in IRB, I can see it is already loaded
00:13
<
telegardian >
which is expected, but is there already a 'module' wrapper namespace with the include_package that I can now reference?
00:14
<
telegardian >
I think you know what I mean, but for clarity, if I define:
00:14
<
telegardian >
module JavaUtil
00:14
<
telegardian >
include_package "java.util"
00:16
<
telegardian >
I can now do things like : JavaUtil::Date.new.getTime
00:18
<
telegardian >
I am looking for the same namespace in IRB for JLine if it exists.
02:05
zenspider has left #jruby ["ERC (IRC client for Emacs 25.2.1)"]
06:42
<
kares >
telegardian: there's no such namespace but you will have the Java classes accessible
06:43
<
kares >
think the package is jline (since we're using 2.x) thus e.g. Java::jline::Terminal
07:15
rdubya has quit [Ping timeout: 252 seconds]
08:09
jmalves has quit [Ping timeout: 245 seconds]
08:28
travis-ci has joined #jruby
08:28
travis-ci has left #jruby [#jruby]
08:32
jmalves has joined #jruby
09:49
telegardian has quit [Ping timeout: 252 seconds]
10:00
shellac has joined #jruby
12:00
rdubya has joined #jruby
12:42
shellac has quit [Quit: Computer has gone to sleep.]
12:43
shellac has joined #jruby
12:44
shellac has quit [Client Quit]
12:47
shellac has joined #jruby
12:49
rdubya has quit [Ping timeout: 264 seconds]
12:58
jmalves has quit [Remote host closed the connection]
12:58
jmalves has joined #jruby
12:59
jmalves has quit [Read error: Connection reset by peer]
13:18
Puffball_ has quit [Remote host closed the connection]
13:19
Puffball has joined #jruby
13:42
Puffball has quit [Remote host closed the connection]
13:43
jmalves has joined #jruby
13:44
Puffball has joined #jruby
13:48
jmalves has quit [Ping timeout: 240 seconds]
14:02
rdubya has joined #jruby
14:04
jmalves has joined #jruby
16:03
xardion has quit [Remote host closed the connection]
16:08
xardion has joined #jruby
16:24
<
lopex >
enebo: appear
16:29
jmalves has quit [Ping timeout: 268 seconds]
16:48
shellac has quit [Quit: Computer has gone to sleep.]
17:00
<
headius >
lopex: I think he's taking today off...US holidays this week
17:01
<
lopex >
same joni did
17:01
<
headius >
the new spam
17:02
<
lopex >
or testing on opensource
17:03
<
lopex >
headius: the one from joni didnt see through instance variable states
17:03
<
lopex >
like there's no such tools that do the job better already
17:04
<
headius >
yeah sounds maybe half useful
17:05
<
lopex >
headius: hmm, looks like all maven plugins (including polyglot) insert windows newlines when rewriting the pom
17:06
<
lopex >
well, *on windows
17:08
<
lopex >
I guess there's no easy anwser since they'd havee to preserve every newline
17:18
fredmorcos has joined #jruby
17:19
<
fredmorcos >
hello, I am on Archlinux, I installed JRuby from the package manager (which goes into /opt/jruby). I try to install the `thin` gem using jruby -S gem install thin and I get an error: checking for main() in -lc... RuntimeError: The compiler failed to generate an executable file. You have to install development tools first.
17:19
<
fredmorcos >
okay, gem install puma?
17:19
<
lopex >
yeah, it should work
17:19
<
fredmorcos >
I'm new to ruby, sinatra, and the jvm
17:20
<
fredmorcos >
will sinatra automatically pick up puma?
17:20
<
fredmorcos >
doesn't seem so, it's still picking up webrick
17:22
<
lopex >
I mostly run puma via puma directly, and it does pick config.ru
17:24
<
fredmorcos >
okay so may I ask a few questions about that: at the end of my App class I have this: run! if app_file == $0
17:24
<
fredmorcos >
so should I write a config.ru file with require './app'; then...?
17:24
<
fredmorcos >
run MyApp?
17:24
<
lopex >
I do so, yeah
17:25
<
fredmorcos >
okay, so now: jruby -S puma?
17:25
<
fredmorcos >
ah.. nice.. seems to work :) let me test
17:25
<
lopex >
it's -s Puma afaik
17:25
<
lopex >
but I can be wrong here
17:25
<
fredmorcos >
what do you mean -s Puma?
17:26
<
fredmorcos >
jruby -S rackup -s Puma?
17:27
<
lopex >
yeah, it does work for me here
17:27
<
lopex >
jruby -S puma does too
17:28
<
fredmorcos >
I get a whole bunch of exception traces from my server-side now
17:28
<
fredmorcos >
starting with: 2018-11-21 18:27:30 - NoMethodError - undefined method `implementation' for HTTP::CookieJar::AbstractStore:Class:
17:29
<
lopex >
are you sure you're running java version of puma ?
17:29
<
fredmorcos >
well I added puma to my gemfile, then did jruby -S bundle install
17:33
<
fredmorcos >
jruby -S gem list puma ===> puma (3.12.0 java)
17:34
<
fredmorcos >
it's in fact related to rest-client (which uses http-cookie)
17:34
<
lopex >
can you post a minimal example to reproduce ?
17:34
<
lopex >
yeah, they complain on http-cookie in that post
17:34
<
lopex >
it's abandoned
17:34
<
fredmorcos >
okay, is there a way to look at which options are supported when building a gem? maybe rest-client has the option to use something else
17:35
<
lopex >
I guess you might get the same on mri
17:35
<
fredmorcos >
no didn't get the same on mri... i'm now in the process of migrating to jruby
17:38
<
lopex >
maybe you have some versions locked in Gemfile.lock ?
17:38
<
fredmorcos >
I wrote the gemfile to jruby
17:38
<
fredmorcos >
but i'll delete it and try again
17:38
<
lopex >
try deleting it yeah
17:44
<
fredmorcos >
okay so just starting the app with jruby app.rb now picks up puma and works
17:44
<
fredmorcos >
but it's exactly twice as slow as webrick was
17:44
<
fredmorcos >
how do i require gems eagerly?
17:44
<
lopex >
it might hit autoload issues as they mention there
17:44
<
lopex >
hmm, maybe you could require some gems eagerly
17:44
<
lopex >
require them in config.ru
17:44
<
fredmorcos >
okay, will try that now, then can come back with the performance issue
17:44
<
lopex >
but that's just a guess
17:45
<
lopex >
yeah, you should warm that first, before any benchmarking
17:46
<
fredmorcos >
that's including warming up
17:46
<
fredmorcos >
so 1 warmup run + the avg of 3 runs: with webrick the entire benchmark took 0.9 seconds. now with puma it consistently takes 2.2 seconds
17:47
<
fredmorcos >
(btw i added require 'rest-client' and require 'http-cookie' to my config.ru and it works well, thanks!)
17:47
<
lopex >
cool, weird about that puma performance though
17:48
<
fredmorcos >
yeah...
17:48
<
lopex >
is that both with -e production ?
17:48
<
fredmorcos >
no, both without -e at all (so development)
17:49
<
fredmorcos >
let me test with -e production
17:49
<
fredmorcos >
jruby -S rackup -s webrick -e production
17:49
<
fredmorcos >
gives me the following: NameError: undefined local variable or method `production' for main:Object
17:50
<
lopex >
and "puma -e production" ?
17:50
<
fredmorcos >
ah, i see... rackup -e is for eval
17:50
<
lopex >
I dont know how rackup passes args around
17:51
<
lopex >
so there must be a way to pass args for the server somehow
17:51
<
lopex >
puma -e production -p some_port should do for now
17:52
<
fredmorcos >
with rackup it's -E, it should pass that to the server
17:54
<
fredmorcos >
so webrick and puma with -E production, performance results are the same as with development
17:54
<
fredmorcos >
~2.2 seconds with puma, and ~1 second with webrick
17:55
<
lopex >
yeah, it's weird, no idea why
17:56
<
lopex >
headius: ^^ any ideas ?
18:02
<
fredmorcos >
jruby -Xcompile.invokedynamic=true -X-O -X+C -J-Xmn512m -J-Xms2048m -J-Xmx2048m -J-server -J-Djruby.thread.pool.enabled=true -S rackup .....
18:03
<
fredmorcos >
webrick is now ~0.8 seconds and puma at ~2.1 seconds
18:03
<
fredmorcos >
anyways, at this point I guess I'm happy with webrick performance
18:03
<
lopex >
well, that shouldnt be the case
18:04
<
fredmorcos >
that I am happy? or that webrick is fast? or that puma is slow?
18:04
<
lopex >
that puma is slow
18:05
<
fredmorcos >
you expect it to perform within the ballpark of webrick or do you expect that it should perform better?
18:05
<
lopex >
fredmorcos: how involved is ruby logic on that endpoint ?
18:05
<
lopex >
or, is the response big or something ?
18:06
<
fredmorcos >
it's probably the simplest webapp in the world, the responses are mongodb IDs
18:06
<
fredmorcos >
so a few characters long
18:06
<
lopex >
then it deserves filing an issue imho
18:06
<
lopex >
it shouldnt be the case
18:07
<
fredmorcos >
the only thing i think i might be doing wrong is that i'm handling exceptions everywhere in my GET/POST/etc... handlers
18:07
<
lopex >
btw what java and jruby versions are used ?
18:07
<
fredmorcos >
jruby 9.2.2.0 (2.5.0) 2018-11-08 fc462a4 OpenJDK 64-Bit Server VM 11.0.1+13 on 11.0.1+13 +jit [linux-x86_64]
18:08
<
lopex >
well, if you have the time you could profile both runs
18:08
<
lopex >
I mean, both servers
18:09
<
fredmorcos >
yeah, I'll work on that... but first i need to finish the task at hand
18:09
<
fredmorcos >
i'm new to ruby, jvm, sinatra, web development, so i'm a bit in chaos/overwhelmed right now
18:09
<
lopex >
cool, puma being slower than webrick is somewhat worrying
18:28
Puffball has quit [Remote host closed the connection]
18:29
<
fredmorcos >
thanks so much for all your help lopex!
18:29
<
lopex >
fredmorcos: no problem
18:36
Puffball has joined #jruby
18:43
fredmorcos has quit [Remote host closed the connection]
18:57
subbu is now known as subbu|lunch
20:12
claudiuinberlin has joined #jruby
20:13
subbu|lunch is now known as subbu
23:58
travis-ci has joined #jruby
23:58
travis-ci has left #jruby [#jruby]