jeremyevans has quit [Read error: Connection reset by peer]
jeremyevans has joined #jruby
lucasb has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #jruby
_whitelogger has joined #jruby
snake_pliskin has joined #jruby
<snake_pliskin> hey quick question for embedding JRuby into a Java application. I create a new Ruby and then parse a script with the runtime adapter. I'm trying to pass in "this" to the runtime, but am not sure how to do it.
<snake_pliskin> I tried embedding it in a JavaObject, but that doesn't seem to work
<snake_pliskin> Ruby runtime = getRubyRuntime(mumble); // static singleton
<snake_pliskin> JavaObject me = JavaObject.wrap(runtime, this);
<snake_pliskin> RubyRuntimeAdapter evaler = JavaEmbedUtils.newRuntimeAdapter();
<snake_pliskin> runtime.defineVariable(self, Scope.THREAD);
<snake_pliskin> GlobalVariable self = new GlobalVariable(runtime, "this", me);
<snake_pliskin> EvalUnit evalUnit = evaler.parse(runtime,
<snake_pliskin> sourceFile.getInputStream(), scriptName, 1);
<snake_pliskin> evalUnit.run();
<snake_pliskin> ...but in the ruby script, $this doesn't have any of the methods of my real "this"
<snake_pliskin> it's like a wrapper...so how do I unwrap and use the real Java object underneath?
<snake_pliskin> thanks in advance
<snake_pliskin> oh, I figured out if I do $this.to_java I can then call methods on my java object. seems like too much indirection, I ought to be able to just set the global to the "this" directly
snake_pliskin has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
snake_pliskin has joined #jruby
<headius[m]> Hmm can you make that a simple piece of code for me? The formatting makes it hard to sort out
<headius[m]> Like a gist or a repo
_whitelogger has joined #jruby
lucasb has joined #jruby
sagax has joined #jruby
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
rtyler_ has joined #jruby
haze_ has joined #jruby
quadz_ has joined #jruby
ebarrett has joined #jruby
NightMonkey has quit [*.net *.split]
vext01 has quit [*.net *.split]
rtyler has quit [*.net *.split]
haze has quit [*.net *.split]
quadz has quit [*.net *.split]
NightMonkey has joined #jruby
jrafanie has joined #jruby
rtyler_ is now known as rtyler
rtyler has quit [Changing host]
rtyler has joined #jruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #jruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lucasb has quit [Quit: Connection closed for inactivity]
jrafanie has joined #jruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sagax has quit [Remote host closed the connection]
sagax has joined #jruby
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:5c8fdef by Charles Oliver Nutter): The build was broken. https://travis-ci.org/jruby/jruby/builds/587951707 [215 min 15 sec]
travis-ci has left #jruby [#jruby]
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:5c8fdef by Charles Oliver Nutter): The build was broken. https://travis-ci.org/jruby/jruby/builds/587951707 [231 min 36 sec]
travis-ci has left #jruby [#jruby]
<headius[m]> wish I could explain those inflater flavors
<headius[m]> failures
<headius[m]> not flavors
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:5c8fdef by Charles Oliver Nutter): The build was canceled. https://travis-ci.org/jruby/jruby/builds/587951707 [231 min 10 sec]
travis-ci has left #jruby [#jruby]
mmo has joined #jruby
<mmo> hi
<headius[m]> Hi!
<mmo> my name is "mmo" and you?
<mmo> hhhh
<headius[m]> Are you interested in JRuby?
<mmo> ?!!!
<headius[m]> This channel is for the jruby project
<mmo> Oky
<mmo> What is the purpose?
<headius[m]> JRuby is a version of the Ruby programming language that runs on top of the Java platform
<mmo> Oky
<mmo> Thanks for the information
<mmo> I'm sorry for the inconvenience
mmo has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]