« Back to channel list

#ruby - 05 October 2018

« Back 1 day Forward 1 day »
[00:03:24] JJonah: Nice trick here: `meta_klass = class << self; self end`. I've been doing a lot of meta-programming lately but never thought to do that. Thanks for sharing.
[00:05:52] cthu|: my lovely fellas
[00:06:06] cthu|: is there a way to skip lines in file.each_line
[00:06:15] cthu|: no, I'm not gonna do that
[00:06:24] cthu|: I'm not gonna do it here, I'll have another loop
[00:06:30] blackhaze: I could resolve
[00:06:51] blackhaze: I installed sqlite3 in my distro
[00:08:55] baweaver: cthu|: define skip
[00:08:56] baweaver: probably `next`
[00:09:03] cthu|: no, I have a bigger problem
[00:09:14] cthu|: I need to combine one hash from a few lines
[00:09:31] cthu|: that's not done via this kind of loop
[00:09:46] cthu|: I'm gonna just iterate with a counter where I can do i++ in the loop
[00:10:10] JJonah: that sounds like an un-rubyish solutino
[00:10:26] cthu|: in this log file I have lines that start with garbage or Category: or Action: or Label: C,A,L lines go one after another.
[00:10:46] cthu|: I need to create a large array with objects. each object has three fields
[00:11:22] cthu|: see? if I see C, I need to make an object using it and next two lines
[00:11:45] cthu|: after which I want to skip two lines, effectively doing i+=2
[00:12:05] cthu|: but I don't have access to the next lines from here and I don't want awkward logic
[00:12:07] baweaver: You have an example file and example output you want?
[00:12:15] cthu|: ok, forget about it
[00:12:29] cthu|: I think I have a few ways to go with it
[00:12:59] baweaver: Suit yourself
[00:15:24] JJonah: cthu: if the file large enough to load into memory, do one pass where you filter out the junk, then each_slice to get your C,A,L lines as chunks, then map to make the objects.
[00:15:37] JJonah: small enough to load into memory*
[00:16:33] baweaver: Read 3 lines, seek + 2, read 3 lines ...
[00:16:41] orbyt_: has joined #ruby
[00:17:46] Autolycus: has joined #ruby
[00:20:49] francisco: has joined #ruby
[00:57:42] duderonomy: has joined #ruby
[00:59:41] aleph-: has joined #ruby
[01:00:16] aleph-: Hey there, so I was curious if anybody had a good quick primer for Ruby centered towards admins/devops?
[01:00:33] aleph-: Preferably for those with previous experience so as to cut through the cruft.
[01:04:01] lxsameer: has joined #ruby
[01:05:02] baweaver: define previous experience.
[01:05:48] bmurt: has joined #ruby
[01:07:11] aleph-: baweaver: Intermediate in Python, Bash, Rust, semi competent in C, Java and x86/MIPS/Thumb ASM, meh in Haskell, Scheme, etc.
[01:07:31] baweaver: This one is a bit basic - http://rubyforadmins.com/
[01:07:41] baweaver: Eloquent Ruby covers a lot of how to write Ruby like someone who writes Ruby
[01:07:55] baweaver: Past that it depends heavily on what you want to do or what type of work it is.
[01:09:30] aleph-: Gotcha, mainly scripts to plug in to the k8s api, general scripting work, plugins for Chef, auto provisioning over ssh in a pinch, graphing of data etc.
[01:19:43] orbyt_: has joined #ruby
[01:23:36] edwardthefma: has joined #ruby
[01:26:54] blackhaze: has left #ruby: ()
[01:31:15] Puffball: has joined #ruby
[01:44:47] darkhanb: has joined #ruby
[01:54:07] cagomez: has joined #ruby
[02:01:34] c0ncealed3: has joined #ruby
[02:03:35] fluxAeon: has joined #ruby
[02:21:23] esrse: has joined #ruby
[02:39:12] edwardthefma: ACTION is looikng for someone who can dev a rbot plugin using My anime list plugin
[02:39:36] edwardthefma: My anime list api
[02:44:50] Puffball: has joined #ruby
[02:52:18] baweaver: edwardthefma: for...?
[02:52:27] baweaver: We could also teach you to make one depending on what it is
[02:59:39] edwardthefma: Its a simple plugin that searches the my anime list data base
[03:00:31] edwardthefma: For anime buy name
[03:01:17] edwardthefma: Its for a channel im going to start on another server
[03:08:53] baweaver: So why Ruby?
[03:09:15] braincrash: has joined #ruby
[03:10:20] Azure: has joined #ruby
[03:11:56] edwardthefma: I know ruby isnt rescouce intensive
[03:28:40] dbz: has joined #ruby
[03:30:08] edwardthefma: has left #ruby: ("Quit message")
[03:46:19] Fr4n: has joined #ruby
[03:55:54] baweaver: Did a writeup on destructuring in Ruby: https://medium.com/@baweaver/destructuring-in-ruby-9e9bd2be0360
[03:56:03] baweaver: veers a bit advanced, but a lot of fun stuff around in it
[03:57:55] sp3ncer: has joined #ruby
[03:58:23] sp3ncer: I'm trying to build a gem for an executable ruby project and am having a lot of trouble
[03:58:35] sp3ncer: Could someone give me a hand if they have a minute?
[04:01:20] dbz: has joined #ruby
[04:09:36] uplime: has joined #ruby
[04:10:24] knight33: has joined #ruby
[04:10:47] uplime: is there a method for arrays like collect, but if the return value is nil don't add it to the array?
[04:11:09] sp3ncer: I think I finally figured it out
[04:11:16] sp3ncer: that was really not well documented
[04:11:59] ramfjord: has joined #ruby
[04:12:40] baweaver: uplime: typically map is more common, though you probably want compact as well
[04:13:06] baweaver: [1, 2, 3].map { |n| n.even? x * 2 : nil }.compact
[04:13:22] uplime: that should just be [2] right?
[04:13:34] baweaver: [4], but pretty much
[04:13:47] uplime: yeah thats perfect, thank you!
[04:15:52] sp3ncer: great and someone already took my name
[04:17:00] za1b1tsu: has joined #ruby
[04:45:56] LiftLeft: has joined #ruby
[04:46:22] APK: has joined #ruby
[04:47:30] lxsameer: has joined #ruby
[04:48:39] clemens3: has joined #ruby
[04:49:57] Church_: has joined #ruby
[04:50:31] sauvin_: has joined #ruby
[04:59:31] helpa: has joined #ruby
[05:00:18] Scient: has joined #ruby
[05:00:28] Psy-Q: has joined #ruby
[05:01:15] reber: has joined #ruby
[05:01:18] DTZUZO: has joined #ruby
[05:03:43] cschneid_: has joined #ruby
[05:06:32] MoritaShinobu: has joined #ruby
[05:09:25] cschneid_: has joined #ruby
[05:16:20] rspades: has joined #ruby
[05:30:38] elphe: has joined #ruby
[05:32:52] cschneid_: has joined #ruby
[05:41:20] za1b1tsu: has joined #ruby
[05:52:37] dellavg_: has joined #ruby
[06:12:12] ramfjord: has joined #ruby
[06:13:51] aupadhye: has joined #ruby
[07:17:03] clemens3: has joined #ruby
[07:19:54] za1b1tsu: has joined #ruby
[07:20:29] francisco: has joined #ruby
[07:31:46] yohji: has joined #ruby
[07:33:16] vondruch: has joined #ruby
[07:45:12] phaul: has joined #ruby
[07:48:26] kapil____: has joined #ruby
[07:59:48] mikecmpbll: has joined #ruby
[08:06:19] lxsameer: has joined #ruby
[08:09:20] schneider: has joined #ruby
[08:12:28] ramfjord: has joined #ruby
[08:16:49] schneider: has joined #ruby
[08:19:23] Blaguvest: has joined #ruby
[08:25:44] stooj_: has joined #ruby
[08:43:02] im0nde_: has joined #ruby
[08:43:41] BTRE: has joined #ruby
[08:46:32] ellcs: has joined #ruby
[08:55:21] aufi_: has joined #ruby
[08:55:59] Beams: has joined #ruby
[08:57:21] xfbs: has joined #ruby
[09:07:49] jkprg: has joined #ruby
[09:10:37] kreantos: has joined #ruby
[09:25:32] aupadhye: has joined #ruby
[09:33:49] asphyxia: has joined #ruby
[09:35:44] asphyxia: hey y'all, I have a uni assignment that is asking me to create a method with a parameter of (a). And I have no idea what they mean. Is that a built in ruby thing? so method_name(a) <-- I'm currently thinking they mean a for array?
[09:47:22] im0nde_: has joined #ruby
[09:54:28] DTZUZO: has joined #ruby
[10:12:45] ramfjord: has joined #ruby
[10:15:59] bkxd: has joined #ruby
[10:32:48] AJA4350: has joined #ruby
[10:33:15] cschneid_: has joined #ruby
[10:35:29] bkxd: has joined #ruby
[10:36:06] Mike111: has joined #ruby
[10:37:16] Blaguvest: has joined #ruby
[10:49:14] canton7: asphyxia, that just means a method which has a single parameter, called 'a'. It could be an array, or anything else: there's no enough information to say
[11:08:52] tdy: has joined #ruby
[11:11:40] donofrio: has joined #ruby
[11:15:31] xfbs: has joined #ruby
[11:17:34] asphyxia: canton7: ok sweet, ty ^^
[11:23:38] zenspider: working on a emacs mode to color methods based on flog scores... I'm undecided on how to do the score -> shading at this point. Suggestions?
[11:24:12] zenspider: (right now it goes from white through pink all the way up to full red linearly
[11:29:13] aupadhye: has joined #ruby
[11:34:31] devyn: has joined #ruby
[11:51:55] phaul: has joined #ruby
[12:02:33] n13z: has joined #ruby
[12:02:45] cschneid_: has joined #ruby
[12:07:49] gnufied: has joined #ruby
[12:12:58] ramfjord: has joined #ruby
[12:16:28] elphe: has joined #ruby
[12:19:32] roshanavand: has joined #ruby
[12:25:21] devyn: has joined #ruby
[12:25:54] ramfjord: has joined #ruby
[12:52:13] elphe: has joined #ruby
[12:53:34] chouhoulis: has joined #ruby
[13:00:33] bmurt: has joined #ruby
[13:04:45] aupadhye: has joined #ruby
[13:12:54] im0nde: has joined #ruby
[13:21:22] vonfry: has joined #ruby
[13:21:23] rippa: has joined #ruby
[13:27:58] leeijaw_mobile: has joined #ruby
[13:28:40] fluxAeon: has joined #ruby
[13:30:10] akem: has joined #ruby
[13:33:18] cschneid_: has joined #ruby
[13:35:41] bkxd: has joined #ruby
[13:35:46] dmitch: has joined #ruby
[13:37:49] Cork: has joined #ruby
[13:46:14] chouhoulis: has joined #ruby
[13:47:29] gnufied: has joined #ruby
[14:03:19] Rapture: has joined #ruby
[14:08:05] edwardthefma: has joined #ruby
[14:09:24] bkxd: has joined #ruby
[14:09:51] asphyxia: has left #ruby: ()
[14:25:14] chouhoulis: has joined #ruby
[14:39:21] elphe: has joined #ruby
[14:39:36] dviola: has joined #ruby
[14:41:05] chouhoulis: has joined #ruby
[14:48:22] bkxd: has joined #ruby
[14:50:50] uplime: has joined #ruby
[14:55:02] apeiros_: has joined #ruby
[14:57:32] fluxAeon: has joined #ruby
[14:58:27] cschneid_: has joined #ruby
[15:06:16] vondruch: has left #ruby: ()
[15:06:20] sameerynho: has joined #ruby
[15:07:19] sticaz: has joined #ruby
[15:21:50] rrichardsr3: has joined #ruby
[15:26:07] xfbs: has joined #ruby
[15:38:37] aufi_: has joined #ruby
[15:44:34] orbyt_: has joined #ruby
[15:48:51] aeze: has joined #ruby
[15:51:42] phaul: has joined #ruby
[15:53:51] duderonomy: has joined #ruby
[15:58:07] Eiam: edwardthefma: hello
[15:58:15] vondruch: has joined #ruby
[15:59:07] spiette: has joined #ruby
[16:00:38] yxhuvud: has joined #ruby
[16:01:29] emerson: has joined #ruby
[16:05:05] fredlinhares: has joined #ruby
[16:05:21] duderonomy: has joined #ruby
[16:07:09] orbyt_: has joined #ruby
[16:08:14] duderonomy: has joined #ruby
[16:13:25] edwardthefma: Its always so quiet hear
[16:14:06] edwardthefma: Other than people joining and leaving
[16:17:07] apeiros_: edwardthefma: it's friday
[16:18:41] havenwood: edwardthefma It gets active when someone has a Ruby question.
[16:20:40] cthulchu_: has joined #ruby
[16:20:51] apeiros: has joined #ruby
[16:21:23] havenwood: edwardthefma: In the meantime, here's a little wrapper around TupleSpace - Ruby's lesser-used, thread-safe data structure: https://gist.github.com/havenwood/08e859ddd53c84be6c56
[16:21:42] duderonomy: has joined #ruby
[16:21:54] apeiros_: woot, two apeiros!
[16:21:54] apeiros: wooot, two apeiros!
[16:23:00] apeiros: well, it was nice while it lasted.
[16:24:15] akem: has joined #ruby
[16:24:22] wildermind: has joined #ruby
[16:27:04] cd: has joined #ruby
[16:29:09] darkhanb: has joined #ruby
[16:29:50] Cork: has joined #ruby
[16:32:09] dinfuehr: has joined #ruby
[16:35:40] spiette: has joined #ruby
[16:41:16] knight33: has joined #ruby
[16:41:24] orbyt_: has joined #ruby
[16:49:34] Rapture: has joined #ruby
[16:52:26] orbyt_: has joined #ruby
[16:54:06] Nicmavr: has joined #ruby
[16:59:06] mikecmpbll: has joined #ruby
[17:00:28] dbz: has joined #ruby
[17:00:46] spiette: has joined #ruby
[17:01:08] dbz: has joined #ruby
[17:02:08] dbz: has joined #ruby
[17:02:37] DTZUZO: has joined #ruby
[17:02:51] dbz: has joined #ruby
[17:12:51] ramfjord: has joined #ruby
[17:18:28] za1b1tsu: has joined #ruby
[17:20:28] savolla: has joined #ruby
[17:27:20] BloodyMary: has joined #ruby
[17:27:36] pr0ton: has joined #ruby
[17:27:55] DTZUZO: has joined #ruby
[17:41:43] DTZUZO: has joined #ruby
[17:42:26] duderonomy: has joined #ruby
[17:42:46] Cork: has joined #ruby
[17:56:41] duderonomy: has joined #ruby
[18:00:47] dbz_: has joined #ruby
[18:01:41] Emmanuel_Chanel: has joined #ruby
[18:05:07] bkxd: has joined #ruby
[18:06:32] duderonomy: has joined #ruby
[18:07:38] DTZUZO_: has joined #ruby
[18:19:20] DTZUZO_: has joined #ruby
[18:22:18] xfbs: has joined #ruby
[18:32:26] Fr4n: has joined #ruby
[18:47:33] dbz: has joined #ruby
[18:55:20] postmodern: has joined #ruby
[18:56:09] conta1: has joined #ruby
[18:58:18] AJA4351: has joined #ruby
[19:04:11] AJA4350: has joined #ruby
[19:09:50] graphene: has joined #ruby
[19:10:13] duderonomy: has joined #ruby
[19:14:01] phaul: has joined #ruby
[19:19:00] DTZUZO: has joined #ruby
[19:23:18] apeiros_: has joined #ruby
[19:23:53] unCork: has joined #ruby
[19:28:43] SeepingN: has joined #ruby
[19:34:52] rserkov: has joined #ruby
[19:42:20] samort7: has joined #ruby
[19:46:15] aleph-: has joined #ruby
[19:52:06] dbz: has joined #ruby
[19:52:49] dbz: has joined #ruby
[19:58:46] ivanskie: has joined #ruby
[20:02:57] kinduff: has joined #ruby
[20:09:10] al2o3-cr: has joined #ruby
[20:12:24] dbz_: has joined #ruby
[20:14:46] BloodyMary: has joined #ruby
[20:24:12] graphene: has joined #ruby
[20:30:24] chouhoulis: has joined #ruby
[20:35:55] pr0ton: has joined #ruby
[20:41:25] uplime: has joined #ruby
[20:44:20] c0ncealed3: has joined #ruby
[20:47:54] tdy: has joined #ruby
[21:00:36] schneider: has joined #ruby
[21:04:24] SeepingN_: has joined #ruby
[21:05:34] c0ncealed3: has joined #ruby
[21:06:49] apeiros_: has joined #ruby
[21:09:56] schneider: has joined #ruby
[21:12:32] dbz: has joined #ruby
[21:12:40] baweaver: 404 users not found :D
[21:12:42] lemur: Aw, ruined it
[21:13:14] ShekharReddy: has joined #ruby
[21:13:47] apeiros_: lemur: I'm back :)
[21:13:56] dbz: has joined #ruby
[21:14:00] apeiros_: sorry, had to run a couple of target disk mode experiments
[21:14:17] lemur: not a problem
[21:14:18] apeiros_: and I gotta say, target mode is terrible on the 2018 models. ~330MB/s max.
[21:14:35] apeiros: (connected two 2018 models and copied a 250GB file)
[21:14:46] lemur: I'm on both of my computers
[21:14:47] lemur: one is on baweaver
[21:14:48] lemur: as far as meta klass?
[21:14:49] lemur: Lazy googling
[21:14:54] dbz: has joined #ruby
[21:15:47] apeiros: but nice article 👍🏻
[21:19:12] schneider: has joined #ruby
[21:20:37] SCHAPiE: has joined #ruby
[21:20:45] ivanskie: has joined #ruby
[21:21:17] anothertorusr: has joined #ruby
[21:21:35] lemur: It was a fun little jaunt
[21:21:52] lemur: Likely going to use it for destructuring in Qo later.
[21:22:13] lemur: Just not sure how to make it look nice
[21:22:14] apeiros: btw., why do you do the strict check and not just destructure kwargs?
[21:22:33] apeiros: I mean we could have `foo(1,2,destructure_only_this)`
[21:22:49] apeiros: with `def foo(a,b,c:,d:,e:)`
[21:25:05] zenspider: havenwood: maaaannn... I love rinda
[21:25:09] zenspider: I really need more reasons to use it
[21:25:27] apeiros: isn't rinda part of drb?
[21:25:38] apeiros: rings a bell at least
[21:26:46] zenspider: built on top of it, yeah
[21:26:55] zenspider: apeiros: bot still brokey?
[21:27:23] apeiros: just wanted to check the logs. but new macbook, so my keychain is in disarray… :-S
[21:27:47] zenspider: that said... I've probably carried this ssh key a tad too far.
[21:28:25] apeiros: since when is the verify step when mounting a disk image mandatory? is that a mojave thing? o0
[21:28:27] schneider: has joined #ruby
[21:29:34] zenspider: if the image is signed, I believe
[21:29:56] zenspider: oh. you mean there is no "skip" button? that seems new
[21:30:05] apeiros: yeah, that
[21:30:10] zenspider: I'm holding off on mojave for a while... until at least .1
[21:30:30] havenwood: ed25519 ftw, it's time: https://latacora.micro.blog/2018/08/03/the-default-openssh.html
[21:30:33] apeiros: wanted to do that too. but new laptop. thought maybe it fixes my stupid target disk mode issues.
[21:30:39] apeiros: (it doesn't)
[21:31:04] BTRE: has joined #ruby
[21:31:22] apeiros: huh? now there's a skip button. weird.
[21:32:00] cthu|: has joined #ruby
[21:33:42] apeiros: I still can't get used to journalctl
[21:35:14] ruby[bot]: has joined #ruby
[21:35:15] ChanServ: +o ruby[bot]
[21:35:39] ruby[bot]: apeiros: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[21:35:44] ruby[bot]: -b *!*@unaffiliated/icarus-/x-7520418$#ruby-banned
[21:35:46] zenspider: haha. oh no
[21:36:03] apeiros: ah yeah, eval.in still broken. but don't know why it failed to recognize it as a command before. that's new and weird.
[21:36:09] apeiros: because it did see the message.
[21:36:43] graphene: has joined #ruby
[21:36:48] apeiros: well, my 3 month work timeout is soon-ish. will devote a few days for bot & website updates.
[21:37:42] schneider: has joined #ruby
[21:38:18] tdy: has joined #ruby
[21:47:03] schneider: has joined #ruby
[21:56:20] schneider: has joined #ruby
[22:05:37] schneider: has joined #ruby
[22:14:01] VeryBewitching: has joined #ruby
[22:14:50] schneider: has joined #ruby
[22:19:26] elphe: has joined #ruby
[22:23:07] mroutis: has joined #ruby
[22:24:08] schneider: has joined #ruby
[22:27:43] StuckMojo: has joined #ruby
[22:29:33] StuckMojo: hi. i've got a rakefile that's causing rake to bail immediately with "Don't know how to build task 'coverage'" and the only mention of "coverage" in it is: Rake::Task[:coverage].clear along with a comment about rcov not working. am i reading that right (zero ruby experince) as being a line that's supposed to *remove* the coverage task?
[22:30:15] StuckMojo: this is in a custom puppet module btw, if that matters at all
[22:33:26] schneider: has joined #ruby
[22:39:15] agent_white: has joined #ruby
[22:42:43] schneider: has joined #ruby
[22:44:13] dr3wo: has joined #ruby
[22:51:59] schneider: has joined #ruby
[22:58:29] StuckMojo: nevermind, it was the version or rspec
[22:58:42] StuckMojo: has left #ruby: ()
[23:00:11] nertzy: has joined #ruby
[23:00:20] apeiros: has joined #ruby
[23:01:04] tAn: has joined #ruby
[23:01:18] schneider: has joined #ruby
[23:03:01] bkxd: has joined #ruby
[23:10:33] schneider: has joined #ruby
[23:19:50] schneider: has joined #ruby
[23:29:05] schneider: has joined #ruby
[23:36:20] DTZUZO: has joined #ruby
[23:38:25] schneider: has joined #ruby
[23:38:54] tAn: has joined #ruby
[23:47:39] schneider: has joined #ruby
[23:56:54] schneider: has joined #ruby