havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
runescape07rsps has joined #ruby
__Yiota has joined #ruby
skweek has quit [Ping timeout: 276 seconds]
<roboncloud> i don't see any issues with rspec... works well
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
t-recx has quit [Quit: t-recx]
chouhoul_ has joined #ruby
nostalgiccloud has quit [Ping timeout: 260 seconds]
polishdub has quit [Quit: leaving]
<zenspider> if you like an slow overly complicated test framework... sure
chouhoulis has quit [Ping timeout: 276 seconds]
nostalgiccloud has joined #ruby
cagomez has quit [Remote host closed the connection]
brent__ has quit [Ping timeout: 248 seconds]
nobitanobi has joined #ruby
cagomez has joined #ruby
__Yiota has quit [Ping timeout: 246 seconds]
laphoraig75 has quit [Ping timeout: 240 seconds]
cagomez has quit [Ping timeout: 240 seconds]
<roboncloud> @zenspider i've experimented with most testing frameworks in Ruby: minitest, rspec(@ work, mostly), test-unit, & bacon. speed hasn't been an issue with any of them.
nobitanobi has quit [Remote host closed the connection]
nobitanobi has joined #ruby
kn-928 has quit [Ping timeout: 255 seconds]
guacamole has quit [Ping timeout: 260 seconds]
<roboncloud> not sure if speed improvements minitest may make are negligible, too. if i use minitest or rspec, my rails test suite will still take too long to boot, and over time it normally only gets worse.
hutch34 has joined #ruby
spheric has joined #ruby
<elomatreb> Boot time is another thing, but it is true that rspec seems to be rather slow. My suite currently takes ~2s for 150 examples (not including boot time, a fairly average Rails app).
nobitanobi has quit [Ping timeout: 260 seconds]
<roboncloud> i'm doubtful that rspec is the bottleneck
nacsurte has quit [Ping timeout: 260 seconds]
<elomatreb> But I got used to it years ago and it just feels more comfortable than test-unit-style frameworks
catphish has joined #ruby
nostalgiccloud has quit [Ping timeout: 240 seconds]
<zenspider> roboncloud: then you're not measuring well enough.
<roboncloud> are we also really complaining about 2s for 150 examples. anything under 1 minute is great to run all your projects tests. i don't think switching test framework is gonna shave anymore than a few seconds at most.
<zenspider> elomatreb: what level are those tests?
<zenspider> roboncloud: see above about measuring
<zenspider> (ie, you're objectively wrong)
<roboncloud> it sounds like you should have measurements already, given your level of confidence about it
<roboncloud> want to share?
nostalgiccloud has joined #ruby
<elomatreb> zenspider: No heavy integration stuff (no capybara or something like that), mostly just the components indepdently (if that's what you mean)
<catphish> this is probably off topic, but i feel the need to rant about some ignorance that i just experienced from a fellow developer when i reported a bug: https://github.com/ruby-amqp/bunny/issues/515 is it really so hard to believe that an application only has one thread
<roboncloud> it's easy to say you're wrong. you've written minitest, and claim rspec is "slow" to the point it matters. so show me some evidence of that please.
<zenspider> I've shared plenty. go see my talks. my blog. etc.
<roboncloud> 2012 is pretty old tho.
<zenspider> just ran some of those benchmarks... .3 vs .9... so it is now 3x slower
<roboncloud> i'll try the same here.
<elomatreb> Oo, Rails is heavy
<zenspider> and 4x heavier on memory
<zenspider> elomatreb: that is what I mean... models only or also controllers?
<elomatreb> Yes, and a few very basic view tests with nokogiri
nostalgiccloud has quit [Read error: Connection reset by peer]
nacsurte has joined #ruby
frozengeek_ has quit [Quit: frozengeek_]
gizmore|2 is now known as gizmore
nadir has joined #ruby
beilabs has joined #ruby
<zenspider> elomatreb: any access to these tests? (I don't care about the impl at all... just need to gather some rspec corpus)
<elomatreb> Sorry, it's a private app
<roboncloud> minitest is slower for me
<roboncloud> maybe my test case is wrong
<zenspider> probably... but I'd love to see it
<zenspider> there shouldn't be a single path through rspec that isn't massively longer than minitest
<zenspider> hell...I imagine running *nothing* is still slower
lxsameer has quit [Ping timeout: 276 seconds]
jenrzzz_ has joined #ruby
beilabs has quit [Remote host closed the connection]
<roboncloud> okay, can imagine, but the results rspec is faster, and the difference between the two is definitely negligible in any case.
__Yiota has joined #ruby
<zenspider> it's either faster or negligible ... again with the measuring
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
bmurt has joined #ruby
beilabs has joined #ruby
<roboncloud> yes, it can be faster, but the difference can be meaningless, aka negligible.
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> nope
jenrzzz has quit [Ping timeout: 240 seconds]
<zenspider> hrm... your fork thing is doing *something* odd... not sure what yet
<roboncloud> okay, then rspec is simply faster. using the same benchmark from 2012.
<zenspider> I *highly* doubt that...
<roboncloud> ugh? i'm not making it up.
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<ruby[bot]> roboncloud: as I told you already, please use https://gist.github.com
<zenspider> well.... since you've given no numbers. haven't given any meaningful statistics... yes. at this point you're making it up or wrong. I've published my numbers. I've curve fit it. I'm not talking out my ass
brent__ has joined #ruby
<roboncloud> heh. okay, let's step back, because this is crazy. i asked for numbers, you said go find them, in my talks or blog. so i found a benchmark, on your blog. i adapted it, run it against ruby 2.4, posted the benchmark, AND the results.
<roboncloud> so really, what are you talking about?
<zenspider> running your code as-is on my system, since the tests are basically the same as my previous code.... they're running too fast on both. I don't think either version is actually running tests
<roboncloud> that's posible
<roboncloud> let me check
<zenspider> you JUST posted the results.. so don't pretend you were forthright
<zenspider> and a single run is meaningless
jenrzzz_ has quit [Ping timeout: 246 seconds]
<zenspider> I think this is probably the cost of fork, loading code, and that's about it? I can't tell
<roboncloud> i posted the benchmark, as a standalone executable script you could run on your computer (if you can bring yourself to install bundler)
<roboncloud> yeah
<roboncloud> the tests aren't running....
<zenspider> I'm getting roughly .267 and .265... against my .3 and .9... so they're not running for some reason
<zenspider> in the case of fork... it might not run the at_exit handler the same way...
milardov_ has quit [Remote host closed the connection]
<roboncloud> ahh!
<roboncloud> this seems to work better
<roboncloud> but i think only rspec is running the tests
<roboncloud> not minitest
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> other way around for me
<zenspider> look at the footer... if it has 10000 runs, 10000 assertions, 0 failures, 0 errors, 0 skips then it is minitest
<zenspider> if it is only 2 numbers, it is rspec
<roboncloud> not sure
<roboncloud> Finished in 0.203112s, 49234.0048 runs/s, 49234.0048 assertions/s.
<roboncloud> 10000 runs, 10000 assertions, 0 failures, 0 errors, 0 skips
<roboncloud> i see both
<ruby[bot]> roboncloud: as I told you already, please use https://gist.github.com
<roboncloud> result ^
jackjackdripper1 has quit [Quit: Leaving.]
<roboncloud> so yeah, minitest is considerably faster
__Yiota has joined #ruby
<roboncloud> obviously very contrived examples tho
milardovich has joined #ruby
jaequery has joined #ruby
brent__ has quit [Ping timeout: 240 seconds]
_sfiguser has quit [Quit: Leaving]
cahoots has quit [Ping timeout: 240 seconds]
hutch34 has quit [Ping timeout: 276 seconds]
<ruby[bot]> roboncloud: as I told you already, please use https://gist.github.com
<roboncloud> congrats zenspider, looks like minitest has webscale
gizmore|2 has joined #ruby
gusrub has quit [Remote host closed the connection]
GodFather has joined #ruby
gizmore has quit [Ping timeout: 248 seconds]
ujjain has quit [Ping timeout: 240 seconds]
tohuw_ has quit [Changing host]
tohuw_ has joined #ruby
tohuw_ is now known as Tohuw
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 240 seconds]
ujjain has joined #ruby
ujjain has quit [Changing host]
ujjain has joined #ruby
nacsurte has quit [Ping timeout: 260 seconds]
gusrub has joined #ruby
Synthead has joined #ruby
<Synthead> is there a good way I can break up #( ... ) literals into multiple lines without including the newlines?
<zenspider> Synthead: ... are you sure you're talking ruby?
<Synthead> if I terminate the end of the first line with \, it works, but it also includes all the whitespaces before the text in the second line
<Synthead> zenspider, yeah
<Synthead> or sorry, %( ) literals
<zenspider> not that I know of... pop a .gsub on the end
<Synthead> ehh, I'd rather not tbh, that's kinda gross
<roboncloud> x = 'foo bar baz' \
<roboncloud> 'choo choo so long foo'
<roboncloud> 'doo boo bar' \
<roboncloud> is probably the fastest way.
<Synthead> I'd prefer to use string literals because I'm using a lot of "s with interpolated strings
bougyman has quit [Quit: ZNC 1.6.4 - http://znc.in]
<roboncloud> %() \ may work too, tbh never tried.
bougyman has joined #ruby
<Synthead> this is what I'm after, basically https://gist.github.com/anonymous/205bc5d76bc9ec7b72b6519dcf292d2b
<Synthead> this will test false
<zenspider> it should work... just another syntax for the same thing
<Synthead> but I'm looking for the string literal magic to make it true ;)
<zenspider> a = %( ... ).strip.gsub("\n", " ")
<Synthead> that's just so gross :p
hahuang65 has quit [Ping timeout: 260 seconds]
<zenspider> what's so gross is wanting yet more syntax for an edge case that 30 people in the world have
<Synthead> what if it existed already and there was an easy answer?
<Synthead> suppose I'm getting a "no" here
<zenspider> it doesn't. we said so. and now you're kvetching at the solutions we're providing you.
<zenspider> you're welcome
<Synthead> ok thanks for the help
<zenspider> you can get rid of some of it w/ the <<~HEREDOC form... but you'll still need to gsub the newlines
<roboncloud> doesn't tho, not with that literal, with " and ' you can use \, which creates one string and avoids post-processing on the string.
<zenspider> it basically only does the strip (and only on the LHS)
<zenspider> yeah. you need to have the trailing space to make it work right
<zenspider> a = "... " \(newline)"... " \(newline) etc
<zenspider> at that point, I usually use [strings...].join " "
<zenspider> roboncloud: did I miss something for your rspec code? it is "running" w/o printing and taking a HUGE amount of time
<zenspider> and I've stripped the fork/benchmark out
<zenspider> oh shit. it's 500k vs 10k :P
<roboncloud> ya
<roboncloud> should complete though
<zenspider> doesn't print?
<roboncloud> it takes around 29s for me
<roboncloud> it does, at the very end, in one huge swoop
kn-928 has joined #ruby
<roboncloud> then you have to scroll up to see the results
<zenspider> huh. not for me
<zenspider> lemme start pulling back the architecture
SeepingN has joined #ruby
<roboncloud> oh youre right
<roboncloud> it prints nothing
<roboncloud> ruby bench.rb
<roboncloud> user system total real
<roboncloud> rspec 23.280000 3.440000 26.720000 ( 26.727717)
<zenspider> then the comparison isn't fair. I think the way we did it, by testing against $0 is an apples to apples comparison
kn-928 has quit [Ping timeout: 255 seconds]
<roboncloud> fixed it
<roboncloud> + require 'rspec/autorun'
reaVer_ has quit [Ping timeout: 240 seconds]
<zenspider> switching it back to that... minitest: 10.47s & 434mb RSS vs rspec: 60.07s & 3526mb RSS
<zenspider> damn
<roboncloud> yea. pretty bad. 500k tests is extreme tho.
<zenspider> ok. 50k tests... 1.15s & 54mb vs 4.5s & 350mb
<zenspider> go through progressions and plot the curve... it's really nasty
<zenspider> and these are PASSING tests...
<zenspider> 100% failures... 50k tests: 4.32s & 378mb vs 18.53s & 811mb
<roboncloud> right, yeah, quite a lot of overheard but i imagine 2k~ ish would be the max size of a any rails suite.
<zenspider> so when you're refactoring... your test suite starts to work against you
Synthead has quit [Quit: Leaving]
<zenspider> you'd be wrong... but let's see: .26s & 25mb vs .87s & 43mb (for 100% failures)
<roboncloud> so in practical terms it may not matter. altho minitest is clearly the better choice if you care. i don't think average rails shop cares.
<zenspider> good to know: almost no difference if 100% raises
reaVer has joined #ruby
tlaxkit has joined #ruby
alfiemax has joined #ruby
<gr33n7007h> thank fuck for that, i thought a shit storm were about to brew
milardovich has quit [Remote host closed the connection]
benlieb has quit [Quit: benlieb]
* gr33n7007h gets the micrometers out lol
alfiemax has quit [Ping timeout: 255 seconds]
<zenspider> gr33n7007h: what are you on about?
cahoots has joined #ruby
<gr33n7007h> what?
<zenspider> I asked a simple question
<gr33n7007h> i answered
<zenspider> strike 2
<gr33n7007h> strike 2?
<gr33n7007h> ?
<Radar> gr33n7007h: yeah, it comes after strike 1 but right before strike 3.
<gr33n7007h> for real?
<zenspider> not sure what part you're misunderstanding... strike 2... in response to your BS above.
<gr33n7007h> and i want to know what strike 1 is?
<zenspider> could be language/culture barrier maybe? it is baseball and not everyone knows that (not that *I* know baseball)
milardovich has joined #ruby
<gr33n7007h> language?
<zenspider> you should verb sometime
<Radar> gr33n7007h: This was strike #1: gr33n7007h>
<Radar> whoops.
<gr33n7007h> Radar: that was in #offtopic
<Radar> don't care.
<zenspider> "fuck the martyrs, hang the cunts HIGH" ??? that's a big nope for me
<zenspider> !troll gr33n7007h
gr33n7007h was kicked from #ruby by ruby[bot] [trolling is a bannable offense, see http://ruby-community.com/pages/user_rules]
<zenspider> I don't give a fuck. fuck you
<zenspider> maybe he'll be less offensive when he's 15
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
tlaxkit has quit [Quit: Saliendo...]
catphish has quit [Quit: Leaving]
<roboncloud> opening that link was worth it just for: https://www.youtube.com/watch?v=pVQB42EjgD8
beilabs has quit [Remote host closed the connection]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit [Ping timeout: 240 seconds]
PresidentBiscuit has joined #ruby
askjdnakjdn has joined #ruby
MrBismuth has quit [Quit: https://www.youtube.com/watch?v=xIIqYqtR1lY -- Suicide is Painless - Johnny Mandel]
sarbs has joined #ruby
drcode has joined #ruby
astrobunny has joined #ruby
AndBobsYourUncle has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jaequery has joined #ruby
Silthias has quit [Ping timeout: 276 seconds]
AndBobsYourUncle has quit [Client Quit]
PresidentBiscuit has quit []
jaequery has quit [Client Quit]
carnegie has quit [Remote host closed the connection]
<roboncloud> "After releasing Ruby 2.4.0 and Getting Matz approval, I will promote all of stdlibs to default gem.". man, would be nice, at last.
<zenspider> thanks for reminding me. I need to transfer the ruby gem over to them
jaequery has joined #ruby
<roboncloud> no rush: Due in over 18 years (12/25/2035)
naprimer2 has quit [Ping timeout: 276 seconds]
SteenJobs_ has joined #ruby
armyriad has quit [Ping timeout: 240 seconds]
mattp_ has left #ruby ["WeeChat 1.7"]
brent__ has joined #ruby
gusrub has quit []
uZiel has joined #ruby
<roboncloud> maybe nicest of them all
nacsurte has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
carnegie has joined #ruby
elsevero has joined #ruby
<roboncloud> i hope big ass frameworks like rails follow the same advice in all their active*, action* etc gems too, and gems generally. it'd be great
nacsurte has quit [Ping timeout: 248 seconds]
__Yiota has joined #ruby
beilabs has joined #ruby
carnegie has quit [Ping timeout: 246 seconds]
carnegie has joined #ruby
brent__ has quit [Remote host closed the connection]
carnegie has quit [Remote host closed the connection]
brent__ has joined #ruby
beilabs has quit [Ping timeout: 260 seconds]
gusrub has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
kies has quit [Ping timeout: 276 seconds]
alfiemax has joined #ruby
gusrub has quit [Client Quit]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dstrunk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 240 seconds]
xuanrui has joined #ruby
govg has joined #ruby
alfiemax has joined #ruby
sarbs has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has quit [Ping timeout: 248 seconds]
dymaxion_ has joined #ruby
twe4ked has quit [Quit: ZNC - http://znc.in]
hahuang65 has joined #ruby
askjdnakjdn has quit [Quit: Leaving]
twe4ked has joined #ruby
kn-928 has joined #ruby
dymaxion_ has quit [Ping timeout: 276 seconds]
hahuang65 has quit [Ping timeout: 276 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Remote host closed the connection]
kn-928 has quit [Ping timeout: 276 seconds]
alfiemax has joined #ruby
aupadhye has joined #ruby
emilford has joined #ruby
jphase has quit []
gix has quit [Ping timeout: 240 seconds]
cadillac_ has quit [Ping timeout: 248 seconds]
hutch34 has joined #ruby
nacsurte has joined #ruby
cadillac_ has joined #ruby
gix has joined #ruby
enterprisey has joined #ruby
nacsurte has quit [Ping timeout: 240 seconds]
kies has joined #ruby
milardovich has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
goyox86_ has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
emilford has quit [Quit: Lost terminal]
grvgr_ has joined #ruby
elsevero has quit [Ping timeout: 240 seconds]
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
SteenJobs_ has quit [Quit: SteenJobs_]
jaequery has joined #ruby
SteenJobs_ has joined #ruby
dionysus69 has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
cahoots has quit [Ping timeout: 246 seconds]
conta has joined #ruby
goyox86_ has quit [Quit: goyox86_]
howdoi has joined #ruby
milardovich has joined #ruby
conta has quit [Ping timeout: 240 seconds]
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
uZiel has quit [Ping timeout: 268 seconds]
Mia has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
bhrgunatha has joined #ruby
dionysus69 has joined #ruby
bhrgunatha has quit [Quit: ChatZilla 0.9.93 [Firefox 54.0.1/20170630112252]]
warrsrike has joined #ruby
<warrsrike> people I could really use your ass
<warrsrike> assistance*
<warrsrike> so I need help with this regex. description inside https://gist.github.com/anonymous/429f868bbbac1f7b7e9849a6b7cc355b
bzb has joined #ruby
bzb has quit [Remote host closed the connection]
xcesariox has quit [Quit: Textual IRC Client: www.textualapp.com]
minimalism has quit [Quit: minimalism]
ltem has joined #ruby
hanmac has quit [Remote host closed the connection]
grvgr_ is now known as grvgr
<elomatreb> warrsrike: Can commas appear in the brackets/fields?
<elomatreb> nvm, yes
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
<warrsrike> elomatreb: yeah. because java methods have commas between args
alfiemax has quit [Remote host closed the connection]
warrshrike has joined #ruby
<warrshrike> sorry guys got dc'd
<warrshrike> did anyone reply?
warrsrike has quit [Ping timeout: 260 seconds]
<warrshrike> so the issue is an argument appearing in EnclMethod which has square brackets
<bougyman> this is really not a job for regex.
<warrshrike> so basically need to adapt so that if another square bracket comes before the previous one has closed allow it
ur5us has quit [Remote host closed the connection]
<warrshrike> bougyman: what do you suggest?
<bougyman> you can do some crazy backtracking.
<bougyman> warrshrike: a parser.
<warrshrike> bougyman: but it works perfect other than the small issue of square brackets :/
ur5us has joined #ruby
Bock has joined #ruby
<warrshrike> bougyman: okay how do I do it with a parser
<bougyman> warrshrike: you can just hack around that.
<bougyman> count the brackets in the string before you do your thing.
<bougyman> use the regex if the thing doesn't hit your edge cases.
<bougyman> if it does, do something else.
<warrshrike> bougyman: string splits galore?
nacsurte has joined #ruby
<bougyman> whatever it takes.
<bougyman> some recursion could pull it off.
ged has quit [Quit: WeeChat 1.8]
mahlon has quit [Quit: WeeChat 1.9]
<warrshrike_> dfs*
warrshrike_ has joined #ruby
<bougyman> I meant a recursive method, not regex recursion.
<bougyman> I mean, that method would likely use some regex or other string matching shit.
nicolai86 has quit [Quit: ZNC - http://znc.in]
<warrshrike_> the only way I know other than regex is string.split chaining
<bougyman> I'm trying not to program this for you and just get you thinking.
<warrshrike_> bougyman: how would recursion do it? some bfs voodoo?
<warrshrike_> learning from a gurus work
nicolai86 has joined #ruby
<warrshrike_> bougyman: it would be very helpful if you programmed it tho ^_^
ur5us has quit [Ping timeout: 240 seconds]
<bougyman> that's how you become guru.
<warrshrike_> bougyman: fair enough ~_~
<bougyman> not as helpful as you figuring it out yourself.
milardovich has quit [Read error: Connection reset by peer]
gix has quit [Quit: Client exiting]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bougyman> there's no anchor you could use?
<bougyman> That's kinda the rule with when you use regex or not.
<warrshrike_> bougyman: whats an anchor
warrshrike has quit [Ping timeout: 260 seconds]
<bougyman> If you can't anchor it, probably not the right tool.
nacsurte has quit [Ping timeout: 248 seconds]
<bougyman> \b, for instance
<bougyman> if the last ] were always followed by a \n, you could use $
milardovich has joined #ruby
<bougyman> but that's not applicable here.
<bougyman> ^ and $ are anchors, but there are many others.
<warrshrike_> bougyman: oh yeah I don't think it is. the thingies end with ] so I was using that as last matching char but as we saw it causes problems with [] in method args
<bougyman> don't [ inside the ^[ ]$ fuck you up just as much?
<bougyman> I guess only if they come after a ] in it.
<bougyman> still, it's a mess.
<warrshrike_> yeah...
<bougyman> you can't contain on [ and ] if [ stuff ] stuff can contain [ and ]
<warrshrike_> bougyman: exactly, thats the issue
dionysus69 has quit [Ping timeout: 260 seconds]
<warrshrike_> "], [" maybe this can be the inter thingy boundary?
<bougyman> wait, there's always quotes in the thing?
<bougyman> If so, that's your anchor.
<warrshrike_> what do you mean quotes? no theres no ""
<warrshrike_> its just ], [
<bougyman> [" starts it, and "] ends it.
<bougyman> oh.
<bougyman> well you put quotes there :)
<warrshrike_> bougyman: hahah yeah I was quoting
<warrshrike_> so it has this pattern []. [], []
<warrshrike_> and each [] can have some [] too
<bougyman> the comma could be used, I think that's why 08/15-22:03 <....... elomatreb> warrsrike: Can commas appear in the brackets/fields?
<bougyman> he asked that.
<bougyman> if there can be commas in there, too, that fucks you up, a bit
<bougyman> cause you can't guarantee ], won't be in the input
<bougyman> 1st rule of regex: Know your data.
<elomatreb> My initial thought was to split on ,\s*, to allow greedy matching on []
<warrshrike_> yes it can have commas
<warrshrike_> as java methods arguments are comma seperated
<warrshrike_> and enclMEthods are just java methods
<warrshrike_> what about ], [ tho?
A124 has quit [Quit: '']
<warrshrike_> java method args can't begin with [ right?
<elomatreb> If the format (i.e. the order of stuff) is fixed you could use that to your advantage
<warrshrike_> so that means there can't be a ] followed by , followed but [ INSIDE the outer []
<warrshrike_> elomatreb: yes its fixed
<warrshrike_> id always comes first etc
SeepingN has quit [Quit: The system is going down for reboot NOW!]
jackjackdripper has joined #ruby
elsevero has joined #ruby
<elomatreb> Then anchor the regex with the key names, that should allow you to use brackets and greedy matching
<warrshrike_> elomatreb: how can I do that?
jamal7 has joined #ruby
<elomatreb> E.g. /\[Node Id: (\d+)], \[Java Type & Name: (.+)], \[EncClass: ....
hahuang65 has joined #ruby
<elomatreb> It won't be fast but I think it should work
<elomatreb> Additional tip: Name your matching groups, like (?<node_id>\d+)
AndBobsYourUncle has joined #ruby
wilbert_ has joined #ruby
<warrshrike_> elomatreb: this? res = str.scan(/\[Node Id: (\d+)], \[Java Type & Name: (.+)], \[EnclClass: (.+)], \[EnclMethod: (.+)\], /).to_h
hahuang65 has quit [Ping timeout: 240 seconds]
<elomatreb> That last group would capture until the end of the string, if you only care about those keys you need to include the start of the next key as well to anchor it again
<warrshrike_> elomatreb: iike this? res = str.scan(/\[Node Id: (\d+)], \[Java Type & Name: (.+)], \[EnclClass: (.+)], \[EnclMethod: (.+)\], \[/).to_h
MrBusiness has joined #ruby
ta_ has quit [Remote host closed the connection]
<elomatreb> Almost, it would capture SflowType as well
frozengeek_ has joined #ruby
<elomatreb> End it with [SflowType, and it should work
sleetdrop has joined #ruby
<warrshrike_> elomatreb: so resa = str.scan(/\[Node Id: (\d+)\], \[Java Type & Name: (.+)\], \[EnclClass: (.+)\], \[EnclMethod: (.+)\], \[SflowType/).to_h
tastygradient has joined #ruby
<warrshrike_> I get this error: `to_h': wrong array length at 0 (expected 2, was 4) (ArgumentError)
<elomatreb> It seems to work for me (the regex)
<warrshrike_> elomatreb: are you doing .to_h at end?
rabajaj has joined #ruby
kn-928 has joined #ruby
<elomatreb> .to_h on an array expects an array of the form [[key, value], [otherkey, othervalue]], which would result in {key: value, otherkey: othervalue}
<elomatreb> See above, you should start by naming your capture groups
oleo has quit [Quit: irc client terminated!]
dviola has quit [Quit: WeeChat 1.9]
ana_ has joined #ruby
<elomatreb> Then, use #match instead of #scan and call #named_captures on the result to get a Hash (i.e. `str.match(/yourregex/).named_captures`)
frozengeek_ has quit [Quit: frozengeek_]
<warrshrike_> elomatreb: I guess array is fine too since I'm just going to send the value to a function...
<warrshrike_> why does enclMethod have a preceding whitespace?
<elomatreb> Because there are two spaces in your data, but we only have one in the regex, so it captures the second space as well
kn-928 has quit [Ping timeout: 248 seconds]
<warrshrike_> elomatreb: gotcha. will use str.strip on it
<elomatreb> Keep in mind though that this whole thing will break when the format of the data changes even slightly
f48ds2 has joined #ruby
frozengeek_ has joined #ruby
alex`` has joined #ruby
wilbert_ has quit [Ping timeout: 240 seconds]
apparition has joined #ruby
<warrshrike_> elomatreb: yeah format isn't expected to change. thanks a lot man
jameser has joined #ruby
alex`` has quit [Quit: WeeChat 1.9]
milardovich has quit [Remote host closed the connection]
uZiel has joined #ruby
dlitvak has quit [Quit: Connection closed for inactivity]
nacsurte has joined #ruby
shiranuidong has quit [Ping timeout: 255 seconds]
shiranuidong has joined #ruby
shiranuidong has quit [Max SendQ exceeded]
shiranuidong has joined #ruby
nacsurte has quit [Ping timeout: 246 seconds]
claw has quit [Ping timeout: 255 seconds]
claw has joined #ruby
enterprisey has quit [Remote host closed the connection]
milardovich has joined #ruby
cahoots has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
warrshrike_ has quit [Ping timeout: 260 seconds]
cahoots has quit [Ping timeout: 255 seconds]
enterprisey has joined #ruby
jamal7 has quit [Quit: Textual IRC Client: www.textualapp.com]
tastygradient has quit [Quit: leaving]
conta has joined #ruby
aufi has joined #ruby
alfiemax has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
eroux has quit [Ping timeout: 240 seconds]
username_ has joined #ruby
anisha has joined #ruby
im0nde has joined #ruby
djbkd has quit [Remote host closed the connection]
SteenJobs_ has quit [Quit: peaceee]
djbkd has joined #ruby
anisha has quit [Client Quit]
username_ has quit [Ping timeout: 260 seconds]
gix has joined #ruby
nacsurte has joined #ruby
ShekharReddy has joined #ruby
ta_ has joined #ruby
jamesaxl has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
shwouchk has joined #ruby
enterprisey has quit [Remote host closed the connection]
nacsurte has quit [Ping timeout: 246 seconds]
alfiemax has quit [Remote host closed the connection]
Doow has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
TomyWork has joined #ruby
alfiemax has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
Dimik has joined #ruby
djbkd has quit [Remote host closed the connection]
brent__ has quit [Ping timeout: 248 seconds]
mark_66 has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
hahuang65 has joined #ruby
kbengala has joined #ruby
kbengala has quit [Client Quit]
kbengala has joined #ruby
dionysus69 has joined #ruby
kn-928 has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
crst has joined #ruby
lxnr has joined #ruby
Burgestrand has joined #ruby
kn-928 has quit [Ping timeout: 240 seconds]
hightower3 has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
frozengeek_ is now known as frozengeek
lxnr has quit [Ping timeout: 240 seconds]
<crst> Hi, how do I get the "/subfolder/" part from http://domain.com/subfolder/ ?
<crst> like current_page
<crst> which gives me only "index.html"
jackjackdripper has quit [Quit: Leaving.]
<crst> current_path gives me "subfolder/index.html"
<elomatreb> >> require "uri"; URI("http://domain.com/subfolder/").path
<ruby[bot]> elomatreb: # => "/subfolder/" (https://eval.in/845838)
opekktar has joined #ruby
<elomatreb> But it sounds like you're in Rails? There must be a helper for that
<crst> elomatreb: I'm in middleman
nacsurte has joined #ruby
mikecmpbll has joined #ruby
alfiemax has quit [Remote host closed the connection]
Silthias has joined #ruby
nacsurte has quit [Ping timeout: 246 seconds]
im0nde has quit [Quit: im0nde]
quobo has quit [Quit: Connection closed for inactivity]
Terens_ has joined #ruby
nofxxxx has quit [Ping timeout: 240 seconds]
<Terens_> I spent 3 weeks and still cant find why ruby as a daemons
opekktar has quit [Quit: Leaving]
<Terens_> wasts so much memory
<Terens_> wates
<Terens_> wastes
nofxxxx has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
ferr1 has joined #ruby
<dminuoso> Terens_: I'd make a "yo ruby" joke, but I've been told to stop being hateful.
<dminuoso> Terens_: Essentially Ruby has a really lazy GC, the VM is big and fat
jamesaxl has joined #ruby
<Terens_> however agent just creates a small file 2-3kb every 15 secs. Memory starts at 40mb and now is 200mb .. also cpu starts at 2.5% and now is 30% and does the same thing.
<Terens_> after 10 days
Antiarc has quit [Remote host closed the connection]
<dminuoso> Terens_: Is it stable at 200mb memory?
Antiarc has joined #ruby
<dminuoso> Terens_: use memory_profiler ?
Joufflu_Fail has quit [Ping timeout: 240 seconds]
Burgestrand has quit [Quit: Closing time!]
MichaelBurge has quit [Remote host closed the connection]
hightower2 has joined #ruby
vall has joined #ruby
MichaelBurge has joined #ruby
jinie_ has quit [Read error: Connection reset by peer]
cahoots has joined #ruby
Burgestrand has joined #ruby
quazimodo has joined #ruby
quazimodo has quit [Read error: Connection reset by peer]
quazimodo has joined #ruby
<quazimodo> hey what's the preferred internal documentation implementation?
<quazimodo> is it just rdoc?
<dminuoso> quazimodo: rdoc is by far the most popular one. Other options include sdoc or yard
<dminuoso> quazimodo: Don't use a preferred, try them out and judge for yourself.
<dminuoso> YARD has that advantage of being incredibly extendible
jinie_ has joined #ruby
cahoots has quit [Ping timeout: 240 seconds]
kbengala has left #ruby [#ruby]
NeverTired has joined #ruby
Dimik has quit [Ping timeout: 276 seconds]
hahuang65 has joined #ruby
jackjackdripper has joined #ruby
<quazimodo> ok
sagax has quit [Ping timeout: 240 seconds]
<quazimodo> i had a java/.net programmer in the dog park tell me about how i use a scripting language and that real programmers approach from an architecture view and are this and that
<quazimodo> he did backend also
<quazimodo> and it was pretty lame
arne has quit [Ping timeout: 255 seconds]
arne has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
Mon_Ouie has quit [Ping timeout: 246 seconds]
Beams has joined #ruby
vall has quit [Read error: Connection reset by peer]
Mon_Ouie has joined #ruby
beilabs has joined #ruby
_main_ has joined #ruby
quobo has joined #ruby
lxnr has joined #ruby
crst has quit [Remote host closed the connection]
__main__ has quit [Ping timeout: 255 seconds]
_main_ is now known as __main__
__main__ has quit [Read error: Connection reset by peer]
jackjackdripper has quit [Quit: Leaving.]
__main__ has joined #ruby
<dminuoso> quazimodo: The term "scripting language" seems to be just name calling.
<dminuoso> For example: Can you define what a scripting language is exactly?
lxnr has quit [Ping timeout: 276 seconds]
nacsurte has joined #ruby
alfiemax has joined #ruby
Mon_Ouie has quit [Ping timeout: 255 seconds]
ltem has quit [Quit: Leaving]
biberu has joined #ruby
nacsurte has quit [Ping timeout: 248 seconds]
<matthewd> dminuoso: One in which, in normal operation, the executed program is given to the runtime in source form
hackeron has joined #ruby
<matthewd> dminuoso: Doesn't seem like a particularly *useful* distinction, mind you :)
hackeron has quit [Changing host]
hackeron has joined #ruby
<dminuoso> matthewd: Which seems to apply to most attempts to provide a definition. In my experience what people are trying to express is "this looks like a serious language" and "this looks like a toy language"
dymaxion_ has joined #ruby
<dminuoso> matthewd: And even that distinction of yours becomes really problematic. It seems to he universally accepted that python is a scripting language, but it can be precompiled. Is it still a scripting language according to your definition?
Mon_Ouie has joined #ruby
<matthewd> Hence my "in normal operation" hedge ;)
<dminuoso> Heh. :)
<matthewd> See also, JavaScript seemingly headed towards a *need* for a compile step
<dminuoso> matthewd: Considering the projected speedups in Rails with Ruby 3x3 I dont find that surprising
dymaxion_ has quit [Ping timeout: 240 seconds]
nofxxx has joined #ruby
savoir-faire has quit [Ping timeout: 276 seconds]
catphish has joined #ruby
nofxxxx has quit [Ping timeout: 248 seconds]
<dminuoso> matthewd: Though why did you use "need" ?
lexruee__ is now known as lexruee
lxnr has joined #ruby
<catphish> dminuoso: my bug got some love last week, but not sure about the proposed solution https://bugs.ruby-lang.org/issues/13794
pandaant has joined #ruby
huddy has joined #ruby
<dminuoso> catphish: That is not a fix.
<catphish> dminuoso: that was my opinion
<dminuoso> catphish: I've thought about this problem a real while, and I simply don't see a trivial way to address it.
<dminuoso> Other than what we talked about in the end
<catphish> i think my proposed solution is the simplest, it still feels lightly hacky
<catphish> but probably correct
hackeron has quit [Quit: leaving]
hackeron has joined #ruby
hackeron has quit [Client Quit]
hackeron has joined #ruby
hackeron has joined #ruby
hackeron has quit [Changing host]
<dminuoso> catphish: I think it might be best to write a simple native extension that can forcibly create that situation.
hackeron has quit [Client Quit]
bweston92 has joined #ruby
hackeron has joined #ruby
tomphp has joined #ruby
<catphish> that would be cool, i'll see if i can
hackeron has quit [Client Quit]
alfiemax has quit [Remote host closed the connection]
<dminuoso> catphish: btw Ive also realized why you are getting this situatoin so frequently in the first place.
<dminuoso> It's most likely a native extension.
<catphish> that's entirely plausible, i have a lot of gems in this app
hackeron has joined #ruby
<dminuoso> catphish: or rather any thread.
<dminuoso> catphish: fork releases the gvl, so another thread can instantly consume it and then starts that atomic_inc/stuff/atomic_dec thing.
<dminuoso> catphish: So fork is always closely aligned with that racey code.
<catphish> oh, so immediately after calling fork, but before forking, another thread grabs the lock?
<dminuoso> right.
<dminuoso> which in itself is fine
<matthewd> Does that imply having fork keep the GVL would fix it, though?
<dminuoso> matthewd: Yes, absolutely.
<dminuoso> Or let me rephrase: I think so. :)
<catphish> another odd fact is that i thought my code pre-fork only had the one main thread, but i haven't verified this
<dminuoso> catphish: Was there a pending signal?
<dminuoso> Oh wait, we ruled out signal handlers on a single thread, because execution of the main thread is delayed until the signal handler is completed.
<catphish> so, it does seem like the application only has one thread before it forks, i'm not sure why i didn't pay more attention to this fact previously
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jamesaxl has quit [Read error: Connection reset by peer]
<catphish> i think the way forward is to try to force this to happen
jamesaxl has joined #ruby
lxnr has quit [Quit: WeeChat 1.9]
DTZUZO has quit [Ping timeout: 246 seconds]
<catphish> i'm still getting over my anger from last night at the maintainer of Bunny https://github.com/ruby-amqp/bunny/issues/515
alfiemax has joined #ruby
<catphish> fortunately that particular issue does seem to have been fixed
<matthewd> > Please post questions to the mailing list in the future.
<catphish> that much seemed like a reasonable request :)
<matthewd> That thread seems to be a pretty good summary of why when I redirect people to our mailing list, I generally don't answer their question even if I know the answer.
<catphish> i think my politeness in not calling it a bug from the outset was a mistake
mim1k has joined #ruby
<catphish> but his ignorance astounded me, informed him repeatedly that i only had one thread, provided evidence of this, he didn't want to listen :(
<catphish> but the issue is resolved, so i guess that's something
charliesome has joined #ruby
<matthewd> catphish: Yes, the issue is resolved. Move on.
<matthewd> Your position is, IMO, much less sympathetic than you seem to think it is, and that's before you keep trawling for said sympathy
nacsurte has joined #ruby
ltem has joined #ruby
<catphish> i am not looking for sympathy, but for condemnation of Michael
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
umaaji has joined #ruby
<catphish> mostly for the childish act of locking a thread to assert that his version of facts is correct when it is not
astrobunny has quit [Read error: Connection reset by peer]
bronson has joined #ruby
DoubleMalt has joined #ruby
<apeiros> catphish: Timeout::Error - are you using timeout? if so, that alone already creates a new thread.
nacsurte has quit [Ping timeout: 240 seconds]
kn-928 has joined #ruby
<catphish> apeiros: i'm not, Bunny is, it uses several threads
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<catphish> anyway, i don't really understand the bug, but i'm glad that it's fixed, and not caused by any mistake on my part (except not using the latest version)
pandaant has quit [Remote host closed the connection]
kn-928 has quit [Ping timeout: 246 seconds]
Mia has quit [Ping timeout: 276 seconds]
Serpent7776 has joined #ruby
<Terens_> this is how memory goes 40 mins
pwnd_nsfw` is now known as pwnd_nsfw
gloscombe has joined #ruby
<dminuoso> Terens_: that looks normal.
<dminuoso> As long as there's no permanent trend or just an obviously unreasonable amount of memory used I dont think there's a problem
<catphish> i often find memory usage in more complex apps can rise over a reasonably long period (days) before eventually settling on a steady value, that chart looks like a fairly small and sensible swing
mim1k has quit [Ping timeout: 248 seconds]
vondruch has joined #ruby
shwouchk has quit [Quit: Connection closed for inactivity]
<Terens_> actually it seems that it grows slowly. http://i.imgur.com/gjM4NFP.png
<Terens_> the peaks
<Terens_> although I am not storing anything
<catphish> i often see this behaviour, it can be annoying, it usually settles eventually, i don't know enough about ruby's internals to question it
juststrollingin has joined #ruby
umaaji has quit [Quit: Leaving...]
elsevero_ has joined #ruby
bronson has quit [Remote host closed the connection]
elsevero has quit [Ping timeout: 240 seconds]
elsevero_ is now known as elsevero
<Terens_> I hope that it settles
<dminuoso> Terens_: Did you run a memory profiler?
<Terens_> Yes nothing strange found
<Terens_> I had the same behavior just running a loop with Open3.capture2('echo shit')
<Terens_> in a plain ruby file. Memory grew to 500mb in openbsd but in ubuntu stayed low 26mb
<Terens_> it seems that it haas different behavior under different o/s
sagax has joined #ruby
<dminuoso> Terens_: What does `pp GC.stat` give you?
belmoussaoui_ has joined #ruby
<Terens_> it seems stable when I ran GC.stat nothing grew
cahoots has joined #ruby
<Terens_> does it look normal?
stamina has joined #ruby
runescape07rsps has quit [Ping timeout: 246 seconds]
mim1k has joined #ruby
<roboncloud> catphish: maintenance burden of open source is real.
<roboncloud> after answering same question for the 500th time, it's understandable if you might be a little tired of it
cahoots has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
quazimodo has quit [Read error: Connection reset by peer]
quazimodo has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hfp_work has quit [Quit: bye]
alfiemax has quit [Remote host closed the connection]
belmoussaoui_ has quit [Quit: belmoussaoui_]
hahuang65 has quit [Ping timeout: 240 seconds]
belmoussaoui_ has joined #ruby
nacsurte has joined #ruby
hfp_work has joined #ruby
opencw has joined #ruby
hahuang65 has joined #ruby
belmoussaoui_ has quit [Client Quit]
nacsurte has quit [Ping timeout: 240 seconds]
belmoussaoui_ has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
adlerdias has joined #ruby
faces has quit [Read error: Connection reset by peer]
runescape07rsps has joined #ruby
belmoussaoui_ has quit [Quit: belmoussaoui_]
apparition47 has joined #ruby
gregf_ has joined #ruby
<catphish> roboncloud: indeed, i have open source software i can see how that could happen
tirej has joined #ruby
<roboncloud> yeah. it's a pain in the ass. that's why i think it's better to not seek mass adoption, and if it comes by chance, it's better to emigrate to serbia than make oss customer support part of your life.
bikefighter has quit [Quit: Connection closed for inactivity]
DTZUZO has joined #ruby
<catphish> for the most part it seems to be a fine balance between telling people they need to learn more / debug issues themselves, while still being polite and providing answers where you know them
<catphish> and the pleasant small number of tickets that are actually fixable bugs :)
<roboncloud> yea. if you wanna walk that line at all then probably right. doesnt sound worth it to me. id prefer to write more software than divert my time to issue support and the like.
tvw has joined #ruby
<roboncloud> esp since it's my free time, which is limited
DTZUZO has quit [Ping timeout: 240 seconds]
uZiel has quit [Ping timeout: 268 seconds]
hutch34 has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
beilabs has quit [Remote host closed the connection]
uZiel has joined #ruby
ldnunes has joined #ruby
nacsurte has joined #ruby
<Terens_> this is my memory is it ok?
jottr has joined #ruby
kn-928 has joined #ruby
<catphish> i don't think there's necessary a single answer to that question, however if this was my application i would not be worried
<catphish> but i would monitor it long term to make sure it doesn't increase indefinitely
sepp2k has joined #ruby
nacsurte has quit [Ping timeout: 240 seconds]
<Terens_> it shouldnt increase since It does the same thing at interval,
<Terens_> I will monitor it
<Terens_> for 3 days
<Terens_> With daemons gem it seemed that memory increase was x2
rabajaj has quit [Remote host closed the connection]
DTZUZO has joined #ruby
username has joined #ruby
adlerdias_ has joined #ruby
tirej has quit [Quit: leaving]
faces has joined #ruby
synthroid has joined #ruby
username has quit [Ping timeout: 240 seconds]
adlerdias has quit [Ping timeout: 260 seconds]
adlerdias_ is now known as adlerdias
laphoraig92 has joined #ruby
bruno- has joined #ruby
gnufied has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
runescape07rsps has quit [Quit: Leaving]
bronson has joined #ruby
xall has joined #ruby
adlerdias has quit [Quit: adlerdias]
bronson has quit [Ping timeout: 246 seconds]
tlaxkit has joined #ruby
gnufied has joined #ruby
nowhere_man has joined #ruby
__Yiota has joined #ruby
cahoots has joined #ruby
aupadhye has quit [Ping timeout: 240 seconds]
nacsurte has joined #ruby
kassav_ has joined #ruby
cahoots has quit [Ping timeout: 240 seconds]
nacsurte has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Ping timeout: 255 seconds]
hutch34 has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
gnufied has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
cabotto has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
hogetaro has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
gnufied has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoul_ has quit [Remote host closed the connection]
quobo has quit [Quit: Connection closed for inactivity]
belmoussaoui has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
maryo has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
cdg_ has joined #ruby
tomphp has quit [Read error: Connection reset by peer]
tomphp_ has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
<roboncloud> i wish `gem install https://github.com/someproj/foo.git` worked.
alfiemax has joined #ruby
bronson has joined #ruby
ur5us has joined #ruby
<dminuoso> catphish: Use a condition a construct of 2 condition variables/semaphores/mutexes to enforce a precise serialization that forces fork to release the gvl, wait for the other thread to have incremeneted the counter, have that thread block, resume the fork and once forked release all synchronization methods and let it exit.
<roboncloud> decentralised, and super convient.
<dminuoso> *Use a construct
maryo has quit [Ping timeout: 240 seconds]
<catphish> dminuoso: that sounds ideal, it will take me a while to pick through that sentence and turn it into code
bronson has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 260 seconds]
alfiemax_ has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
nacsurte has joined #ruby
hightower2 has quit [Ping timeout: 240 seconds]
adlerdias has joined #ruby
nadir has joined #ruby
DLSteve has joined #ruby
nacsurte has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
ledestin has joined #ruby
gchristensen has joined #ruby
<gchristensen> Hi, anyone know how to go from a netmask, ie: `255.255.255.192` to the cidr prefix length, ie: `26`? I'm not finding a way to do it with IPAddr.
jameser has joined #ruby
alfiemax_ has quit [Ping timeout: 246 seconds]
jameser has quit [Client Quit]
<dminuoso> gchristensen: Yes.
dymaxion_ has joined #ruby
<dminuoso> gchristensen: Do you want the answer spoonfed, or just a slight tiny hint?
<gchristensen> how about a tiny hint to start? I'll probably learn it better that way.
<dminuoso> gchristensen: What is a netmask?
<dminuoso> And b) IPAddr#to_i
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
<herwin> IPAddr.new('255.255.255.192').to_i.to_s(2).count('1')
* herwin feels dirty
<dminuoso> herwin: And here I was, trying to just give him a tiny hint. :(
awoond10 has joined #ruby
<gchristensen> lol, thank you dminuoso and herwin :P I guess I was hoping for a less dirty solution >.>
dymaxion_ has quit [Ping timeout: 240 seconds]
<dminuoso> gchristensen: There's a few other variants that go down the same road, but ultimately its a mathematical question.
<gchristensen> I understand, I do know how, on paper, to get from a netmask to the prefix length :)
<herwin> I have a PR/feature request open to make the subnet a bit more accessible from within IPAddr
jottr has quit [Quit: WeeChat 1.9]
<dminuoso> herwin: Show me a link, and Ill [Like] it.
<dminuoso> That reminds me, why do we not use facebook for issue tracking?
<gchristensen> lol
aglorei1 has quit [Remote host closed the connection]
aglorei1 has joined #ruby
<dminuoso> herwin: github is always ignored.
<dminuoso> herwin: make a feature request on the bug tracker
f48ds2 has quit [Ping timeout: 240 seconds]
<dminuoso> (at least for non-trivial merge requests, other than documentation/typo fixes)
<herwin> dminuoso: you mean https://bugs.ruby-lang.org/issues/11210
<dminuoso> Heh!
<herwin> but you can't like it there
<dminuoso> I cant like it on github either.
<herwin> or I never found the button
<herwin> thumbs-up-emoji is pretty much the same
<dminuoso> herwin: Are you dutch?
<herwin> yes
elsevero has quit [Quit: elsevero]
savoir-faire has joined #ruby
elsevero has joined #ruby
elsevero has quit [Client Quit]
chouhoul_ has joined #ruby
chouhoulis has quit [Ping timeout: 276 seconds]
xall has quit [Ping timeout: 240 seconds]
gloscombe has quit [Ping timeout: 240 seconds]
Fin1te has joined #ruby
Rapture has joined #ruby
nobitanobi has joined #ruby
__Yiota has joined #ruby
SpiffTR has joined #ruby
gloscombe has joined #ruby
ferr1 has quit [Quit: WeeChat 1.9]
awoond10 has quit [Quit: ChatZilla 0.9.93 [Firefox 54.0.1/20170628075643]]
bruno- has quit [Ping timeout: 240 seconds]
xall has joined #ruby
conta has quit [Ping timeout: 276 seconds]
conta has joined #ruby
cahoots has joined #ruby
hogetaro has quit [Quit: Leaving...]
SpiffTR has quit [Quit: Leaving.]
cahoots has quit [Ping timeout: 260 seconds]
Burgestrand has quit [Quit: Closing time!]
Emmanuel_Chanel has joined #ruby
chouhoulis has joined #ruby
<catphish> i can't actually think of an elegent solution to the netmask question
bruno- has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 248 seconds]
tomphp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SpiffTR has joined #ruby
Silthias has quit [Read error: Connection reset by peer]
Silthias has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
SpiffTR has quit [Client Quit]
Silthias1 has joined #ruby
<dminuoso> 32 - Math.log2((2**32 - 4294967233) + 1)
<dminuoso> catphish: ^-
Silthias1 has quit [Read error: Connection reset by peer]
<dminuoso> or generally: -> (mask) { 32 - Math.log2((2**32 - addr.to_i) + 1) }
Silthias1 has joined #ruby
<dminuoso> >> getCidr = -> (mask) { 32 - Math.log2((2**32 - addr.to_i) + 1) }; puts getCidr.(IPAddr.new('255.255.255.192'))
<ruby[bot]> dminuoso: # => uninitialized constant IPAddr (NameError) ...check link for more (https://eval.in/846075)
<dminuoso> >> require 'ipaddr'; getCidr = -> (mask) { 32 - Math.log2((2**32 - addr.to_i) + 1) }; puts getCidr.(IPAddr.new('255.255.255.192'))
<ruby[bot]> dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<dminuoso> >> require 'ipaddr'; getCidr = -> (mask) { 32 - Math.log2((2**32 - addr.to_i) + 1) }; puts getCidr.(IPAddr.new('255.255.255.192'))
<dminuoso> Sigh
<ruby[bot]> dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
Fin1te has quit [Quit: Later, tater.]
<dminuoso> >> require 'ipaddr'; getCidr = -> (addr) { 32 - Math.log2(2**32 - addr.to_i) }; puts getCidr.(IPAddr.new('255.255.255.192'))
<ruby[bot]> dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<dminuoso> #=> 26.0
<dminuoso> Thank you ruby[bot].
Silthias has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
cabotto has quit []
<catphish> cool, i must learn more about log functions
theunraveler has joined #ruby
<dminuoso> The fuck?
AMHOL has joined #ruby
milardovich has joined #ruby
<catphish> language sir
hahuang65 has quit [Ping timeout: 248 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
goyox86_ has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
graft has quit [Ping timeout: 240 seconds]
mustmodify has joined #ruby
goyox86_ has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
gusrub has joined #ruby
Rapture has quit [Read error: Connection reset by peer]
oleo has joined #ruby
tlaxkit has quit [Remote host closed the connection]
tlaxkit has joined #ruby
guacamol1 has quit [Quit: Lost terminal]
elsevero has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
aufi has quit [Quit: Leaving]
xzhao has joined #ruby
SpiffTR has joined #ruby
_sfiguser has joined #ruby
cahoots has joined #ruby
<mustmodify> Just had a revelation. I guess it was obvious just hadn't occurred to me.
King_DuckZ has joined #ruby
<mustmodify> Uh... actually, I'm confused. Can I define a method called ... say ... StateParser ?
<mustmodify> I know it's against the convention.
<matthewd> mustmodify: Yes
<King_DuckZ> hi, is there a simple way to read the selection clipboard from ruby?
gloscombe has quit [Ping timeout: 248 seconds]
<King_DuckZ> ruby 2.0.0p648, specifically
<mustmodify> matthewd: Assuming I have a class Location, how would I define Location::StateParser as a method? Not a proc or lambda... but something that would use the interface Location::StateParser(input)
cahoots has quit [Client Quit]
<matthewd> mustmodify: class Location; def self.StateParser(input); ..; end; end
<matthewd> mustmodify: But still.. don't do that. :)
bronson has joined #ruby
<mustmodify> weird, I just tried that and it didn't work for me. I had to call it as Location.StateParser
<dminuoso> mustmodify: explicit parens
<mustmodify> matthewd: but you're right, it's so foreign. I was just trying it on for size.
<mustmodify> Oh...
<mustmodify> that's probably it.
__Yiota has joined #ruby
<mustmodify> dminuoso: good catch.
ana_ has quit [Ping timeout: 240 seconds]
catphish has quit [Read error: Connection reset by peer]
<mustmodify> dminuoso: yep.
<mustmodify> I've been learning React.
<mustmodify> ES6 is actually pretty good. I mean, you still can't create a "regular old class", but...
<dminuoso> Great! Now stop it and learn ELM instead.
<dminuoso> :P
<mustmodify> it's pretty good.
<dminuoso> mustmodify: well the word "class" is so overloaded.. no matter what language you look at, the meaning is totally different.
xzhao has quit [Ping timeout: 240 seconds]
<mustmodify> I really enjoyed passing around functions that didn't need classes, though. And I just created a module whose sole purpose was to contain a method, so I thought I'd just see how it felt. But it feels bad.
xzhao has joined #ruby
<mustmodify> dminuoso: Sure. I mean an easy way to create an instance that knows itself and doesn't need all kinds of magic to access itself. Though I'm sure I'd need to write a more technical definition to really express what I mean.
<mustmodify> Anyway, would it be technically correct to say that methods are not first-class objects in Ruby?
<dminuoso> mustmodify: Nope.
<dminuoso> >> method(:puts)
<ruby[bot]> dminuoso: # => #<Method: Object(Kernel)#puts> (https://eval.in/846127)
bronson has quit [Ping timeout: 255 seconds]
<dminuoso> mustmodify: They are just not as elegantly accessible as functions in JavaScript for example.
<dminuoso> mustmodify: Afaik the only things that are not first-class objects are procs and local variables.
<dminuoso> *BLOCKS
<dminuoso> Strike that, blocks too.
<mustmodify> ok, well is there a technical word to say that? That functions aren't ... like ... conventionally aren't used alone?
kn-928 has quit [Ping timeout: 260 seconds]
King_DuckZ has left #ruby [#ruby]
<dminuoso> mustmodify: Well these form of method objects are not particularly useful and unergonomic. You might as well act as if Ruby had no first-class functions/methods.
cagomez has joined #ruby
<dminuoso> mustmodify: But then you have to realize that lambdas/procs come into place
<mustmodify> unergonomic... hunh.
<mustmodify> So I have a Location class. And our API often receives non-abbreviations for the 'state' field, or non-standard abbreviations, like "s.c." or " s. c." or "south carolina (SC)" or "Pakistan"
goyox86_ has joined #ruby
<mustmodify> so I wrote a method that takes the common strings and fixes them.
<mustmodify> It doesn't belong in Location because it's not really modeling that... it's just cleaning up from the API.
<mustmodify> So I was going to call it Location::StateParser or something.
<mustmodify> but I guess Location.state_parser is just as good.
<mustmodify> It's the javascript taking hold of my brain.
MyMind has joined #ruby
Sembei has quit [Ping timeout: 248 seconds]
kn-928 has joined #ruby
gloscombe has joined #ruby
goyox86_ has quit [Client Quit]
mustmodify has left #ruby [#ruby]
gnufied has quit [Remote host closed the connection]
yourname has joined #ruby
goyox86_ has joined #ruby
goyox86_ has quit [Client Quit]
goyox86_ has joined #ruby
<matthewd> yourname: Your ruby version is too old
<yourname> that's what I figured. thanks :)
mark_66 has quit [Remote host closed the connection]
[Butch] has joined #ruby
SpiffTR has quit [Quit: Leaving.]
synthroid has quit [Remote host closed the connection]
dionysus69 has joined #ruby
<havenwood> yourname: You might try changing that first line shebang to: #!/usr/bin/env ruby
synthroid has joined #ruby
<havenwood> yourname: (When you get a newer Ruby.)
<yourname> thank you guys :)
<havenwood> yourname: Ruby 2.0+
<havenwood> no prob, happy coding!
<havenwood> Preferably Ruby 2.3 or 2.4, but mandatory keyword arguments are available in 2.0 or higher.
synthroid has quit [Ping timeout: 246 seconds]
apparition47 has quit [Quit: Bye]
<matthewd> I thought mandatory was 2.1
<havenwood> matthewd: I had to check but you're right!
uZiel has quit [Ping timeout: 268 seconds]
<dminuoso> Here we shoot Ruby developers for not using 2.4
<dminuoso> But then again Im the only one.
<dminuoso> So it's easy to enforce.
troys has joined #ruby
<havenwood> yourname: Mandatory kwargs are actually Ruby 2.1, not 2.0. I was wrong. Sorry about the misinformation...
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
<havenwood> matthewd: Thanks for the correction! Took a few versions to iron out I guess. My memory is a bit murky on the kwargs.
<matthewd> havenwood: Probably better that we all just agree to ignore the distinction between 2.old and 2.old, anyway ;)
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
<havenwood> dminuoso: 2.5-dev is acceptable as well. ;-)
goyox86_ has quit [Quit: goyox86_]
<havenwood> 2.old is old!
<matthewd> Yeah, I think 2.0 was kwargs, then 2.1 for mandatory
<dminuoso> havenwood: Remind me to change the rule before I try it out. The gun is ready on my desk.
nobitanobi has quit []
<dminuoso> 20>> def f(f:) end
<ruby[bot]> dminuoso: # => /tmp/execpad-d461407f62a4/source-d461407f62a4:2: syntax error, unexpected ')' ...check link for more (https://eval.in/846200)
<dminuoso> 21>> def f(f:) end
<ruby[bot]> dminuoso: # => :f (https://eval.in/846201)
<dminuoso> matthewd, havenwood ^-
synthroid has joined #ruby
<dminuoso> >> def f f: :f end
username has joined #ruby
<ruby[bot]> dminuoso: # => /tmp/execpad-e52841408a1a/source-e52841408a1a:2: syntax error, unexpected keyword_end, expecting ';' ...check link for more (https://eval.in/846210)
<dminuoso> y u no parse.
elsevero has quit [Quit: elsevero]
elaptics has joined #ruby
AMHOL has quit [Ping timeout: 260 seconds]
grvgr has quit [Quit: Connection closed for inactivity]
Psi-Jack has joined #ruby
xcesariox has joined #ruby
<Psi-Jack> What is an ideal way to check if a hash(of hash), has a key, and that key's value is true, so I can make a condition that handles appropriately whether the key exists and is true, or not?
<Doow> Anyone know if the windows ruby installer (from https://rubyinstaller.org/downloads/ ) is possible run silently? or at least without user interaction.
<dminuoso> Psi-Jack: ignore whether the key exists.
<matthewd> Psi-Jack: `if h[k]`?
<dminuoso> Psi-Jack: if it doesnt and you access it, you get a nil
cadillac_ has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
cdg_ has quit [Remote host closed the connection]
cdg has joined #ruby
cschneid_ has joined #ruby
<Doow> dminuoso: awesome, thank you
<Psi-Jack> dminuoso: Perfect.
<cschneid_> Are `Float`s 64 bit under the covers? And are there any lower precision ones that use up less memory?
<cschneid_> same w/ Fixnum I guess - I have a much more constrained range, but need millions of them :)
<Psi-Jack> So, if the hash object node['zabbix']['agent_tags']['somekey'] = false, or is undefined, then 'if node['zabbix']['agent_tags']['somekey']' will still handle it as the false result for an else statement?
cadillac_ has joined #ruby
<Psi-Jack> or would comparing if that == true, be better/the same?
cdg has quit [Ping timeout: 248 seconds]
<cschneid_> Psi-Jack: I came in halfway through, but `== true` will check that it is *exactly* the value `true`, rather than if you left it off, it's "any truthy value" which is basically anything but false & nil.
<Psi-Jack> Okay.
<Psi-Jack> That part is fine. It mandates a specific structure. :)
theunrav_ has joined #ruby
jottr has joined #ruby
theunraveler has quit [Ping timeout: 240 seconds]
jamal7 has joined #ruby
<Psi-Jack> mostly trying to clean up code that was using arrays when hashes could've been better.
<Psi-Jack> And far cleaner. :)
jamal7 has quit [Client Quit]
marxarelli has joined #ruby
xall has quit [Ping timeout: 240 seconds]
jaequery has joined #ruby
username_ has joined #ruby
thuryn has quit [Quit: User wandered away]
Rapture has joined #ruby
herbmillerjr has quit [Quit: Konversation terminated!]
Serpent7776 has quit [Quit: Leaving]
conta has quit [Ping timeout: 240 seconds]
benlieb has joined #ruby
herbmillerjr has joined #ruby
__Yiota has quit [Ping timeout: 248 seconds]
ana_ has joined #ruby
kassav_ has quit [Quit: kassav_]
mtkd has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
cdg has joined #ruby
armyriad has joined #ruby
kies has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
knight33 has joined #ruby
ecuanaso has joined #ruby
eckhardt has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
jamal7 has joined #ruby
kn-928 has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
SeepingN has joined #ruby
jamal7 has quit [Quit: Textual IRC Client: www.textualapp.com]
hahuang65 has joined #ruby
Beams has quit [Quit: .]
ana_ has quit [Ping timeout: 260 seconds]
jottr has quit [Ping timeout: 246 seconds]
Dimik has quit [Ping timeout: 248 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikepack has joined #ruby
mikepack has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 246 seconds]
xall has joined #ruby
nacsurte has joined #ruby
hahuang65 has joined #ruby
tlaxkit has quit [Quit: Saliendo...]
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
theunrav_ has quit [Remote host closed the connection]
theunraveler has joined #ruby
stamina has quit [Quit: WeeChat 1.9]
ltem has quit [Quit: Leaving]
xall has quit [Quit: xall]
dionysus69 has quit [Read error: Connection reset by peer]
xuanrui has quit [Ping timeout: 240 seconds]
TomyWork has quit [Ping timeout: 240 seconds]
PaulCapestany has quit [Ping timeout: 260 seconds]
jamal7 has joined #ruby
synthroi_ has joined #ruby
kapil___ has joined #ruby
synthroid has quit [Ping timeout: 248 seconds]
goyox86_ has joined #ruby
bronson has joined #ruby
PaulCapestany has joined #ruby
bronson has quit [Ping timeout: 248 seconds]
Dimik has joined #ruby
belmoussaoui has quit [Quit: belmoussaoui]
ryandv has joined #ruby
<ryandv> does capybara attempt to start a new HTTP server for every example that is run?
dlitvak has joined #ruby
ResidentBiscuit has quit [Ping timeout: 240 seconds]
iomotoko has joined #ruby
<iomotoko> is there any serious use case for irb (interactive ruby interpreter)?
<iomotoko> besides learning & quick calculations?
<konsolebox> pry is better
kies has joined #ruby
<havenwood> iomotoko: repl-driven development, etc
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
<havenwood> ?pry
<ruby[bot]> Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
ResidentBiscuit has joined #ruby
<Papierkorb> iomotoko: prototyping small ideas ... and actually, as calculator for some things for me lol
<havenwood> iomotoko: You can put a `binding.irb` or `binding.pry` in your code for debugging.
<iomotoko> havenwood: ah nice
<Papierkorb> iomotoko: You can even debug a daemon process with pry if you set it up correctly
f48ds2 has joined #ruby
<iomotoko> Papierkorb: havenwood: thanks, will watch that vid when I have time :)
guacamole has joined #ruby
hahuang65 has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
jottr has joined #ruby
Puffball_ has joined #ruby
elaptics has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
kn-928 has joined #ruby
milardovich has quit []
Puffball has quit [Ping timeout: 248 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kn-928 has quit [Ping timeout: 240 seconds]
guacamole has joined #ruby
beilabs has joined #ruby
goyox86_ has quit [Quit: goyox86_]
Dimik has quit [Ping timeout: 255 seconds]
segy has quit [Ping timeout: 248 seconds]
jinie_ has quit [Quit: ZNC 1.6.1 - http://znc.in]
jinie has joined #ruby
mikecmpbll has joined #ruby
<Psi-Jack> So, now I have a whole lot of keys in a hash of hash. I want to loop through each node['zabbix']['trap_agents']['live'] where each key under there matches true. Similarly, for each true value for each key under node['zabbix']['agent_meta']
gloscombe has quit [Quit: WeeChat 1.9]
<tobiasvl> Psi-Jack: you mean where every value under there matches true, right?
<Psi-Jack> Yes. I have many key: value pairs in node['zabbix']['trap_agents']['live'] like node['zabbix']['trap_agents']['live']['script1.sh'] = true|false
Puffball_ has quit [Remote host closed the connection]
<Psi-Jack> I actually need to act on both true, and false in that so that one I think is easy.
<Psi-Jack> node['zabbix']['trap_agents']['live'].each do |script, flag|
<tobiasvl> yeah
<Psi-Jack> For the node['zabbix']['agent_meta']['$name'] I need only the true ones to build a space-seperated string.
Puffball has joined #ruby
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
<tobiasvl> well you can do the same thing basically, or use select
<tobiasvl> node['zabbix']['trap_agents']['live'].select {|k, v| v }
s3nd1v0g1us has joined #ruby
<tobiasvl> will return a hash with just the entries where the values are true
gchristensen has left #ruby ["WeeChat 1.7.1"]
t-recx has joined #ruby
<Psi-Jack> Well, node['zabbix']['agent_meta'].select in that case. But isn't there a simpler way to build the string I need?
<Psi-Jack> Without having to loop through it again after that .select? ;)
troys is now known as troys_
<tobiasvl> of course, you can just do something like: node['zabbix']['trap_agents']['live'].select {|k, v| v }.keys.join " "
<Psi-Jack> ahhh
KeyJoo has joined #ruby
BSAlb has joined #ruby
cwailes has joined #ruby
benjen has quit [Read error: Connection reset by peer]
<tobiasvl> I guess I meant node['zabbix']['agent_meta']['$name'] but you get the gist
<Psi-Jack> Yes, yes I do, thank you.
<cwailes> I'm trying to use rbenv inside of a Docker image. When I run `rbenv install 2.2.2` it will download the tar.bz2 file, but then it simply exits with an return status of 1. Does anyone know where I can find additional info on what caused the error?
<Psi-Jack> I can also use something similar to that but replace .keys.join with .any? to determine if there's any actual values resulting.
BSaboia has quit [Ping timeout: 240 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<tobiasvl> yeah
benjen has joined #ruby
__Yiota has joined #ruby
Joufflu has joined #ruby
laphoraig92 has quit [Quit: Leaving]
<Psi-Jack> .select {|k, v| v}.keys.join " " would join the values, or the keys?
jamal7 has quit [Quit: Textual IRC Client: www.textualapp.com]
<cwailes> No ideas on why rbenv might be failing silently?
<apeiros> Psi-Jack: the keys
<apeiros> since you do explicitly .keys, which, as the name implies, returns the keys
segy has joined #ruby
lxsameer has joined #ruby
<matthewd> cwailes: I think ruby-build has a -v option that might help
lxsameer is now known as Guest70123
<Psi-Jack> Oh! D'uh. ;)
<matthewd> cwailes: Do you have a full build environment accessible inside the container?
<Psi-Jack> I'
<Psi-Jack> I'm still a little sick, so mind's not totally 100%. :)
<matthewd> Psi-Jack: This sort of experimentation is a great use case for exploring in irb
<Psi-Jack> True!
xzhao has quit [Remote host closed the connection]
xzhao has joined #ruby
theunraveler has quit []
xzhao has left #ruby [#ruby]
spheric has quit [Read error: Connection reset by peer]
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
benlieb has quit [Quit: benlieb]
kalimirch has joined #ruby
nopolitica has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
nopolitica has joined #ruby
dstrunk has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
ski7777 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
cdg_ has joined #ruby
Bock has quit [Ping timeout: 248 seconds]
Rapture has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jinie has joined #ruby
cdg has quit [Ping timeout: 255 seconds]
rubylegend2092 has joined #ruby
cdg_ has quit [Ping timeout: 240 seconds]
<tobiasvl> Psi-Jack: .keys.join will join the keys, yes :)
<tobiasvl> .values.join would join the values
ShekharReddy has quit [Quit: Connection closed for inactivity]
<Psi-Jack> Yeah. I've actually been testing the results, and it's so far working to expectations. :D
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
FernandoBasso has joined #ruby
cdg has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
ozcanesen has joined #ruby
huddy has quit [Quit: Connection closed for inactivity]
eb0t has quit [Quit: WeeChat 1.4]
ShekharReddy has joined #ruby
kn-928 has joined #ruby
sleetdrop has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
minimalism has joined #ruby
chouhoul_ has joined #ruby
eb0t has joined #ruby
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
quazimodo has quit [Ping timeout: 255 seconds]
theta8 has quit [Ping timeout: 248 seconds]
jinie has joined #ruby
beilabs has quit [Remote host closed the connection]
uZiel has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
f48ds2 has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
hammerhead has joined #ruby
xuanrui has joined #ruby
harfangk has joined #ruby
<cwailes> matthewd: I have gcc and make. It looks like autoconf was missing. I'm installing that now.
Rapture has joined #ruby
<cwailes> matthewd: That didn't fix it, unfortunately.
<cwailes> matthewd: What else would I need, besides gcc, ruby-dev, make, and autoconf?
<hammerhead> Hi all, when you do gem source --add SOURCE_URI, which file does gem edit to add a new source repo?
<matthewd> cwailes: build-essential is the easy shortcut if you're on a Debian based machine.. plus probably some form of zlib-dev, and maybe others?
<cwailes> matthewd: I usually run Fedora, but this has to be inside an Ubuntu image.
<hammerhead> oww.. I found something useful http://guides.rubygems.org/command-reference/#gem-sources
<hammerhead> This should be in a man page.
ski7777 has joined #ruby
<matthewd> cwailes: The easy option can be to find the OS package's build deps
<matthewd> cwailes: `apt-get build-dep ruby` or something?
<matthewd> cwailes: I imagine most "how to install/build ruby" guides would have a proper list of deps, too
<cwailes> Well, apt-get complained that it was unable to find a source package for ruby.
<cwailes> Does rbenv save any log files anywhere?
<cwailes> This would be simple if I just knew what it wanted.
<havenwood> cwailes: You're on Ubuntu?
<cwailes> havenwood: Ubuntu Docker image.
troys_ is now known as troys
<havenwood> cwailes: Brightbox maintains nice, up-to-date Ruby packages for Ubuntu: https://www.brightbox.com/docs/ruby/ubuntu/
<cwailes> I don't usually use Ubuntu, but I have to in this instance.
<havenwood> cwailes: In the chruby wiki we have the apt deps as: sudo apt-get install -y build-essential bison zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libffi-dev
<havenwood> I think there's a deps list in rbenv wiki as well.
<havenwood> One nice thing in favor of ruby-install is it does install them for you.
<cwailes> Hmm
<cwailes> Thanks.
<havenwood> You're welcome.
cagomez has quit [Remote host closed the connection]
<cwailes> Even with those dependencies installed rbenv still fails silently. I think I'll try the brightbox repo.
iomotoko has quit [Ping timeout: 260 seconds]
dviola has quit [Ping timeout: 260 seconds]
conta has joined #ruby
<havenwood> cwailes: If you have issues with the Brightbox repo I'd be happy to help you build with ruby-install for rbenv, or I'm sure someone else could help you debug with ruby-build. Let us know!
quobo has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
synthroid has joined #ruby
chouhoulis has joined #ruby
<cwailes> havenwood: Thanks a bunch. It looks like the repo installed Ruby just fine.
bronson has joined #ruby
synthroi_ has quit [Ping timeout: 246 seconds]
<cwailes> havenwood: I was attempting to use ruby-build earlier. When I ran `rbenv install 2.2.2` it would download the tar file and exit with a status of 1.
elsevero has joined #ruby
<havenwood> Maybe a permissions error? Great, nice to use a well-maintained package anyways!
conta has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 255 seconds]
Silthias1 has quit [Read error: Connection reset by peer]
<cwailes> havenwood: Could be. I'm kind of rushing through this. I've been trying to get this Ruby on Rails app running for a couple of days now and it hasn't been going well.
<Psi-Jack> Hmmm.. For some reason node['zabbix']['agent_meta'].select {|k, v|}.keys join " " is coming back an empty string. :/
<Psi-Jack> Oh... I forgot the v...
<Psi-Jack> Hah!
cwailes has quit [Quit: cwailes]
cwailes has joined #ruby
bronson has quit [Ping timeout: 246 seconds]
mim1k has joined #ruby
username has quit [Ping timeout: 240 seconds]
ecuanaso has joined #ruby
username_ has quit [Ping timeout: 255 seconds]
FernandoBasso has quit [Ping timeout: 255 seconds]
dviola has joined #ruby
<tobiasvl> yeah, the v alone means that it selects the ones where v evaluated to true
<tobiasvl> select takes a block and selects those key-value pairs where the block evaluates to true
mim1k has quit [Ping timeout: 246 seconds]
marxarelli is now known as marxarelli|afk
nadir has quit [Quit: Connection closed for inactivity]
hammerhead has quit [Quit: Page closed]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GGMethos has quit [Ping timeout: 255 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FernandoBasso has joined #ruby
cdg has joined #ruby
harfangk has quit [Remote host closed the connection]
GGMethos has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
npgm has joined #ruby
elsevero has quit [Quit: elsevero]
xall has joined #ruby
ledestin has joined #ruby
<xall> currently working through ruby koans. needed a count so came up with this
<xall> @messages.each_with_object(Hash.new(0)) { |msg, counts| counts[msg] += 1 }[name]
<xall> but then realized
<xall> @messages.count(name)
<xall> doh
<havenwood> xall: nice
<havenwood> meditation brought enlightenment
<xall> shoulda known ruby had a better way
<xall> well my hunch was it did but pushed forward trying to get the other way to work first. but yeah, ruby koans doing work
ta_ has quit [Remote host closed the connection]
tomphp has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
cam27 has joined #ruby
tomphp_ has joined #ruby
eckhardt has joined #ruby
tomphp has quit [Ping timeout: 240 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guacamole has joined #ruby
yokel has quit [Remote host closed the connection]
adlerdias has quit [Quit: adlerdias]
dionysus69 has quit [Remote host closed the connection]
rabajaj has joined #ruby
dionysus69 has joined #ruby
ecuanaso has joined #ruby
dennisvennink has joined #ruby
yokel has joined #ruby
zacts has quit [Ping timeout: 246 seconds]
zacts has joined #ruby
ryandv has quit [Ping timeout: 246 seconds]
cam27 has left #ruby [#ruby]
cdg has joined #ruby
cdg_ has joined #ruby
preyalone has joined #ruby
cdg has quit [Ping timeout: 248 seconds]
cdg_ has quit [Remote host closed the connection]
cdg has joined #ruby
cdg_ has joined #ruby
rikkipitt has joined #ruby
dviola has quit [Ping timeout: 260 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
WeiJunLi has joined #ruby
bruno- has quit [Quit: Lost terminal]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has quit [Ping timeout: 255 seconds]
ephemera_ has quit [Quit: No Ping reply in 180 seconds.]
tomphp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ephemera_ has joined #ruby
Murda has joined #ruby
cagomez has joined #ruby
yeticry_ has joined #ruby
mahlon has joined #ruby
bruno- has joined #ruby
yeticry has quit [Read error: Connection reset by peer]
troulouliou_div2 has joined #ruby
username_ has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
username1 has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rikkipitt has quit [Quit: Leaving...]
xall has quit [Ping timeout: 255 seconds]
FernandoBasso has quit [Ping timeout: 255 seconds]
oleo has quit [Read error: Connection reset by peer]
ozcanesen has quit [Quit: Textual IRC Client: www.textualapp.com]
s3nd1v0g1us has quit [Quit: tempusfugit]
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
Mon_Ouie has quit [Quit: WeeChat 1.9]
brent__ has quit [Remote host closed the connection]
jottr has joined #ruby
eckhardt has joined #ruby
brent__ has joined #ruby
crankharder has quit [Ping timeout: 276 seconds]
cam27 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
theta8 has joined #ruby
ryandv has joined #ruby
mim1k has joined #ruby
mim1k has quit [Disconnected by services]
FernandoBasso has joined #ruby
ryandv has quit [Ping timeout: 240 seconds]
xcesariox has quit [Quit: Textual IRC Client: www.textualapp.com]
troys is now known as troys_
crankharder has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
twe4ked has quit [Read error: Connection reset by peer]
troys_ is now known as troys
twe4ked has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
ur5us has joined #ruby
ta_ has joined #ruby
ryandv has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
tw1sted has quit [Remote host closed the connection]
ta_ has joined #ruby
tw1sted has joined #ruby
ecuanaso has joined #ruby
synthroid has quit []
ryandv has quit [Ping timeout: 246 seconds]
ryandv has joined #ruby
t-recx has quit [Quit: t-recx]
jenrzzz has quit [Ping timeout: 248 seconds]
nacsurte_ has joined #ruby
bambanx has joined #ruby
rabajaj has quit [Quit: Leaving]
jamesaxl has quit [Quit: WeeChat 1.8]
nacsurte has quit [Ping timeout: 240 seconds]
bambanx has quit [Read error: Connection reset by peer]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Emmanuel_Chanel has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
nacsurte_ has quit [Ping timeout: 248 seconds]
naprimer has joined #ruby
sepp2k has quit [Quit: Leaving.]
ldnunes has quit [Quit: Leaving]
nadir has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
nacsurte has joined #ruby
bronson has joined #ruby
enterprisey has joined #ruby
dionysus69 has quit [Ping timeout: 255 seconds]
bronson has quit [Ping timeout: 240 seconds]
FernandoBasso has quit [Ping timeout: 255 seconds]
cagomez has quit [Remote host closed the connection]
username1 has quit [Quit: Lost terminal]
username_ has quit [Quit: Lost terminal]
Joufflu has quit [Ping timeout: 255 seconds]
cdg has joined #ruby
GodFather has quit [Ping timeout: 248 seconds]
goyox86_ has joined #ruby
cdg_ has quit [Ping timeout: 248 seconds]
uZiel has quit [Ping timeout: 268 seconds]
GodFather has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
cdg has quit [Ping timeout: 264 seconds]
cdg has joined #ruby
belmoussaoui_ has joined #ruby
cdg has quit [Read error: Connection reset by peer]
alfiemax has quit [Remote host closed the connection]
WeiJunLi has quit [Remote host closed the connection]
ecuanaso has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
ShekharReddy has quit [Quit: Connection closed for inactivity]
danieli has joined #ruby
xuanrui has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
cagomez has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
belmoussaoui_ has quit [Quit: belmoussaoui_]
belmoussaoui has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
belmoussaoui has quit [Ping timeout: 264 seconds]
jnollette has quit [Ping timeout: 276 seconds]
guacamole has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cwailes has left #ruby [#ruby]
jenrzzz has joined #ruby
s3nd1v0g1us has joined #ruby
ryandv has quit [Ping timeout: 246 seconds]
preyalone has quit [Quit: Connection closed for inactivity]
ignarps has joined #ruby
troys is now known as troys_
arvindsaik has quit [Ping timeout: 240 seconds]
jnollette has joined #ruby
ResidentBiscuit has quit [Ping timeout: 260 seconds]
arvindsaik has joined #ruby
FastJack has quit [Read error: Connection reset by peer]
xuanrui has joined #ruby
kn-928 has quit [Ping timeout: 240 seconds]
kalimirch has quit [Quit: Leaving]
FastJack has joined #ruby
Mia has quit [Read error: Connection reset by peer]
Mia has joined #ruby
ryandv has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
Mia has quit [Excess Flood]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
brendan- has quit [Read error: Connection reset by peer]
kalimirch has joined #ruby
rubylegend2092 has quit [Read error: Connection reset by peer]
rubylegend2092 has joined #ruby
brendan- has joined #ruby
jtd has quit [Remote host closed the connection]
jtd has joined #ruby
kalimirch has quit [Client Quit]
ryandv has quit [Ping timeout: 248 seconds]
jaequery has joined #ruby
bronson has joined #ruby
Murda has quit [Quit: Murda]
jaequery has quit [Ping timeout: 246 seconds]
enterprisey has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 260 seconds]
aclark has quit [Remote host closed the connection]
aclark has joined #ruby
gusrub has quit [Remote host closed the connection]
cschneid_ has quit [Remote host closed the connection]
s3nd1v0g1us has quit [Quit: tempusfugit]
dstrunk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has joined #ruby
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
dennisvennink has quit [Excess Flood]
dennisvennink has joined #ruby
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
cschneid_ has quit [Ping timeout: 264 seconds]
Moosashi has joined #ruby
tvw has quit []
elnner has quit [Read error: Connection reset by peer]
Joufflu has joined #ruby
cam27 has quit [Quit: cam27]
Moosashi has quit [Quit: Moosashi]
biberu has quit []
phinxy has joined #ruby
frozengeek has quit [Quit: frozengeek]
bruno- has quit [Ping timeout: 240 seconds]
beilabs has joined #ruby
phinxy has quit [Quit: Leaving]
beilabs has quit [Remote host closed the connection]
alfiemax has joined #ruby
phinxy has joined #ruby
ecuanaso has joined #ruby
dviola has joined #ruby
raynold has joined #ruby
alfiemax has quit [Ping timeout: 246 seconds]
cdg has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
t-recx has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
runescape07rsps has joined #ruby
guacamole has quit [Ping timeout: 264 seconds]
goyox86_ has quit [Quit: goyox86_]