« Back to channel list

#ruby - 16 August 2017

« Back 1 day Forward 1 day »
[00:05:35] runescape07rsps: has joined #ruby
[00:07:42] __Yiota: has joined #ruby
[00:11:50] roboncloud: i don't see any issues with rspec... works well
[00:13:46] brent__: has joined #ruby
[00:17:09] chouhoul_: has joined #ruby
[00:17:59] zenspider: if you like an slow overly complicated test framework... sure
[00:21:41] nostalgiccloud: has joined #ruby
[00:24:09] nobitanobi: has joined #ruby
[00:24:28] cagomez: has joined #ruby
[00:31:54] 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.
[00:32:44] nobitanobi: has joined #ruby
[00:35:08] 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.
[00:35:48] hutch34: has joined #ruby
[00:36:19] spheric: has joined #ruby
[00:37:04] 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).
[00:37:46] roboncloud: i'm doubtful that rspec is the bottleneck
[00:37:52] elomatreb: But I got used to it years ago and it just feels more comfortable than test-unit-style frameworks
[00:37:53] catphish: has joined #ruby
[00:40:01] zenspider: roboncloud: then you're not measuring well enough.
[00:40:11] 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.
[00:40:14] zenspider: elomatreb: what level are those tests?
[00:40:32] zenspider: roboncloud: see above about measuring
[00:40:47] zenspider: (ie, you're objectively wrong)
[00:40:51] roboncloud: it sounds like you should have measurements already, given your level of confidence about it
[00:40:56] roboncloud: want to share?
[00:41:09] nostalgiccloud: has joined #ruby
[00:41:16] elomatreb: zenspider: No heavy integration stuff (no capybara or something like that), mostly just the components indepdently (if that's what you mean)
[00:41:44] 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
[00:42:00] 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.
[00:42:03] zenspider: I've shared plenty. go see my talks. my blog. etc.
[00:44:01] roboncloud: i found: http://www.zenspider.com/ruby/2012/06/loltests-show-rspec-2x-slower-than-minitest.html
[00:44:11] roboncloud: 2012 is pretty old tho.
[00:44:15] zenspider: just ran some of those benchmarks... .3 vs .9... so it is now 3x slower
[00:44:18] roboncloud: i'll try the same here.
[00:45:07] elomatreb: Oo, Rails is heavy
[00:45:26] zenspider: and 4x heavier on memory
[00:46:03] zenspider: elomatreb: that is what I mean... models only or also controllers?
[00:46:29] elomatreb: Yes, and a few very basic view tests with nokogiri
[00:50:20] nacsurte: has joined #ruby
[00:50:43] nadir: has joined #ruby
[00:52:33] beilabs: has joined #ruby
[00:54:52] zenspider: elomatreb: any access to these tests? (I don't care about the impl at all... just need to gather some rspec corpus)
[00:55:18] elomatreb: Sorry, it's a private app
[00:55:20] roboncloud: minitest is slower for me
[00:55:24] roboncloud: maybe my test case is wrong
[00:55:44] zenspider: probably... but I'd love to see it
[00:56:01] zenspider: there shouldn't be a single path through rspec that isn't massively longer than minitest
[00:56:11] roboncloud: https://gist.github.com/anonymous/992cc2d0a67755134590264105cacda0
[00:56:22] zenspider: hell...I imagine running *nothing* is still slower
[00:56:42] jenrzzz_: has joined #ruby
[00:57:10] roboncloud: okay, can imagine, but the results rspec is faster, and the difference between the two is definitely negligible in any case.
[00:57:11] __Yiota: has joined #ruby
[00:57:50] zenspider: it's either faster or negligible ... again with the measuring
[00:58:05] bmurt: has joined #ruby
[00:58:12] beilabs: has joined #ruby
[00:58:15] roboncloud: yes, it can be faster, but the difference can be meaningless, aka negligible.
[00:59:24] zenspider: hrm... your fork thing is doing *something* odd... not sure what yet
[00:59:30] roboncloud: okay, then rspec is simply faster. using the same benchmark from 2012.
[00:59:54] zenspider: I *highly* doubt that...
[01:00:11] roboncloud: ugh? i'm not making it up.
[01:00:13] jenrzzz: has joined #ruby
[01:00:13] jenrzzz: has joined #ruby
[01:00:25] roboncloud: https://www.irccloud.com/pastebin/mqtn1LjO/
[01:00:25] ruby[bot]: roboncloud: as I told you already, please use https://gist.github.com
[01:01:15] 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
[01:01:27] brent__: has joined #ruby
[01:02:14] 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.
[01:02:19] roboncloud: so really, what are you talking about?
[01:02:21] 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
[01:02:50] roboncloud: that's posible
[01:02:54] roboncloud: let me check
[01:02:55] zenspider: you JUST posted the results.. so don't pretend you were forthright
[01:03:07] zenspider: and a single run is meaningless
[01:03:34] zenspider: I think this is probably the cost of fork, loading code, and that's about it? I can't tell
[01:03:37] roboncloud: i posted the benchmark, as a standalone executable script you could run on your computer (if you can bring yourself to install bundler)
[01:04:36] roboncloud: the tests aren't running....
[01:04:41] zenspider: I'm getting roughly .267 and .265... against my .3 and .9... so they're not running for some reason
[01:05:06] zenspider: in the case of fork... it might not run the at_exit handler the same way...
[01:05:53] roboncloud: https://gist.github.com/anonymous/0cf6212316931e2c0676e91d31baca5b
[01:05:58] roboncloud: this seems to work better
[01:06:44] roboncloud: but i think only rspec is running the tests
[01:06:49] roboncloud: not minitest
[01:07:04] zenspider: other way around for me
[01:07:16] zenspider: look at the footer... if it has 10000 runs, 10000 assertions, 0 failures, 0 errors, 0 skips then it is minitest
[01:07:23] zenspider: if it is only 2 numbers, it is rspec
[01:08:38] roboncloud: Finished in 0.203112s, 49234.0048 runs/s, 49234.0048 assertions/s.
[01:08:38] roboncloud: 10000 runs, 10000 assertions, 0 failures, 0 errors, 0 skips
[01:09:10] roboncloud: https://www.irccloud.com/pastebin/ZI6cAitp/
[01:09:10] ruby[bot]: roboncloud: as I told you already, please use https://gist.github.com
[01:09:56] roboncloud: so yeah, minitest is considerably faster
[01:11:22] __Yiota: has joined #ruby
[01:11:26] roboncloud: obviously very contrived examples tho
[01:12:07] milardovich: has joined #ruby
[01:12:13] jaequery: has joined #ruby
[01:17:38] roboncloud: https://gist.github.com/anonymous/de4be6bbd9140fc0b5cd2aa840339d1a
[01:17:59] roboncloud: https://www.irccloud.com/pastebin/SXBN0s3u/
[01:17:59] ruby[bot]: roboncloud: as I told you already, please use https://gist.github.com
[01:18:18] roboncloud: congrats zenspider, looks like minitest has webscale
[01:18:31] gizmore|2: has joined #ruby
[01:20:49] GodFather: has joined #ruby
[01:25:02] Tohuw_: has joined #ruby
[01:29:09] ujjain: has joined #ruby
[01:29:09] ujjain: has joined #ruby
[01:30:37] gusrub: has joined #ruby
[01:31:42] Synthead: has joined #ruby
[01:32:09] Synthead: is there a good way I can break up #( ... ) literals into multiple lines without including the newlines?
[01:32:43] zenspider: Synthead: ... are you sure you're talking ruby?
[01:32:49] 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
[01:32:54] Synthead: zenspider, yeah
[01:33:02] Synthead: or sorry, %( ) literals
[01:33:35] zenspider: not that I know of... pop a .gsub on the end
[01:33:51] Synthead: ehh, I'd rather not tbh, that's kinda gross
[01:34:04] roboncloud: x = 'foo bar baz' \
[01:34:04] roboncloud: 'doo boo bar' \
[01:34:04] roboncloud: 'choo choo so long foo'
[01:34:15] roboncloud: is probably the fastest way.
[01:34:21] Synthead: I'd prefer to use string literals because I'm using a lot of "s with interpolated strings
[01:34:47] roboncloud: %() \ may work too, tbh never tried.
[01:34:54] bougyman: has joined #ruby
[01:35:02] Synthead: this is what I'm after, basically https://gist.github.com/anonymous/205bc5d76bc9ec7b72b6519dcf292d2b
[01:35:06] Synthead: this will test false
[01:35:11] zenspider: it should work... just another syntax for the same thing
[01:35:18] Synthead: but I'm looking for the string literal magic to make it true ;)
[01:35:44] zenspider: a = %( ... ).strip.gsub("\n", " ")
[01:35:54] Synthead: that's just so gross :p
[01:36:16] zenspider: what's so gross is wanting yet more syntax for an edge case that 30 people in the world have
[01:36:40] Synthead: what if it existed already and there was an easy answer?
[01:36:57] Synthead: suppose I'm getting a "no" here
[01:36:58] zenspider: it doesn't. we said so. and now you're kvetching at the solutions we're providing you.
[01:37:02] zenspider: you're welcome
[01:37:11] Synthead: ok thanks for the help
[01:37:13] zenspider: you can get rid of some of it w/ the <<~HEREDOC form... but you'll still need to gsub the newlines
[01:37:13] roboncloud: doesn't tho, not with that literal, with " and ' you can use \, which creates one string and avoids post-processing on the string.
[01:37:25] zenspider: it basically only does the strip (and only on the LHS)
[01:37:58] zenspider: yeah. you need to have the trailing space to make it work right
[01:38:18] zenspider: a = "... " \(newline)"... " \(newline) etc
[01:38:44] zenspider: at that point, I usually use [strings...].join " "
[01:39:31] zenspider: roboncloud: did I miss something for your rspec code? it is "running" w/o printing and taking a HUGE amount of time
[01:39:40] zenspider: and I've stripped the fork/benchmark out
[01:39:59] zenspider: oh shit. it's 500k vs 10k :P
[01:40:12] roboncloud: should complete though
[01:40:16] zenspider: doesn't print?
[01:40:17] roboncloud: it takes around 29s for me
[01:40:26] roboncloud: it does, at the very end, in one huge swoop
[01:40:31] kn-928: has joined #ruby
[01:40:32] roboncloud: then you have to scroll up to see the results
[01:40:36] zenspider: huh. not for me
[01:40:51] zenspider: lemme start pulling back the architecture
[01:41:29] SeepingN: has joined #ruby
[01:41:45] roboncloud: oh youre right
[01:41:47] roboncloud: it prints nothing
[01:41:56] roboncloud: ruby bench.rb
[01:41:56] roboncloud: user system total real
[01:41:56] roboncloud: rspec 23.280000 3.440000 26.720000 ( 26.727717)
[01:43:27] zenspider: then the comparison isn't fair. I think the way we did it, by testing against $0 is an apples to apples comparison
[01:45:52] roboncloud: https://gist.github.com/anonymous/e6e404ed191c70c2abcf70c2dd021525
[01:46:05] roboncloud: + require 'rspec/autorun'
[01:46:35] zenspider: switching it back to that... minitest: 10.47s & 434mb RSS vs rspec: 60.07s & 3526mb RSS
[01:47:08] roboncloud: yea. pretty bad. 500k tests is extreme tho.
[01:47:48] zenspider: ok. 50k tests... 1.15s & 54mb vs 4.5s & 350mb
[01:48:04] zenspider: go through progressions and plot the curve... it's really nasty
[01:48:11] zenspider: and these are PASSING tests...
[01:48:53] zenspider: 100% failures... 50k tests: 4.32s & 378mb vs 18.53s & 811mb
[01:49:05] roboncloud: right, yeah, quite a lot of overheard but i imagine 2k~ ish would be the max size of a any rails suite.
[01:49:13] zenspider: so when you're refactoring... your test suite starts to work against you
[01:50:00] zenspider: you'd be wrong... but let's see: .26s & 25mb vs .87s & 43mb (for 100% failures)
[01:50:06] 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.
[01:50:38] zenspider: good to know: almost no difference if 100% raises
[01:52:11] reaVer: has joined #ruby
[01:52:37] tlaxkit: has joined #ruby
[01:53:47] alfiemax: has joined #ruby
[01:56:15] gr33n7007h: thank fuck for that, i thought a shit storm were about to brew
[01:57:05] gr33n7007h: ACTION gets the micrometers out lol
[01:58:23] zenspider: gr33n7007h: what are you on about?
[01:58:36] cahoots: has joined #ruby
[01:59:47] zenspider: I asked a simple question
[02:05:16] Radar: gr33n7007h: yeah, it comes after strike 1 but right before strike 3.
[02:06:42] zenspider: not sure what part you're misunderstanding... strike 2... in response to your BS above.
[02:06:53] gr33n7007h: and i want to know what strike 1 is?
[02:07:14] zenspider: could be language/culture barrier maybe? it is baseball and not everyone knows that (not that *I* know baseball)
[02:08:41] milardovich: has joined #ruby
[02:09:20] zenspider: you should verb sometime
[02:09:28] Radar: gr33n7007h: This was strike #1: gr33n7007h>
[02:09:35] Radar: http://logs.ryanbigg.com/ruby-offtopic?date=2017-08-09#6456809
[02:10:20] gr33n7007h: Radar: that was in #offtopic
[02:10:26] Radar: don't care.
[02:10:53] zenspider: "fuck the martyrs, hang the cunts HIGH" ??? that's a big nope for me
[02:10:56] zenspider: !troll gr33n7007h
[02:10:56] ruby[bot]: +bbb $a:gr33n7007h$#ruby-banned gr33n7007h!*@*$#ruby-banned *!*@unaffiliated/gr33n7007h$#ruby-banned
[02:10:57] ruby[bot]: ruby[bot] kicked gr33n7007h: is a bannable offense, see http://ruby-community.com/pages/user_rules
[02:11:00] zenspider: I don't give a fuck. fuck you
[02:12:29] zenspider: maybe he'll be less offensive when he's 15
[02:14:36] milardovich: has joined #ruby
[02:17:32] roboncloud: opening that link was worth it just for: https://www.youtube.com/watch?v=pVQB42EjgD8
[02:19:47] PresidentBiscuit: has joined #ruby
[02:22:58] askjdnakjdn: has joined #ruby
[02:25:40] sarbs: has joined #ruby
[02:27:12] DrCode: has joined #ruby
[02:27:19] astrobunny: has joined #ruby
[02:29:32] AndBobsYourUncle: has joined #ruby
[02:31:05] jenrzzz: has joined #ruby
[02:31:05] jenrzzz: has joined #ruby
[02:31:26] jaequery: has joined #ruby
[02:35:14] roboncloud: https://bugs.ruby-lang.org/issues/5481
[02:36:11] 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.
[02:38:47] zenspider: thanks for reminding me. I need to transfer the ruby gem over to them
[02:39:25] jaequery: has joined #ruby
[02:39:42] roboncloud: no rush: Due in over 18 years (12/25/2035)
[02:39:48] roboncloud: https://bugs.ruby-lang.org/projects/ruby-trunk/roadmap
[02:44:13] SteenJobs_: has joined #ruby
[02:48:04] roboncloud: wow: https://bugs.ruby-lang.org/issues/12733
[02:49:02] mattp_: has left #ruby: ("WeeChat 1.7")
[02:55:18] brent__: has joined #ruby
[02:57:44] uZiel: has joined #ruby
[02:57:49] roboncloud: nice too: https://bugs.ruby-lang.org/issues/12973
[02:58:11] roboncloud: maybe nicest of them all
[02:58:15] nacsurte: has joined #ruby
[03:00:08] cadillac_: has joined #ruby
[03:00:36] carnegie: has joined #ruby
[03:00:59] elsevero: has joined #ruby
[03:01:06] 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
[03:03:24] __Yiota: has joined #ruby
[03:04:06] beilabs: has joined #ruby
[03:07:04] carnegie: has joined #ruby
[03:07:59] brent__: has joined #ruby
[03:09:52] gusrub: has joined #ruby
[03:11:53] alfiemax: has joined #ruby
[03:17:27] xuanrui: has joined #ruby
[03:17:34] govg: has joined #ruby
[03:17:50] alfiemax: has joined #ruby
[03:22:09] jenrzzz: has joined #ruby
[03:22:09] jenrzzz: has joined #ruby
[03:31:24] dymaxion_: has joined #ruby
[03:32:45] hahuang65: has joined #ruby
[03:34:12] twe4ked: has joined #ruby
[03:36:31] kn-928: has joined #ruby
[03:42:00] alfiemax: has joined #ruby
[03:42:06] aupadhye: has joined #ruby
[03:47:40] emilford: has joined #ruby
[03:51:42] hutch34: has joined #ruby
[03:52:20] nacsurte: has joined #ruby
[03:52:42] cadillac_: has joined #ruby
[03:54:14] gix: has joined #ruby
[03:56:27] enterprisey: has joined #ruby
[03:58:02] kies: has joined #ruby
[04:01:06] milardovich: has joined #ruby
[04:05:44] goyox86_: has joined #ruby
[04:09:39] brent__: has joined #ruby
[04:13:19] grvgr_: has joined #ruby
[04:19:10] brent__: has joined #ruby
[04:19:22] jaequery: has joined #ruby
[04:22:14] SteenJobs_: has joined #ruby
[04:24:33] dionysus69: has joined #ruby
[04:28:11] jaequery: has joined #ruby
[04:31:20] conta: has joined #ruby
[04:34:38] howdoi: has joined #ruby
[04:35:09] milardovich: has joined #ruby
[04:35:54] brent__: has joined #ruby
[04:38:39] brent__: has joined #ruby
[04:47:49] bhrgunatha: has joined #ruby
[04:52:37] dionysus69: has joined #ruby
[04:53:31] warrsrike: has joined #ruby
[04:53:50] warrsrike: people I could really use your ass
[04:53:52] warrsrike: assistance*
[04:54:07] warrsrike: so I need help with this regex. description inside https://gist.github.com/anonymous/429f868bbbac1f7b7e9849a6b7cc355b
[04:55:28] bzb: has joined #ruby
[04:59:17] ltem: has joined #ruby
[05:03:25] elomatreb: warrsrike: Can commas appear in the brackets/fields?
[05:08:54] jaequery: has joined #ruby
[05:09:09] warrsrike: elomatreb: yeah. because java methods have commas between args
[05:13:01] warrshrike: has joined #ruby
[05:13:09] warrshrike: sorry guys got dc'd
[05:13:12] warrshrike: did anyone reply?
[05:13:37] warrshrike: so the issue is an argument appearing in EnclMethod which has square brackets
[05:13:54] bougyman: this is really not a job for regex.
[05:13:55] warrshrike: so basically need to adapt so that if another square bracket comes before the previous one has closed allow it
[05:14:06] warrshrike: bougyman: what do you suggest?
[05:14:07] bougyman: you can do some crazy backtracking.
[05:14:11] bougyman: warrshrike: a parser.
[05:14:33] warrshrike: bougyman: but it works perfect other than the small issue of square brackets :/
[05:14:37] ur5us: has joined #ruby
[05:14:39] Bock: has joined #ruby
[05:14:44] warrshrike: bougyman: okay how do I do it with a parser
[05:14:55] bougyman: warrshrike: you can just hack around that.
[05:15:04] bougyman: count the brackets in the string before you do your thing.
[05:15:18] bougyman: use the regex if the thing doesn't hit your edge cases.
[05:15:22] bougyman: if it does, do something else.
[05:17:16] warrshrike: bougyman: string splits galore?
[05:17:30] nacsurte: has joined #ruby
[05:17:32] bougyman: whatever it takes.
[05:17:37] bougyman: some recursion could pull it off.
[05:18:52] warrshrike_: has joined #ruby
[05:18:57] warrshrike_: bougyman: how would recursion do it? some bfs voodoo?
[05:19:32] bougyman: I meant a recursive method, not regex recursion.
[05:19:47] bougyman: I mean, that method would likely use some regex or other string matching shit.
[05:20:06] bougyman: I'm trying not to program this for you and just get you thinking.
[05:20:08] warrshrike_: the only way I know other than regex is string.split chaining
[05:20:28] warrshrike_: bougyman: it would be very helpful if you programmed it tho ^_^
[05:20:39] warrshrike_: learning from a gurus work
[05:20:42] nicolai86: has joined #ruby
[05:20:46] bougyman: not as helpful as you figuring it out yourself.
[05:20:51] bougyman: that's how you become guru.
[05:21:01] warrshrike_: bougyman: fair enough ~_~
[05:21:32] bougyman: there's no anchor you could use?
[05:21:41] bougyman: That's kinda the rule with when you use regex or not.
[05:21:42] warrshrike_: bougyman: whats an anchor
[05:21:52] bougyman: If you can't anchor it, probably not the right tool.
[05:22:01] bougyman: ^ and $ are anchors, but there are many others.
[05:22:09] bougyman: \b, for instance
[05:22:14] bougyman: but that's not applicable here.
[05:22:19] milardovich: has joined #ruby
[05:22:26] bougyman: if the last ] were always followed by a \n, you could use $
[05:23:23] 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
[05:23:27] bougyman: don't [ inside the ^[ ]$ fuck you up just as much?
[05:24:03] bougyman: I guess only if they come after a ] in it.
[05:24:08] bougyman: still, it's a mess.
[05:24:21] bougyman: you can't contain on [ and ] if [ stuff ] stuff can contain [ and ]
[05:24:37] warrshrike_: bougyman: exactly, thats the issue
[05:24:58] warrshrike_: "], [" maybe this can be the inter thingy boundary?
[05:25:19] bougyman: wait, there's always quotes in the thing?
[05:25:22] bougyman: If so, that's your anchor.
[05:25:44] warrshrike_: what do you mean quotes? no theres no ""
[05:25:48] warrshrike_: its just ], [
[05:25:48] bougyman: [" starts it, and "] ends it.
[05:25:55] bougyman: well you put quotes there :)
[05:26:35] warrshrike_: bougyman: hahah yeah I was quoting
[05:27:01] warrshrike_: so it has this pattern []. [], []
[05:27:10] warrshrike_: and each [] can have some [] too
[05:27:18] bougyman: the comma could be used, I think that's why 08/15-22:03 <....... elomatreb> warrsrike: Can commas appear in the brackets/fields?
[05:27:21] bougyman: he asked that.
[05:27:31] bougyman: if there can be commas in there, too, that fucks you up, a bit
[05:27:39] bougyman: cause you can't guarantee ], won't be in the input
[05:27:51] bougyman: 1st rule of regex: Know your data.
[05:27:57] elomatreb: My initial thought was to split on ,\s*, to allow greedy matching on []
[05:27:58] warrshrike_: yes it can have commas
[05:28:14] warrshrike_: as java methods arguments are comma seperated
[05:28:22] warrshrike_: and enclMEthods are just java methods
[05:28:43] warrshrike_: what about ], [ tho?
[05:29:09] warrshrike_: java method args can't begin with [ right?
[05:29:19] elomatreb: If the format (i.e. the order of stuff) is fixed you could use that to your advantage
[05:29:41] warrshrike_: so that means there can't be a ] followed by , followed but [ INSIDE the outer []
[05:29:45] warrshrike_: elomatreb: yes its fixed
[05:29:50] warrshrike_: id always comes first etc
[05:30:40] jackjackdripper: has joined #ruby
[05:30:52] elsevero: has joined #ruby
[05:31:08] elomatreb: Then anchor the regex with the key names, that should allow you to use brackets and greedy matching
[05:32:04] warrshrike_: elomatreb: how can I do that?
[05:32:23] jamal7: has joined #ruby
[05:33:29] elomatreb: E.g. /\[Node Id: (\d+)], \[Java Type & Name: (.+)], \[EncClass: ....
[05:33:35] hahuang65: has joined #ruby
[05:33:42] elomatreb: It won't be fast but I think it should work
[05:34:51] elomatreb: Additional tip: Name your matching groups, like (?<node_id>\d+)
[05:36:28] AndBobsYourUncle: has joined #ruby
[05:36:58] wilbert_: has joined #ruby
[05:37:54] warrshrike_: elomatreb: this? res = str.scan(/\[Node Id: (\d+)], \[Java Type & Name: (.+)], \[EnclClass: (.+)], \[EnclMethod: (.+)\], /).to_h
[05:38:44] 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
[05:39:37] warrshrike_: elomatreb: iike this? res = str.scan(/\[Node Id: (\d+)], \[Java Type & Name: (.+)], \[EnclClass: (.+)], \[EnclMethod: (.+)\], \[/).to_h
[05:39:44] MrBusiness: has joined #ruby
[05:40:28] elomatreb: Almost, it would capture SflowType as well
[05:40:35] frozengeek_: has joined #ruby
[05:40:56] elomatreb: End it with [SflowType, and it should work
[05:41:25] sleetdrop: has joined #ruby
[05:44:46] warrshrike_: elomatreb: so resa = str.scan(/\[Node Id: (\d+)\], \[Java Type & Name: (.+)\], \[EnclClass: (.+)\], \[EnclMethod: (.+)\], \[SflowType/).to_h
[05:44:59] tastygradient: has joined #ruby
[05:45:01] warrshrike_: I get this error: `to_h': wrong array length at 0 (expected 2, was 4) (ArgumentError)
[05:45:11] elomatreb: It seems to work for me (the regex)
[05:45:45] warrshrike_: elomatreb: are you doing .to_h at end?
[05:45:51] rabajaj: has joined #ruby
[05:46:30] kn-928: has joined #ruby
[05:47:01] elomatreb: .to_h on an array expects an array of the form [[key, value], [otherkey, othervalue]], which would result in {key: value, otherkey: othervalue}
[05:47:17] elomatreb: See above, you should start by naming your capture groups
[05:47:54] anas: has joined #ruby
[05:48:28] 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`)
[05:49:27] warrshrike_: elomatreb: I guess array is fine too since I'm just going to send the value to a function...
[05:49:45] warrshrike_: why does enclMethod have a preceding whitespace?
[05:50:11] 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
[05:52:10] warrshrike_: elomatreb: gotcha. will use str.strip on it
[05:52:50] elomatreb: Keep in mind though that this whole thing will break when the format of the data changes even slightly
[05:53:22] f48ds2: has joined #ruby
[05:54:05] frozengeek_: has joined #ruby
[05:56:37] alex``: has joined #ruby
[05:59:20] apparition: has joined #ruby
[06:00:38] warrshrike_: elomatreb: yeah format isn't expected to change. thanks a lot man
[06:02:09] Jameser: has joined #ruby
[06:11:17] uZiel: has joined #ruby
[06:11:37] nacsurte: has joined #ruby
[06:12:50] shiranuidong: has joined #ruby
[06:14:45] shiranuidong: has joined #ruby
[06:17:50] claw: has joined #ruby
[06:21:23] milardovich: has joined #ruby
[06:25:46] cahoots: has joined #ruby
[06:30:54] enterprisey: has joined #ruby
[06:40:08] conta: has joined #ruby
[06:40:19] aufi: has joined #ruby
[06:41:19] alfiemax: has joined #ruby
[06:42:16] Mia: has joined #ruby
[06:42:16] Mia: has joined #ruby
[06:57:02] username1: has joined #ruby
[06:57:13] anisha: has joined #ruby
[06:59:00] im0nde: has joined #ruby
[07:01:14] djbkd: has joined #ruby
[07:05:10] gix: has joined #ruby
[07:05:44] nacsurte: has joined #ruby
[07:06:06] ShekharReddy: has joined #ruby
[07:06:09] tAn: has joined #ruby
[07:07:24] jamesaxl: has joined #ruby
[07:08:20] shwouchk: has joined #ruby
[07:19:31] Doow: has joined #ruby
[07:19:40] jenrzzz: has joined #ruby
[07:19:40] jenrzzz: has joined #ruby
[07:21:30] TomyWork: has joined #ruby
[07:24:05] alfiemax: has joined #ruby
[07:26:21] Dimik: has joined #ruby
[07:29:28] mark_66: has joined #ruby
[07:34:52] hahuang65: has joined #ruby
[07:35:20] kbengala: has joined #ruby
[07:35:56] kbengala: has joined #ruby
[07:38:30] dionysus69: has joined #ruby
[07:38:31] kn-928: has joined #ruby
[07:40:02] crst: has joined #ruby
[07:41:00] lxnr: has joined #ruby
[07:41:58] burgestrand: has joined #ruby
[07:48:07] mtkd: has joined #ruby
[07:51:37] crst: Hi, how do I get the "/subfolder/" part from http://domain.com/subfolder/ ?
[07:52:13] crst: like current_page
[07:52:25] crst: which gives me only "index.html"
[07:54:59] crst: current_path gives me "subfolder/index.html"
[07:55:26] elomatreb: >> require "uri"; URI("http://domain.com/subfolder/").path
[07:55:27] ruby[bot]: elomatreb: # => "/subfolder/" (https://eval.in/845838)
[07:55:34] opekktar: has joined #ruby
[07:55:46] elomatreb: But it sounds like you're in Rails? There must be a helper for that
[07:56:46] crst: elomatreb: I'm in middleman
[07:59:47] nacsurte: has joined #ruby
[08:00:05] mikecmpbll: has joined #ruby
[08:01:51] Silthias: has joined #ruby
[08:08:52] Terens1: has joined #ruby
[08:09:11] Terens1: I spent 3 weeks and still cant find why ruby as a daemons
[08:09:17] Terens1: wasts so much memory
[08:09:27] nofxxxx: has joined #ruby
[08:12:01] ferr1: has joined #ruby
[08:12:03] dminuoso: Terens_: I'd make a "yo ruby" joke, but I've been told to stop being hateful.
[08:12:47] dminuoso: Terens_: Essentially Ruby has a really lazy GC, the VM is big and fat
[08:13:17] jamesaxl: has joined #ruby
[08:15:33] Terens1: 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.
[08:15:44] Terens1: after 10 days
[08:16:42] dminuoso: Terens_: Is it stable at 200mb memory?
[08:17:04] Antiarc: has joined #ruby
[08:17:08] dminuoso: Terens_: use memory_profiler ?
[08:24:15] hightower2: has joined #ruby
[08:24:50] vall: has joined #ruby
[08:24:55] MichaelBurge: has joined #ruby
[08:26:35] cahoots: has joined #ruby
[08:26:52] burgestrand: has joined #ruby
[08:27:13] quazimodo: has joined #ruby
[08:27:28] quazimodo: has joined #ruby
[08:27:28] quazimodo: hey what's the preferred internal documentation implementation?
[08:27:31] quazimodo: is it just rdoc?
[08:29:06] dminuoso: quazimodo: rdoc is by far the most popular one. Other options include sdoc or yard
[08:29:19] dminuoso: quazimodo: Don't use a preferred, try them out and judge for yourself.
[08:29:45] dminuoso: YARD has that advantage of being incredibly extendible
[08:30:26] jinie_: has joined #ruby
[08:31:52] kbengala: has left #ruby: ()
[08:31:59] NeverTired: has joined #ruby
[08:35:24] hahuang65: has joined #ruby
[08:36:04] jackjackdripper: has joined #ruby
[08:36:49] 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
[08:36:52] quazimodo: he did backend also
[08:37:05] quazimodo: and it was pretty lame
[08:39:32] arne: has joined #ruby
[08:41:23] Beams: has joined #ruby
[08:43:57] Mon_Ouie: has joined #ruby
[08:44:20] beilabs: has joined #ruby
[08:44:24] _main_: has joined #ruby
[08:44:47] quobo: has joined #ruby
[08:46:45] lxnr: has joined #ruby
[08:51:17] romain_t: has joined #ruby
[08:51:17] dminuoso: quazimodo: The term "scripting language" seems to be just name calling.
[08:51:39] dminuoso: For example: Can you define what a scripting language is exactly?
[08:53:57] nacsurte: has joined #ruby
[08:55:03] alfiemax: has joined #ruby
[08:57:39] biberu: has joined #ruby
[08:59:46] matthewd: dminuoso: One in which, in normal operation, the executed program is given to the runtime in source form
[09:00:12] hackeron: has joined #ruby
[09:00:12] matthewd: dminuoso: Doesn't seem like a particularly *useful* distinction, mind you :)
[09:00:25] hackeron: has joined #ruby
[09:01:09] 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"
[09:02:03] dymaxion_: has joined #ruby
[09:02:59] 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?
[09:03:00] Mon_Ouie: has joined #ruby
[09:03:31] matthewd: Hence my "in normal operation" hedge ;)
[09:04:31] matthewd: See also, JavaScript seemingly headed towards a *need* for a compile step
[09:05:08] dminuoso: matthewd: Considering the projected speedups in Rails with Ruby 3x3 I dont find that surprising
[09:07:53] nofxxx: has joined #ruby
[09:08:36] catphish: has joined #ruby
[09:11:37] dminuoso: matthewd: Though why did you use "need" ?
[09:13:14] lxnr: has joined #ruby
[09:14:24] catphish: dminuoso: my bug got some love last week, but not sure about the proposed solution https://bugs.ruby-lang.org/issues/13794
[09:15:38] pandaant: has joined #ruby
[09:16:02] huddy: has joined #ruby
[09:16:28] dminuoso: catphish: That is not a fix.
[09:16:46] catphish: dminuoso: that was my opinion
[09:17:08] dminuoso: catphish: I've thought about this problem a real while, and I simply don't see a trivial way to address it.
[09:17:21] dminuoso: Other than what we talked about in the end
[09:17:44] catphish: i think my proposed solution is the simplest, it still feels lightly hacky
[09:17:54] catphish: but probably correct
[09:18:20] hackeron: has joined #ruby
[09:19:40] hackeron: has joined #ruby
[09:19:40] hackeron: has joined #ruby
[09:20:14] dminuoso: catphish: I think it might be best to write a simple native extension that can forcibly create that situation.
[09:20:52] bweston92: has joined #ruby
[09:20:54] hackeron: has joined #ruby
[09:21:41] tomphp: has joined #ruby
[09:21:43] catphish: that would be cool, i'll see if i can
[09:22:05] dminuoso: catphish: btw Ive also realized why you are getting this situatoin so frequently in the first place.
[09:22:11] dminuoso: It's most likely a native extension.
[09:22:31] catphish: that's entirely plausible, i have a lot of gems in this app
[09:22:40] hackeron: has joined #ruby
[09:22:55] dminuoso: catphish: or rather any thread.
[09:23:16] dminuoso: catphish: fork releases the gvl, so another thread can instantly consume it and then starts that atomic_inc/stuff/atomic_dec thing.
[09:23:37] dminuoso: catphish: So fork is always closely aligned with that racey code.
[09:23:56] catphish: oh, so immediately after calling fork, but before forking, another thread grabs the lock?
[09:24:08] dminuoso: which in itself is fine
[09:25:32] matthewd: Does that imply having fork keep the GVL would fix it, though?
[09:25:42] dminuoso: matthewd: Yes, absolutely.
[09:26:37] dminuoso: Or let me rephrase: I think so. :)
[09:27:12] catphish: another odd fact is that i thought my code pre-fork only had the one main thread, but i haven't verified this
[09:27:36] dminuoso: catphish: Was there a pending signal?
[09:28:24] 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.
[09:29:55] 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
[09:31:32] catphish: i think the way forward is to try to force this to happen
[09:31:51] jamesaxl: has joined #ruby
[09:35:51] catphish: i'm still getting over my anger from last night at the maintainer of Bunny https://github.com/ruby-amqp/bunny/issues/515
[09:36:05] alfiemax: has joined #ruby
[09:36:29] catphish: fortunately that particular issue does seem to have been fixed
[09:36:56] matthewd: > Please post questions to the mailing list in the future.
[09:37:30] catphish: that much seemed like a reasonable request :)
[09:37:31] 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.
[09:38:55] catphish: i think my politeness in not calling it a bug from the outset was a mistake
[09:40:05] mim1k: has joined #ruby
[09:40:08] 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 :(
[09:43:28] catphish: but the issue is resolved, so i guess that's something
[09:44:38] charliesome: has joined #ruby
[09:45:56] matthewd: catphish: Yes, the issue is resolved. Move on.
[09:46:59] 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
[09:48:01] nacsurte: has joined #ruby
[09:48:47] ltem: has joined #ruby
[09:49:22] catphish: i am not looking for sympathy, but for condemnation of Michael
[09:50:43] astrobunny: has joined #ruby
[09:50:54] umaaji: has joined #ruby
[09:51:19] catphish: mostly for the childish act of locking a thread to assert that his version of facts is correct when it is not
[09:51:41] bronson: has joined #ruby
[09:51:51] DoubleMalt: has joined #ruby
[09:51:56] apeiros: catphish: Timeout::Error - are you using timeout? if so, that alone already creates a new thread.
[09:52:31] kn-928: has joined #ruby
[09:52:35] catphish: apeiros: i'm not, Bunny is, it uses several threads
[09:53:57] 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)
[10:00:23] Serpent7776: has joined #ruby
[10:01:40] Terens1: http://i.imgur.com/uwM0Gqq.png
[10:01:49] Terens1: this is how memory goes 40 mins
[10:03:50] gloscombe: has joined #ruby
[10:04:27] dminuoso: Terens_: that looks normal.
[10:05:14] 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
[10:06:45] 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
[10:07:35] vondruch: has joined #ruby
[10:08:06] Terens1: actually it seems that it grows slowly. http://i.imgur.com/gjM4NFP.png
[10:08:27] Terens1: although I am not storing anything
[10:09:42] 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
[10:10:58] juststrollingin: has joined #ruby
[10:12:32] elsevero_: has joined #ruby
[10:14:00] Terens1: I hope that it settles
[10:14:04] dminuoso: Terens_: Did you run a memory profiler?
[10:14:13] Terens1: Yes nothing strange found
[10:14:41] Terens1: I had the same behavior just running a loop with Open3.capture2('echo shit')
[10:15:13] Terens1: in a plain ruby file. Memory grew to 500mb in openbsd but in ubuntu stayed low 26mb
[10:15:43] Terens1: it seems that it haas different behavior under different o/s
[10:15:59] sagax: has joined #ruby
[10:18:24] dminuoso: Terens_: What does `pp GC.stat` give you?
[10:22:47] belmoussaoui_: has joined #ruby
[10:24:08] Terens1: it seems stable when I ran GC.stat nothing grew
[10:27:27] cahoots: has joined #ruby
[10:29:19] Terens1: http://i.imgur.com/srPyzd5.png now
[10:29:46] Terens1: does it look normal?
[10:29:58] stamina: has joined #ruby
[10:30:19] mim1k: has joined #ruby
[10:31:12] roboncloud: catphish: maintenance burden of open source is real.
[10:31:43] roboncloud: after answering same question for the 500th time, it's understandable if you might be a little tired of it
[10:36:09] hahuang65: has joined #ruby
[10:36:26] quazimodo: has joined #ruby
[10:41:57] belmoussaoui_: has joined #ruby
[10:42:08] nacsurte: has joined #ruby
[10:42:31] hfp_work: has joined #ruby
[10:45:08] opencw: has joined #ruby
[10:46:07] hahuang65: has joined #ruby
[10:47:17] belmoussaoui_: has joined #ruby
[10:52:14] adlerdias: has joined #ruby
[10:56:18] runescape07rsps: has joined #ruby
[10:57:57] apparition47: has joined #ruby
[10:58:37] gregf_: has joined #ruby
[10:59:28] catphish: roboncloud: indeed, i have open source software i can see how that could happen
[11:07:03] tirej: has joined #ruby
[11:08:23] 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.
[11:12:05] DTZUZO: has joined #ruby
[11:12:13] 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
[11:12:34] catphish: and the pleasant small number of tickets that are actually fixable bugs :)
[11:15:53] 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.
[11:17:19] tvw: has joined #ruby
[11:17:59] roboncloud: esp since it's my free time, which is limited
[11:24:20] hutch34: has joined #ruby
[11:35:06] uZiel: has joined #ruby
[11:35:17] ldnunes: has joined #ruby
[11:36:16] nacsurte: has joined #ruby
[11:36:54] Terens1: http://i.imgur.com/2kQaHFT.png
[11:37:16] Terens1: this is my memory is it ok?
[11:38:40] jottr: has joined #ruby
[11:38:51] kn-928: has joined #ruby
[11:39:54] 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
[11:40:15] catphish: but i would monitor it long term to make sure it doesn't increase indefinitely
[11:40:20] sepp2k: has joined #ruby
[11:44:07] Terens1: it shouldnt increase since It does the same thing at interval,
[11:44:19] Terens1: I will monitor it
[11:44:23] Terens1: for 3 days
[11:44:49] Terens1: With daemons gem it seemed that memory increase was x2
[11:53:48] DTZUZO: has joined #ruby
[11:56:51] username: has joined #ruby
[11:59:22] adlerdias_: has joined #ruby
[12:00:11] faces: has joined #ruby
[12:01:13] synthroid: has joined #ruby
[12:07:19] laphoraig92: has joined #ruby
[12:07:25] bruno-: has joined #ruby
[12:12:38] bmurt: has joined #ruby
[12:14:28] bronson: has joined #ruby
[12:17:00] xall: has joined #ruby
[12:20:03] tlaxkit: has joined #ruby
[12:22:13] gnufied: has joined #ruby
[12:22:20] nowhere_man: has joined #ruby
[12:27:51] __Yiota: has joined #ruby
[12:28:23] cahoots: has joined #ruby
[12:30:22] nacsurte: has joined #ruby
[12:31:13] kassav_: has joined #ruby
[12:36:54] hutch34: has joined #ruby
[12:46:55] hahuang65: has joined #ruby
[12:48:14] cabotto: has joined #ruby
[12:52:11] hogetaro: has joined #ruby
[12:54:55] gnufied: has joined #ruby
[12:57:11] belmoussaoui: has joined #ruby
[13:02:56] tomphp: has joined #ruby
[13:03:55] maryo: has joined #ruby
[13:04:50] cdg_: has joined #ruby
[13:10:09] tomphp_: has joined #ruby
[13:13:10] roboncloud: i wish `gem install https://github.com/someproj/foo.git` worked.
[13:13:56] alfiemax: has joined #ruby
[13:14:38] bronson: has joined #ruby
[13:14:54] ur5us: has joined #ruby
[13:16:35] 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.
[13:16:39] roboncloud: decentralised, and super convient.
[13:16:40] dminuoso: *Use a construct
[13:19:03] catphish: dminuoso: that sounds ideal, it will take me a while to pick through that sentence and turn it into code
[13:20:42] alfiemax_: has joined #ruby
[13:24:07] nacsurte: has joined #ruby
[13:25:45] adlerdias: has joined #ruby
[13:26:20] nadir: has joined #ruby
[13:26:39] DLSteve: has joined #ruby
[13:39:49] alfiemax: has joined #ruby
[13:41:01] ledestin: has joined #ruby
[13:41:52] gchristensen: has joined #ruby
[13:42:07] 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.
[13:43:32] Jameser: has joined #ruby
[13:47:33] dminuoso: gchristensen: Yes.
[13:47:38] dymaxion_: has joined #ruby
[13:48:03] dminuoso: gchristensen: Do you want the answer spoonfed, or just a slight tiny hint?
[13:48:30] gchristensen: how about a tiny hint to start? I'll probably learn it better that way.
[13:49:08] dminuoso: gchristensen: What is a netmask?
[13:49:35] dminuoso: And b) IPAddr#to_i
[13:50:17] chouhoulis: has joined #ruby
[13:50:45] herwin: IPAddr.new('255.255.255.192').to_i.to_s(2).count('1')
[13:50:47] herwin: ACTION feels dirty
[13:51:05] dminuoso: herwin: And here I was, trying to just give him a tiny hint. :(
[13:51:17] awoond10: has joined #ruby
[13:51:40] gchristensen: lol, thank you dminuoso and herwin :P I guess I was hoping for a less dirty solution >.>
[13:52:53] dminuoso: gchristensen: There's a few other variants that go down the same road, but ultimately its a mathematical question.
[13:53:40] gchristensen: I understand, I do know how, on paper, to get from a netmask to the prefix length :)
[13:53:41] herwin: I have a PR/feature request open to make the subnet a bit more accessible from within IPAddr
[13:54:12] dminuoso: herwin: Show me a link, and Ill [Like] it.
[13:54:27] dminuoso: That reminds me, why do we not use facebook for issue tracking?
[13:55:08] herwin: https://github.com/ruby/ruby/pull/1269
[13:55:11] aglorei1: has joined #ruby
[13:56:39] dminuoso: herwin: github is always ignored.
[13:56:43] dminuoso: herwin: make a feature request on the bug tracker
[13:57:10] dminuoso: (at least for non-trivial merge requests, other than documentation/typo fixes)
[13:57:12] herwin: dminuoso: you mean https://bugs.ruby-lang.org/issues/11210
[13:57:31] herwin: but you can't like it there
[13:57:41] dminuoso: I cant like it on github either.
[13:57:41] herwin: or I never found the button
[13:58:04] herwin: thumbs-up-emoji is pretty much the same
[13:58:47] dminuoso: herwin: Are you dutch?
[14:01:38] savoir-faire: has joined #ruby
[14:01:41] elsevero: has joined #ruby
[14:01:50] chouhoul_: has joined #ruby
[14:09:29] Fin1te: has joined #ruby
[14:11:25] Rapture: has joined #ruby
[14:11:27] nobitanobi: has joined #ruby
[14:13:26] __Yiota: has joined #ruby
[14:15:14] SpiffTR: has joined #ruby
[14:15:33] gloscombe: has joined #ruby
[14:25:28] xall: has joined #ruby
[14:27:45] conta: has joined #ruby
[14:29:12] cahoots: has joined #ruby
[14:35:11] Emmanuel_Chanel: has joined #ruby
[14:35:28] chouhoulis: has joined #ruby
[14:36:37] catphish: i can't actually think of an elegent solution to the netmask question
[14:37:00] bruno-: has joined #ruby
[14:37:38] chouhoulis: has joined #ruby
[14:39:05] SpiffTR: has joined #ruby
[14:43:20] Silthias: has joined #ruby
[14:44:26] Silthias1: has joined #ruby
[14:44:37] dminuoso: 32 - Math.log2((2**32 - 4294967233) + 1)
[14:44:41] dminuoso: catphish: ^-
[14:45:18] dminuoso: or generally: -> (mask) { 32 - Math.log2((2**32 - addr.to_i) + 1) }
[14:45:36] Silthias1: has joined #ruby
[14:45:49] dminuoso: >> getCidr = -> (mask) { 32 - Math.log2((2**32 - addr.to_i) + 1) }; puts getCidr.(IPAddr.new('255.255.255.192'))
[14:45:50] ruby[bot]: dminuoso: # => uninitialized constant IPAddr (NameError) ...check link for more (https://eval.in/846075)
[14:45:58] dminuoso: >> require 'ipaddr'; getCidr = -> (mask) { 32 - Math.log2((2**32 - addr.to_i) + 1) }; puts getCidr.(IPAddr.new('255.255.255.192'))
[14:46:03] ruby[bot]: dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[14:46:06] dminuoso: >> require 'ipaddr'; getCidr = -> (mask) { 32 - Math.log2((2**32 - addr.to_i) + 1) }; puts getCidr.(IPAddr.new('255.255.255.192'))
[14:46:11] ruby[bot]: dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[14:46:16] milardovich: has joined #ruby
[14:47:11] dminuoso: >> require 'ipaddr'; getCidr = -> (addr) { 32 - Math.log2(2**32 - addr.to_i) }; puts getCidr.(IPAddr.new('255.255.255.192'))
[14:47:17] ruby[bot]: dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[14:47:23] dminuoso: Thank you ruby[bot].
[14:47:45] hahuang65: has joined #ruby
[14:48:14] catphish: cool, i must learn more about log functions
[14:48:22] theunraveler: has joined #ruby
[14:51:15] AMHOL: has joined #ruby
[14:51:45] milardovich: has joined #ruby
[14:51:51] catphish: language sir
[14:54:00] vondruch: has joined #ruby
[14:56:29] goyox86_: has joined #ruby
[14:57:26] Terens1: http://imgur.com/9JmZRIU
[14:59:29] vondruch: has joined #ruby
[15:00:41] mustmodify: has joined #ruby
[15:01:12] rippa: has joined #ruby
[15:03:17] gusrub: has joined #ruby
[15:03:25] oleo: has joined #ruby
[15:05:25] tlaxkit: has joined #ruby
[15:07:11] elsevero: has joined #ruby
[15:08:24] xzhao: has joined #ruby
[15:09:18] SpiffTR: has joined #ruby
[15:09:53] _sfiguser: has joined #ruby
[15:10:26] cahoots: has joined #ruby
[15:11:24] mustmodify: Just had a revelation. I guess it was obvious just hadn't occurred to me.
[15:12:25] King_DuckZ: has joined #ruby
[15:12:30] mustmodify: Uh... actually, I'm confused. Can I define a method called ... say ... StateParser ?
[15:12:43] mustmodify: I know it's against the convention.
[15:12:52] matthewd: mustmodify: Yes
[15:13:04] King_DuckZ: hi, is there a simple way to read the selection clipboard from ruby?
[15:13:33] King_DuckZ: ruby 2.0.0p648, specifically
[15:14:40] 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)
[15:15:26] matthewd: mustmodify: class Location; def self.StateParser(input); ..; end; end
[15:15:29] matthewd: mustmodify: But still.. don't do that. :)
[15:15:48] bronson: has joined #ruby
[15:15:56] mustmodify: weird, I just tried that and it didn't work for me. I had to call it as Location.StateParser
[15:16:09] dminuoso: mustmodify: explicit parens
[15:16:13] mustmodify: matthewd: but you're right, it's so foreign. I was just trying it on for size.
[15:16:20] mustmodify: that's probably it.
[15:16:28] __Yiota: has joined #ruby
[15:16:29] mustmodify: dminuoso: good catch.
[15:16:42] mustmodify: dminuoso: yep.
[15:16:49] mustmodify: I've been learning React.
[15:17:03] mustmodify: ES6 is actually pretty good. I mean, you still can't create a "regular old class", but...
[15:17:05] dminuoso: Great! Now stop it and learn ELM instead.
[15:17:09] mustmodify: it's pretty good.
[15:17:37] dminuoso: mustmodify: well the word "class" is so overloaded.. no matter what language you look at, the meaning is totally different.
[15:18:12] 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.
[15:18:37] xzhao: has joined #ruby
[15:19:21] 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.
[15:19:47] mustmodify: Anyway, would it be technically correct to say that methods are not first-class objects in Ruby?
[15:20:12] dminuoso: mustmodify: Nope.
[15:20:27] dminuoso: >> method(:puts)
[15:20:28] ruby[bot]: dminuoso: # => #<Method: Object(Kernel)#puts> (https://eval.in/846127)
[15:20:50] dminuoso: mustmodify: They are just not as elegantly accessible as functions in JavaScript for example.
[15:21:09] dminuoso: mustmodify: Afaik the only things that are not first-class objects are procs and local variables.
[15:22:10] dminuoso: Strike that, blocks too.
[15:22:10] mustmodify: ok, well is there a technical word to say that? That functions aren't ... like ... conventionally aren't used alone?
[15:22:56] King_DuckZ: has left #ruby: ()
[15:22:57] 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.
[15:23:04] cagomez: has joined #ruby
[15:23:11] dminuoso: mustmodify: But then you have to realize that lambdas/procs come into place
[15:23:50] mustmodify: unergonomic... hunh.
[15:24:47] 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"
[15:24:52] goyox86_: has joined #ruby
[15:25:11] mustmodify: so I wrote a method that takes the common strings and fixes them.
[15:25:34] mustmodify: It doesn't belong in Location because it's not really modeling that... it's just cleaning up from the API.
[15:25:45] mustmodify: So I was going to call it Location::StateParser or something.
[15:25:54] mustmodify: but I guess Location.state_parser is just as good.
[15:26:04] mustmodify: It's the javascript taking hold of my brain.
[15:26:07] MyMind: has joined #ruby
[15:27:52] kn-928: has joined #ruby
[15:28:59] gloscombe: has joined #ruby
[15:29:33] mustmodify: has left #ruby: ()
[15:30:14] yourname: has joined #ruby
[15:30:26] goyox86_: has joined #ruby
[15:31:22] goyox86_: has joined #ruby
[15:32:07] yourname: trying to run this script: https://gitlab.com/6uellerBpanda/check_gitlab/blob/master/check_gitlab.rb and I get the following errors: https://gist.github.com/bline79/e52b549d3a781d2158d02f15229b090d
[15:34:01] matthewd: yourname: Your ruby version is too old
[15:34:11] yourname: that's what I figured. thanks :)
[15:36:37] [Butch]: has joined #ruby
[15:36:57] dionysus69: has joined #ruby
[15:37:08] havenwood: yourname: You might try changing that first line shebang to: #!/usr/bin/env ruby
[15:37:22] synthroid: has joined #ruby
[15:37:43] havenwood: yourname: (When you get a newer Ruby.)
[15:37:50] yourname: thank you guys :)
[15:38:52] havenwood: yourname: Ruby 2.0+
[15:39:05] havenwood: no prob, happy coding!
[15:40:05] havenwood: Preferably Ruby 2.3 or 2.4, but mandatory keyword arguments are available in 2.0 or higher.
[15:41:56] matthewd: I thought mandatory was 2.1
[15:42:37] havenwood: matthewd: I had to check but you're right!
[15:42:44] dminuoso: Here we shoot Ruby developers for not using 2.4
[15:42:47] dminuoso: But then again Im the only one.
[15:42:53] dminuoso: So it's easy to enforce.
[15:42:53] troys: has joined #ruby
[15:42:57] havenwood: yourname: Mandatory kwargs are actually Ruby 2.1, not 2.0. I was wrong. Sorry about the misinformation...
[15:43:02] brent__: has joined #ruby
[15:43:58] brent__: has joined #ruby
[15:44:07] havenwood: matthewd: Thanks for the correction! Took a few versions to iron out I guess. My memory is a bit murky on the kwargs.
[15:44:12] matthewd: havenwood: Probably better that we all just agree to ignore the distinction between 2.old and 2.old, anyway ;)
[15:44:20] havenwood: dminuoso: 2.5-dev is acceptable as well. ;-)
[15:44:32] havenwood: 2.old is old!
[15:44:36] matthewd: Yeah, I think 2.0 was kwargs, then 2.1 for mandatory
[15:44:50] dminuoso: havenwood: Remind me to change the rule before I try it out. The gun is ready on my desk.
[15:45:33] dminuoso: 20>> def f(f:) end
[15:45:34] ruby[bot]: dminuoso: # => /tmp/execpad-d461407f62a4/source-d461407f62a4:2: syntax error, unexpected ')' ...check link for more (https://eval.in/846200)
[15:45:37] dminuoso: 21>> def f(f:) end
[15:45:38] ruby[bot]: dminuoso: # => :f (https://eval.in/846201)
[15:45:44] dminuoso: matthewd, havenwood ^-
[15:45:47] synthroid: has joined #ruby
[15:47:06] dminuoso: >> def f f: :f end
[15:47:07] username: has joined #ruby
[15:47:07] ruby[bot]: dminuoso: # => /tmp/execpad-e52841408a1a/source-e52841408a1a:2: syntax error, unexpected keyword_end, expecting ';' ...check link for more (https://eval.in/846210)
[15:47:08] dminuoso: y u no parse.
[15:47:38] elaptics: has joined #ruby
[15:50:39] Psi-Jack: has joined #ruby
[15:51:41] xcesariox: has joined #ruby
[15:51:43] 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?
[15:52:27] Doow: Anyone know if the windows ruby installer (from https://rubyinstaller.org/downloads/ ) is possible run silently? or at least without user interaction.
[15:52:35] dminuoso: Psi-Jack: ignore whether the key exists.
[15:52:39] matthewd: Psi-Jack: `if h[k]`?
[15:52:41] dminuoso: Psi-Jack: if it doesnt and you access it, you get a nil
[15:53:02] jackjackdripper: has joined #ruby
[15:53:17] dminuoso: Doow: https://github.com/oneclick/rubyinstaller/wiki/faq#silent_install
[15:53:40] dminuoso: Doow: Oh wrong version: https://github.com/oneclick/rubyinstaller2/wiki/FAQ#user-content-silent-install
[15:53:52] cdg: has joined #ruby
[15:54:04] cschneid_: has joined #ruby
[15:54:06] Doow: dminuoso: awesome, thank you
[15:54:08] Psi-Jack: dminuoso: Perfect.
[15:55:00] cschneid_: Are `Float`s 64 bit under the covers? And are there any lower precision ones that use up less memory?
[15:55:56] cschneid_: same w/ Fixnum I guess - I have a much more constrained range, but need millions of them :)
[15:56:03] 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?
[15:56:47] cadillac_: has joined #ruby
[15:57:26] Psi-Jack: or would comparing if that == true, be better/the same?
[15:59:43] 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.
[16:00:18] Psi-Jack: That part is fine. It mandates a specific structure. :)
[16:00:57] theunrav_: has joined #ruby
[16:01:27] jottr: has joined #ruby
[16:02:41] jamal7: has joined #ruby
[16:03:20] Psi-Jack: mostly trying to clean up code that was using arrays when hashes could've been better.
[16:03:29] Psi-Jack: And far cleaner. :)
[16:03:57] marxarelli: has joined #ruby
[16:04:35] jaequery: has joined #ruby
[16:06:28] username1: has joined #ruby
[16:10:02] Rapture: has joined #ruby
[16:17:39] benlieb: has joined #ruby
[16:17:48] herbmillerjr: has joined #ruby
[16:21:14] anas: has joined #ruby
[16:26:08] mtkd: has joined #ruby
[16:28:28] cdg: has joined #ruby
[16:29:41] armyriad: has joined #ruby
[16:33:59] knight33: has joined #ruby
[16:34:46] ecuanaso: has joined #ruby
[16:35:35] eckhardt: has joined #ruby
[16:39:25] jamal7: has joined #ruby
[16:45:37] Dimik: has joined #ruby
[16:48:14] SeepingN: has joined #ruby
[16:48:34] hahuang65: has joined #ruby
[16:53:26] mikepack: has joined #ruby
[16:56:43] xall: has joined #ruby
[16:57:50] nacsurte: has joined #ruby
[16:58:03] hahuang65: has joined #ruby
[16:59:53] graft: has joined #ruby
[16:59:53] graft: has joined #ruby
[17:00:27] theunraveler: has joined #ruby
[17:06:19] jamal7: has joined #ruby
[17:08:46] synthroid: has joined #ruby
[17:09:51] kapil___: has joined #ruby
[17:15:16] goyox86_: has joined #ruby
[17:17:07] bronson: has joined #ruby
[17:17:25] PaulCapestany: has joined #ruby
[17:25:51] Dimik: has joined #ruby
[17:26:19] ryandv: has joined #ruby
[17:26:27] ryandv: does capybara attempt to start a new HTTP server for every example that is run?
[17:26:43] dlitvak: has joined #ruby
[17:30:34] iomotoko: has joined #ruby
[17:30:57] iomotoko: is there any serious use case for irb (interactive ruby interpreter)?
[17:31:13] iomotoko: besides learning & quick calculations?
[17:31:18] konsolebox: pry is better
[17:31:39] kies: has joined #ruby
[17:31:47] havenwood: iomotoko: repl-driven development, etc
[17:31:59] ResidentBiscuit: has joined #ruby
[17:32:09] 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
[17:32:27] ResidentBiscuit: has joined #ruby
[17:32:35] Papierkorb: iomotoko: prototyping small ideas ... and actually, as calculator for some things for me lol
[17:32:46] havenwood: iomotoko: You can put a `binding.irb` or `binding.pry` in your code for debugging.
[17:33:14] havenwood: iomotoko: https://www.youtube.com/watch?v=D9j_Mf91M0I
[17:33:28] iomotoko: havenwood: ah nice
[17:33:36] Papierkorb: iomotoko: You can even debug a daemon process with pry if you set it up correctly
[17:33:47] f48ds2: has joined #ruby
[17:33:58] iomotoko: Papierkorb: havenwood: thanks, will watch that vid when I have time :)
[17:34:01] guacamole: has joined #ruby
[17:35:28] hahuang65: has joined #ruby
[17:37:23] jottr: has joined #ruby
[17:38:50] Puffball_: has joined #ruby
[17:39:39] kn-928: has joined #ruby
[17:45:02] guacamole: has joined #ruby
[17:46:58] beilabs: has joined #ruby
[17:57:20] jinie: has joined #ruby
[17:58:08] mikecmpbll: has joined #ruby
[17:58:15] 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']
[18:00:00] tobiasvl: Psi-Jack: you mean where every value under there matches true, right?
[18:00:40] 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
[18:00:59] Psi-Jack: I actually need to act on both true, and false in that so that one I think is easy.
[18:01:34] Psi-Jack: node['zabbix']['trap_agents']['live'].each do |script, flag|
[18:02:21] Psi-Jack: For the node['zabbix']['agent_meta']['$name'] I need only the true ones to build a space-seperated string.
[18:02:46] Puffball: has joined #ruby
[18:04:11] s3nd1v0g1us: has joined #ruby
[18:04:29] tobiasvl: well you can do the same thing basically, or use select
[18:04:38] tobiasvl: node['zabbix']['trap_agents']['live'].select {|k, v| v }
[18:04:46] s3nd1v0g1us: has joined #ruby
[18:04:57] tobiasvl: will return a hash with just the entries where the values are true
[18:05:03] gchristensen: has left #ruby: ("WeeChat 1.7.1")
[18:05:40] t-recx: has joined #ruby
[18:05:45] Psi-Jack: Well, node['zabbix']['agent_meta'].select in that case. But isn't there a simpler way to build the string I need?
[18:05:56] Psi-Jack: Without having to loop through it again after that .select? ;)
[18:06:24] tobiasvl: of course, you can just do something like: node['zabbix']['trap_agents']['live'].select {|k, v| v }.keys.join " "
[18:06:35] KeyJoo: has joined #ruby
[18:07:00] BSAlb: has joined #ruby
[18:07:35] cwailes: has joined #ruby
[18:08:13] tobiasvl: I guess I meant node['zabbix']['agent_meta']['$name'] but you get the gist
[18:08:24] Psi-Jack: Yes, yes I do, thank you.
[18:08:50] 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?
[18:09:20] 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.
[18:11:36] benjen: has joined #ruby
[18:13:38] __Yiota: has joined #ruby
[18:16:11] Joufflu: has joined #ruby
[18:16:34] Psi-Jack: .select {|k, v| v}.keys.join " " would join the values, or the keys?
[18:17:06] cwailes: No ideas on why rbenv might be failing silently?
[18:17:38] apeiros: Psi-Jack: the keys
[18:17:51] apeiros: since you do explicitly .keys, which, as the name implies, returns the keys
[18:18:07] segy: has joined #ruby
[18:18:29] lxsameer: has joined #ruby
[18:18:38] matthewd: cwailes: I think ruby-build has a -v option that might help
[18:18:55] Psi-Jack: Oh! D'uh. ;)
[18:18:58] matthewd: cwailes: Do you have a full build environment accessible inside the container?
[18:19:18] Psi-Jack: I'm still a little sick, so mind's not totally 100%. :)
[18:19:51] matthewd: Psi-Jack: This sort of experimentation is a great use case for exploring in irb
[18:20:53] xzhao: has joined #ruby
[18:21:26] xzhao: has left #ruby: ()
[18:23:53] kalimirch: has joined #ruby
[18:24:37] nopolitica: has joined #ruby
[18:27:11] dstrunk: has joined #ruby
[18:28:33] cdg_: has joined #ruby
[18:29:50] jinie: has joined #ruby
[18:32:53] rubylegend2092: has joined #ruby
[18:35:39] tobiasvl: Psi-Jack: .keys.join will join the keys, yes :)
[18:35:59] tobiasvl: .values.join would join the values
[18:36:21] Psi-Jack: Yeah. I've actually been testing the results, and it's so far working to expectations. :D
[18:37:49] jaequery: has joined #ruby
[18:38:01] FernandoBasso: has joined #ruby
[18:38:03] cdg: has joined #ruby
[18:43:02] ozcanesen: has joined #ruby
[18:45:08] ShekharReddy: has joined #ruby
[18:45:17] kn-928: has joined #ruby
[18:46:44] dionysus69: has joined #ruby
[18:47:41] minimalism: has joined #ruby
[18:48:08] chouhoul_: has joined #ruby
[18:48:40] eb0t: has joined #ruby
[18:50:29] jinie: has joined #ruby
[18:51:29] uZiel: has joined #ruby
[18:52:32] dviola: has joined #ruby
[18:56:08] hammerhead: has joined #ruby
[18:56:51] xuanrui: has joined #ruby
[18:58:51] harfangk: has joined #ruby
[18:58:55] cwailes: matthewd: I have gcc and make. It looks like autoconf was missing. I'm installing that now.
[19:00:05] Rapture: has joined #ruby
[19:00:05] cwailes: matthewd: That didn't fix it, unfortunately.
[19:00:49] cwailes: matthewd: What else would I need, besides gcc, ruby-dev, make, and autoconf?
[19:01:31] hammerhead: Hi all, when you do gem source --add SOURCE_URI, which file does gem edit to add a new source repo?
[19:02:32] 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?
[19:03:03] cwailes: matthewd: I usually run Fedora, but this has to be inside an Ubuntu image.
[19:03:40] hammerhead: oww.. I found something useful http://guides.rubygems.org/command-reference/#gem-sources
[19:04:05] hammerhead: This should be in a man page.
[19:04:18] ski7777: has joined #ruby
[19:04:25] matthewd: cwailes: The easy option can be to find the OS package's build deps
[19:05:00] matthewd: cwailes: `apt-get build-dep ruby` or something?
[19:05:20] matthewd: cwailes: I imagine most "how to install/build ruby" guides would have a proper list of deps, too
[19:06:34] cwailes: Well, apt-get complained that it was unable to find a source package for ruby.
[19:06:54] cwailes: Does rbenv save any log files anywhere?
[19:07:04] cwailes: This would be simple if I just knew what it wanted.
[19:07:14] havenwood: cwailes: You're on Ubuntu?
[19:07:26] cwailes: havenwood: Ubuntu Docker image.
[19:07:45] havenwood: cwailes: Brightbox maintains nice, up-to-date Ruby packages for Ubuntu: https://www.brightbox.com/docs/ruby/ubuntu/
[19:07:59] cwailes: I don't usually use Ubuntu, but I have to in this instance.
[19:08:54] 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
[19:09:08] havenwood: https://github.com/postmodern/chruby/wiki/Ruby
[19:09:23] havenwood: I think there's a deps list in rbenv wiki as well.
[19:09:43] havenwood: Yup: https://github.com/rbenv/ruby-build/wiki#suggested-build-environment
[19:10:10] havenwood: One nice thing in favor of ruby-install is it does install them for you.
[19:10:31] havenwood: https://github.com/postmodern/ruby-install
[19:10:37] havenwood: You're welcome.
[19:11:41] cwailes: Even with those dependencies installed rbenv still fails silently. I think I'll try the brightbox repo.
[19:14:36] conta: has joined #ruby
[19:15:19] 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!
[19:15:19] quobo: has joined #ruby
[19:15:40] synthroid: has joined #ruby
[19:15:59] chouhoulis: has joined #ruby
[19:16:37] cwailes: havenwood: Thanks a bunch. It looks like the repo installed Ruby just fine.
[19:17:46] bronson: has joined #ruby
[19:18:12] 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.
[19:18:20] elsevero: has joined #ruby
[19:18:52] havenwood: Maybe a permissions error? Great, nice to use a well-maintained package anyways!
[19:19:45] 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.
[19:20:36] Psi-Jack: Hmmm.. For some reason node['zabbix']['agent_meta'].select {|k, v|}.keys join " " is coming back an empty string. :/
[19:20:47] Psi-Jack: Oh... I forgot the v...
[19:21:54] cwailes: has joined #ruby
[19:22:59] mim1k: has joined #ruby
[19:23:44] ecuanaso: has joined #ruby
[19:26:13] dviola: has joined #ruby
[19:26:25] tobiasvl: yeah, the v alone means that it selects the ones where v evaluated to true
[19:26:50] tobiasvl: select takes a block and selects those key-value pairs where the block evaluates to true
[19:37:25] FernandoBasso: has joined #ruby
[19:37:41] cdg: has joined #ruby
[19:40:32] GGMethos: has joined #ruby
[19:41:59] npgm: has joined #ruby
[19:43:33] xall: has joined #ruby
[19:44:34] ledestin: has joined #ruby
[19:45:27] xall: currently working through ruby koans. needed a count so came up with this
[19:45:30] xall: @messages.each_with_object(Hash.new(0)) { |msg, counts| counts[msg] += 1 }[name]
[19:45:38] xall: but then realized
[19:45:40] xall: @messages.count(name)
[19:46:01] havenwood: meditation brought enlightenment
[19:46:13] xall: shoulda known ruby had a better way
[19:47:02] 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
[19:54:11] tomphp: has joined #ruby
[19:54:29] Mia: has joined #ruby
[19:54:29] Mia: has joined #ruby
[19:55:30] cam27: has joined #ruby
[19:56:12] tomphp_: has joined #ruby
[19:57:21] eckhardt: has joined #ruby
[19:59:42] guacamole: has joined #ruby
[20:02:26] rabajaj: has joined #ruby
[20:02:32] dionysus69: has joined #ruby
[20:02:34] ecuanaso: has joined #ruby
[20:02:54] dennisvennink: has joined #ruby
[20:02:56] yokel: has joined #ruby
[20:04:01] zacts: has joined #ruby
[20:05:21] cam27: has left #ruby: ()
[20:06:29] cdg: has joined #ruby
[20:10:43] cdg_: has joined #ruby
[20:10:45] preyalone: has joined #ruby
[20:11:51] cdg: has joined #ruby
[20:12:19] cdg_: has joined #ruby
[20:12:59] rikkipitt: has joined #ruby
[20:15:29] WeiJunLi: has joined #ruby
[20:18:04] ephemera_: has joined #ruby
[20:18:18] Murda: has joined #ruby
[20:18:44] cagomez: has joined #ruby
[20:19:44] yeticry_: has joined #ruby
[20:19:46] mahlon: has joined #ruby
[20:20:05] bruno-: has joined #ruby
[20:20:15] troulouliou_div2: has joined #ruby
[20:22:03] username1: has joined #ruby
[20:22:21] username1: has joined #ruby
[20:26:39] s3nd1v0g1us: has joined #ruby
[20:27:13] s3nd1v0g1us: has joined #ruby
[20:28:23] jottr: has joined #ruby
[20:28:35] eckhardt: has joined #ruby
[20:28:55] brent__: has joined #ruby
[20:30:35] cam27: has joined #ruby
[20:31:30] theta8: has joined #ruby
[20:33:26] ryandv: has joined #ruby
[20:35:52] mim1k: has joined #ruby
[20:37:26] FernandoBasso: has joined #ruby
[20:43:32] crankharder: has joined #ruby
[20:45:59] jenrzzz: has joined #ruby
[20:45:59] jenrzzz: has joined #ruby
[20:48:13] twe4ked: has joined #ruby
[20:49:50] ur5us: has joined #ruby
[20:50:21] tAn: has joined #ruby
[20:51:41] ryandv: has joined #ruby
[20:52:15] tAn: has joined #ruby
[20:52:29] tw1sted: has joined #ruby
[20:52:39] ecuanaso: has joined #ruby
[21:00:23] ryandv: has joined #ruby
[21:07:40] nacsurte_: has joined #ruby
[21:08:01] bambanx: has joined #ruby
[21:13:18] Emmanuel_Chanel: has joined #ruby
[21:13:44] brent__: has joined #ruby
[21:16:01] naprimer: has joined #ruby
[21:17:15] nadir: has joined #ruby
[21:18:01] nacsurte: has joined #ruby
[21:19:11] bronson: has joined #ruby
[21:22:37] enterprisey: has joined #ruby
[21:34:29] cdg: has joined #ruby
[21:35:45] goyox86_: has joined #ruby
[21:38:29] GodFather: has joined #ruby
[21:41:01] cdg: has joined #ruby
[21:41:04] belmoussaoui_: has joined #ruby
[21:43:13] ecuanaso: has joined #ruby
[21:47:39] DanielI: has joined #ruby
[21:50:40] jenrzzz: has joined #ruby
[21:51:55] cagomez: has joined #ruby
[22:01:52] belmoussaoui: has joined #ruby
[22:08:53] guacamole: has joined #ruby
[22:12:09] cwailes: has left #ruby: ()
[22:13:10] jenrzzz: has joined #ruby
[22:13:14] s3nd1v0g1us: has joined #ruby
[22:21:17] ignarps: has joined #ruby
[22:27:56] jnollette: has joined #ruby
[22:29:28] arvindsaik: has joined #ruby
[22:31:46] xuanrui: has joined #ruby
[22:35:16] FastJack: has joined #ruby
[22:36:17] Mia: has joined #ruby
[22:36:56] ryandv: has joined #ruby
[22:39:06] Mia: has joined #ruby
[22:39:06] Mia: has joined #ruby
[22:39:44] kalimirch: has joined #ruby
[22:40:05] rubylegend2092: has joined #ruby
[22:40:18] brendan-: has joined #ruby
[22:41:06] jtd: has joined #ruby
[22:47:53] jaequery: has joined #ruby
[22:50:04] bronson: has joined #ruby
[22:56:22] aclark: has joined #ruby
[22:58:20] cschneid_: has joined #ruby
[22:58:24] s3nd1v0g1us: has joined #ruby
[23:00:02] s3nd1v0g1us: has joined #ruby
[23:00:45] s3nd1v0g1us: has joined #ruby
[23:01:43] dennisvennink: has joined #ruby
[23:02:06] s3nd1v0g1us: has joined #ruby
[23:05:48] Moosashi: has joined #ruby
[23:23:06] Joufflu: has joined #ruby
[23:28:15] phinxy: has joined #ruby
[23:36:34] beilabs: has joined #ruby
[23:44:22] alfiemax: has joined #ruby
[23:46:34] phinxy: has joined #ruby
[23:46:54] ecuanaso: has joined #ruby
[23:46:55] dviola: has joined #ruby
[23:47:57] raynold: has joined #ruby
[23:49:41] cdg: has joined #ruby
[23:54:16] t-recx: has joined #ruby
[23:57:03] runescape07rsps: has joined #ruby