lucasb has quit [Quit: Connection closed for inactivity]
sagax has joined #jruby
dopplergange has quit [Quit: ZNC 1.7.3 - https://znc.in]
dopplergange has joined #jruby
eregon has quit [Ping timeout: 252 seconds]
eregon has joined #jruby
whitingjr has joined #jruby
sagax has quit [Read error: Connection reset by peer]
shellac has joined #jruby
sagax has joined #jruby
byteflam1 has joined #jruby
byteflam1 has quit [Ping timeout: 258 seconds]
byteflam1 has joined #jruby
byteflam1 has quit [Ping timeout: 245 seconds]
shellac has quit [*.net *.split]
eregon has quit [*.net *.split]
rtyler has quit [*.net *.split]
Osho has quit [*.net *.split]
NightMonkey has quit [*.net *.split]
justinmcp_ has quit [*.net *.split]
haze has quit [*.net *.split]
Osho has joined #jruby
haze has joined #jruby
eregon has joined #jruby
rtyler has joined #jruby
rtyler has quit [Changing host]
rtyler has joined #jruby
NightMonkey has joined #jruby
justinmcp has joined #jruby
shellac has joined #jruby
throstur has joined #jruby
<throstur> I'm having heaps of trouble with opsgenie/marid integration. I want to write my scripts in Ruby, but it seems that I cannot access "logger" from my ruby scripts. In groovy, the binding "logger.warn()" works fine, but in ruby, I get a NameError for undefined local variable or method "logger" for main:Object. I don't know how to debug this properly b
<throstur> ecause I can't figure out how all the parameter passing works, I think I'm getting close here though:https://github.com/opsgenie/opsgenieclient/blob/6d94efb16bbc74be189c86e9329af510ac8a048c/common/src/main/java/com/ifountain/opsgenie/client/script/ScriptManager.java https://github.com/opsgenie/opsgenieclient/blob/6d94efb16bbc74be189c86e9329af510ac
<throstur> sorry for the double paste
<throstur> OK, let's try something else... how do I write to file in JRuby? When I do ```File.open('ruby.log', 'a') do |f| ; f.puts "foo" ; end``` s/;/\n/ I get "unexpected "," on the comma after 'ruby.log'
whitingjr has quit [Quit: Leaving.]
whitingjr has joined #jruby
subbu|away is now known as subbu
lucasb has joined #jruby
subbu is now known as subbu|away
<enebo[m]> throstur: I think maybe try $logger. We do not get many BSF questions these days so I had to search through our source to even give you that
<enebo[m]> throstur: your second question looks like some Java quoting issue perhaps? What you wrote looks fine to me. You could do %q{ruby.log}, %q{a} ... to remove quoting within a java string to eliminate doubt
subbu|away is now known as subbu
sgeorge has joined #jruby
whitingjr has quit [Ping timeout: 258 seconds]
whitingjr has joined #jruby
sgeorge_ has joined #jruby
sgeorge has quit [Ping timeout: 276 seconds]
<throstur> I'm having problems pretty printing a variable. It's a "linkedhashmap". I tried PP.pp, JSON.pretty_generate, but I never get anything with newlines. What can I do?
<throstur> ah, it's a Java::JavaUtil::LinkedHashMap
<enebo[m]> throstur: ah yeah pp cannot see into the structure of a Java class
<throstur> how do I convert it to a ruby hash?
<throstur> is there an implicit way?
<enebo[m]> kares: have you ever done this?
<enebo[m]> I cannot think of one but a small each_with_object or collect could do it
<throstur> I'm fairly new to ruby
<enebo[m]> throstur: ah ok I will give you a snippet
<throstur> thank you
<throstur> seems like myvar.to_hash is the key
<throstur> enebo[m]: I might not need that snippet after all
<enebo[m]> {a: 1, b: 2}.each_with_object({}) { |(k, v), hash| hash[k] = v }
<enebo[m]> throstur: doh...yeah to_hash
<enebo[m]> haha
<enebo[m]> I was thinking a little too much along the lines of us adding specific Java Integration magic and forgot about to_hash
<kares[m]> unfortunately, we did drop the support to be able to inspect Java parts nicely
<kares[m]> its definitely on our todo but the list is long ;)
<kares[m]> anyway you should be able to use `to_s` which will to a Java `toString`
<kares[m]> assuming the Map impl has a decent toString
<kares[m]> throstur: and all java.util.Map instance in JRuby should have a `to_hash`
<throstur> I had tried to_s and that didn't work, but to_hash works fine
<kares[m]> `map.to_h` or `map.to_hash`
<kares[m]> than inspect the Hash (but if keys/values are Java types it will inspect them like you'v seen before)
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
byteflam1 has joined #jruby
shellac has quit [Ping timeout: 245 seconds]
throstur has quit [Remote host closed the connection]
af has joined #jruby
af has quit [Client Quit]
byteflam1 has quit [Ping timeout: 258 seconds]
byteflam1 has joined #jruby
byteflam1 has quit [Ping timeout: 245 seconds]
byteflam1 has joined #jruby
sgeorge_ has quit [Remote host closed the connection]
byteflam1 has quit [Ping timeout: 246 seconds]
byteflam1 has joined #jruby
<enebo[m]> kares: yeah reflective inspection would be super nice
<kares[m]> enebo: that I originally planned on top of inspect -> Java toString
<kares[m]> doing that was blocked by having Java method binds only at lowest level
<kares[m]> for JI ... we only setup overloaded methods on super types even if subtypes have them
<kares[m]> recently headius did talk about doing more in that direction
<kares[m]> so we might need to invent other ways, but those are all more demading
byteflam1 has quit [Ping timeout: 245 seconds]
byteflam1 has joined #jruby
byteflam1 has quit [Ping timeout: 268 seconds]
byteflam1 has joined #jruby
byteflam1 has quit [Ping timeout: 245 seconds]
whitingjr has quit [Quit: Leaving.]
dopplergange has quit [Read error: Connection reset by peer]
dopplergange has joined #jruby
lucasb has quit [Quit: Connection closed for inactivity]
bga57 has joined #jruby