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>
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'
<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