« Back to channel list

#ruby - 27 February 2019

« Back 1 day Forward 1 day »
[00:13:09] Rudd0: has joined #ruby
[00:17:37] matti: has joined #ruby
[00:18:10] jane_booty_doe: has joined #ruby
[00:22:27] orbyt_: has joined #ruby
[00:57:09] Caerus: has joined #ruby
[01:04:50] orbyt_: has joined #ruby
[01:10:07] zapata: has joined #ruby
[01:16:31] mangold: has joined #ruby
[01:29:15] conta: has joined #ruby
[01:30:05] xco: has joined #ruby
[01:30:22] xco: i’m creating an array of a particular random string
[01:30:26] xco: is there a better way to do this?
[01:30:33] xco: sample_space = ('A'..'Z').to_a + ('a'..'z').to_a + (0..9).to_a
[01:31:15] xco: in short i just want alphnumeric characters
[01:32:35] havenwood: xco: That's pretty much right. I'd just suggest reducing the number of method calls:
[01:32:37] havenwood: [*'a'..'z', *'A'..'Z', *'0'..'9']
[01:32:54] xco: ah cool! :)
[01:32:56] xco: havenwood: thanks
[01:33:47] xco: * is the splat operator right
[01:33:54] havenwood: yes, splat like a bug
[01:34:24] xco: havenwood: so in doing this *’a’..’z’ you’re changing a range to an array?
[01:34:32] xco: i think i messed up
[01:34:32] havenwood: I like that the lonely person operator is someone sitting crosslegged staring at a dot: &.
[01:34:50] havenwood: &>> [*'a'..'z', *'A'..'Z', *'0'..'9']
[01:34:55] rubydoc: stderr: playpen: timeout triggered! (https://carc.in/#/r/6dh3)
[01:35:12] havenwood: xco: It expands the Range into Array elements.
[01:36:01] houhoulis: has joined #ruby
[01:36:07] havenwood: [*0..3] #=> [0, 1, 2, 3]
[01:40:48] xco: havenwood: yeap got it thanks :)
[01:48:14] phaul: never seen carc.in timing out like that before
[01:48:39] ramfjord: has joined #ruby
[01:49:21] phaul: &>> :test.to_s
[01:49:23] rubydoc: # => "test" (https://carc.in/#/r/6dh4)
[01:57:44] fluxAeon: has joined #ruby
[02:03:50] eb0t: has joined #ruby
[02:08:33] crankharder: has joined #ruby
[02:28:58] cow[moo]: has joined #ruby
[02:43:34] sleetdrop: has joined #ruby
[03:16:19] rubydoc: has joined #ruby
[03:17:10] phaul: has joined #ruby
[03:33:43] t0xik: has joined #ruby
[03:36:40] sagax: has joined #ruby
[03:43:36] CrazyEddy: has joined #ruby
[03:47:09] fluxAeon: has joined #ruby
[03:58:20] Xeago_: has joined #ruby
[04:02:15] wolfshappen: has joined #ruby
[04:08:30] powerbit: has joined #ruby
[04:09:37] braincrash: has joined #ruby
[04:13:56] Xeago: has joined #ruby
[04:30:45] Swyper: has joined #ruby
[04:38:38] T3RM1N41: has joined #ruby
[04:41:03] tdy1: has joined #ruby
[04:47:55] cagomez: has joined #ruby
[05:05:44] ansraliant: has joined #ruby
[05:10:03] ansraliant: has joined #ruby
[05:12:45] \void: has joined #ruby
[05:15:23] mikecmpb_: has joined #ruby
[05:20:52] T3RM1N41: has joined #ruby
[06:07:25] reber: has joined #ruby
[06:07:51] reber__: has joined #ruby
[06:15:11] _whitelogger: has joined #ruby
[06:17:13] akemot: has joined #ruby
[06:24:43] akemot: has joined #ruby
[06:28:20] conta: has joined #ruby
[06:39:21] rippa: has joined #ruby
[06:40:58] TvL2386: has joined #ruby
[06:50:01] Swyper: has joined #ruby
[06:50:24] sauvin: has joined #ruby
[06:52:06] aupadhye: has joined #ruby
[06:56:09] Swyper: has joined #ruby
[06:59:44] am0123_: has joined #ruby
[07:00:03] prestorium: has joined #ruby
[07:00:28] ramfjord: has joined #ruby
[07:10:08] maufart__: has joined #ruby
[07:37:01] jordanm: has joined #ruby
[07:55:58] laaron: has joined #ruby
[08:07:14] blackmesa: has joined #ruby
[08:09:51] nwradio: has joined #ruby
[08:16:52] laaron-: has joined #ruby
[08:17:37] rafadc_: has joined #ruby
[08:17:41] clemens3_: has joined #ruby
[08:30:29] blackmesa: has joined #ruby
[08:36:16] laaron: has joined #ruby
[08:42:49] alem0lars: has joined #ruby
[08:45:38] alem0lars: has joined #ruby
[08:49:54] jmcgnh: has joined #ruby
[08:53:57] dante: has joined #ruby
[08:57:49] jinie: has joined #ruby
[08:59:04] mangold: has joined #ruby
[09:00:57] dante: has joined #ruby
[09:04:06] AJA4350: has joined #ruby
[09:06:44] laaron: has joined #ruby
[09:07:26] fox_mulder_cp: has joined #ruby
[09:11:23] fox_mulder_cp: hi, folks. i try to create a DNS control gem, which operated of three of four items - Server, DnsZone, RRSet, Record. how i can write proper code, where initialized server passed to zone, and some from zone passed to rrset for operations?
[09:14:24] fox_mulder_cp: for some like zonelist = Server.new(ip,login,pass).zones; rrset = RRSet.new(name, content); zone = Server.new(ip,login,pass).zone.create(name, nsservers, rrset);
[09:15:31] stooj: has joined #ruby
[09:16:24] fox_mulder_cp: i need a help with basic classes skeletone
[09:26:42] blackmesa: has joined #ruby
[09:45:31] conta: has joined #ruby
[10:02:32] wolfshappen_: has joined #ruby
[10:03:22] kapil____: has joined #ruby
[10:12:11] lxsameer: has joined #ruby
[10:14:06] Swyper: has joined #ruby
[10:20:18] Swyper: has joined #ruby
[10:33:13] blackmesa: has joined #ruby
[10:35:20] mangold: has joined #ruby
[10:36:49] laaron: has joined #ruby
[10:37:33] mangold: has joined #ruby
[10:45:59] alem0lars: has joined #ruby
[10:59:15] akemot: has joined #ruby
[11:03:26] mikecmpbll: has joined #ruby
[11:10:42] conta: has joined #ruby
[11:15:19] lucasb: has joined #ruby
[11:29:44] Sembei: has joined #ruby
[11:30:05] beefjoe: has joined #ruby
[11:34:20] v01d4lph4: has joined #ruby
[11:44:50] jyaworski: has joined #ruby
[11:57:17] maufart__: has joined #ruby
[11:57:35] jyaworski: has joined #ruby
[11:58:02] sagax: has joined #ruby
[11:59:11] dinfuehr: has joined #ruby
[12:06:39] mangold: has joined #ruby
[12:22:54] v01d4lph4: has joined #ruby
[12:31:33] xrexeon: has joined #ruby
[12:52:59] am0123_: has joined #ruby
[13:03:57] houhoulis: has joined #ruby
[13:07:09] ua: has joined #ruby
[13:23:01] v01d4lph4: has joined #ruby
[13:25:24] ua: has joined #ruby
[13:30:18] conta1: has joined #ruby
[13:32:55] beefjoe: has joined #ruby
[13:42:44] bmurt: has joined #ruby
[14:01:38] mikecmpbll: has joined #ruby
[14:10:49] kspencer: has joined #ruby
[14:17:24] towo: has joined #ruby
[14:26:27] akem: has joined #ruby
[14:27:35] Rapture: has joined #ruby
[14:28:16] jinie: has joined #ruby
[14:31:41] alem0lars: has joined #ruby
[14:47:14] jyaworski: has joined #ruby
[14:56:37] laaron: has joined #ruby
[15:01:18] ramfjord: has joined #ruby
[15:09:11] nowhere_man: has joined #ruby
[15:14:33] Onwarion: has joined #ruby
[15:14:57] blackmesa: has joined #ruby
[15:16:38] beefjoe: has joined #ruby
[15:16:53] noboruma: has joined #ruby
[15:17:46] noboruma: has joined #ruby
[15:19:24] noboruma: has joined #ruby
[15:20:46] polishdub: has joined #ruby
[15:21:20] clickbai1: has joined #ruby
[15:21:21] rubydoc: has joined #ruby
[15:21:39] clickbai1: has joined #ruby
[15:21:42] phaul: has joined #ruby
[15:30:18] Fusl: has joined #ruby
[15:41:51] SeepingN: has joined #ruby
[15:43:44] gnufied: has joined #ruby
[15:45:54] xrexeon: has joined #ruby
[15:46:13] akem: has joined #ruby
[15:48:49] xrexeon: has joined #ruby
[15:54:44] blackmesa1: has joined #ruby
[15:55:54] orbyt_: has joined #ruby
[15:56:05] jcarl43: has joined #ruby
[15:58:19] mangold: has joined #ruby
[16:02:49] wolfshappen: has joined #ruby
[16:03:26] blackmesa1: has joined #ruby
[16:04:25] laaron: has joined #ruby
[16:19:38] mikecmpbll: has joined #ruby
[16:26:19] tacoboy: has joined #ruby
[16:27:18] mikecmpbll: has joined #ruby
[16:30:53] tdy1: has joined #ruby
[16:31:12] am0123_: has joined #ruby
[16:31:24] agent_white: has joined #ruby
[16:35:03] KeyJoo: has joined #ruby
[16:51:34] ivanskie: has joined #ruby
[16:55:01] \void: has joined #ruby
[17:06:34] t0xik: has joined #ruby
[17:06:44] blackmesa1: has joined #ruby
[17:17:06] Dbugger: has joined #ruby
[17:31:59] cthulchu: has joined #ruby
[17:37:17] orbyt_: has joined #ruby
[17:43:42] gnufied: has joined #ruby
[17:45:20] \void: has joined #ruby
[17:45:30] blackmesa: has joined #ruby
[17:45:40] orbyt_: has joined #ruby
[17:45:41] [Butch]: has joined #ruby
[17:46:42] fribmendes: has joined #ruby
[17:49:57] AJA4350: has joined #ruby
[17:51:46] jyaworski: has joined #ruby
[18:20:36] sameerynho: has joined #ruby
[18:21:11] akem: has joined #ruby
[18:29:16] xrexeon: has joined #ruby
[18:32:57] gix: has joined #ruby
[18:34:57] Fusl: has joined #ruby
[18:44:06] Renich: has joined #ruby
[18:46:55] segy: has joined #ruby
[18:50:14] am0123_: has joined #ruby
[18:50:28] Renich_: has joined #ruby
[18:51:51] moei: has joined #ruby
[18:59:41] akem: has joined #ruby
[18:59:56] ramfjord: has joined #ruby
[19:02:46] cnsvc_: has joined #ruby
[19:04:25] am0123_: has joined #ruby
[19:12:25] mikecmpbll: has joined #ruby
[19:18:18] Renich_: has joined #ruby
[19:30:54] cd: has joined #ruby
[19:33:58] cagomez: has joined #ruby
[19:51:52] orbyt_: has joined #ruby
[19:58:03] jyaworski: has joined #ruby
[20:09:55] ur5us: has joined #ruby
[20:11:07] oncall-pokemon: has joined #ruby
[20:13:24] am0123_: has joined #ruby
[20:14:55] barg: has joined #ruby
[20:15:02] barg: does anybody use byebug over pre-byebug, if so, why?
[20:23:04] tdy2: has joined #ruby
[20:24:00] laaron: has joined #ruby
[20:44:20] orbyt_: has joined #ruby
[20:44:31] evdubs: has joined #ruby
[20:46:12] thinkpad: has joined #ruby
[20:53:16] bmurt: has joined #ruby
[20:54:28] prestorium: has joined #ruby
[21:04:37] Boubert: has joined #ruby
[21:13:59] tdy2: has joined #ruby
[21:33:21] Fernando-Basso: has joined #ruby
[21:42:15] Eiam: pry byebug
[21:51:08] ramfjord: Alright I got a good one for you guys. Trying to dynamically create a class with a proc/lambda which uses functions from an included module inlcuded in the newly generated class. Think it will be easier to just show: https://gist.github.com/ramfjord/0142e2b27e0e065f9d14815c9591fbd2
[21:51:23] ramfjord: anyone know a reasonable way to do this?
[21:51:55] nwradio: has joined #ruby
[21:54:01] dinfuehr: has joined #ruby
[22:00:57] orbyt_: has joined #ruby
[22:02:07] wolfshappen_: has joined #ruby
[22:12:17] orbyt_: has joined #ruby
[22:18:49] nadir: has joined #ruby
[22:24:40] t0xik: has joined #ruby
[22:25:11] Radar: ramfjord: to do what?
[22:25:26] Radar: Oh I missed a line
[22:25:36] havenwood: ramfjord: I commented on your gist with an example showing prepending a module.
[22:26:00] hahuang65: has joined #ruby
[22:31:35] Net: I'm golfing, can I avoid the assignment in `foo = bar.baz; foo.nil? ? false : foo`?
[22:32:33] Renich: has joined #ruby
[22:33:21] my1es: has joined #ruby
[22:35:36] havenwood: Net: You might need to show us that one in context. It seems from what you've shown that you just have: bar.baz
[22:36:13] havenwood: Net: Do you really need an explicit `false`? If `bar.baz #=> nil`, it's already falsey.
[22:47:27] leftylink: while it would be possible to do `x|!0` to change nil to false, I would find it more likely that it's not necessary to change nil to false
[22:54:35] hahuang65: has joined #ruby
[22:55:47] Net: havenwood: right, realized I can just do !!bar.baz
[22:56:00] havenwood: Net: or just: bar.baz
[22:56:16] havenwood: Net: `nil` and `false` are the only two falsey things
[22:56:18] Net: havenwood: I'd rather have a boolean than rely on falseyness
[22:56:31] havenwood: Net: then a double bang indeed suffices
[22:57:04] Net: leftylink's looks fancy, but not sure what it's doing
[23:02:08] leftylink: !0 is false, that's all there is to it
[23:02:48] leftylink: golfing, so it's better to write `false` in as few chars as possible... but then I realised that !!x is one char less than x|!0
[23:03:40] blackmesa: has joined #ruby
[23:04:59] leftylink: in the same vein, one wants to write `p` instead of `nil` and `!p` instead of `true`
[23:05:03] Azure|dc: has joined #ruby
[23:05:52] Net: I see, bitwise or with special handling for nil
[23:11:02] leftylink: ... whoops, which also made me realise it doesn't work if x is possibly a number, since then it will do something for `|` (bitwise or) that I didn't want it to do
[23:12:57] jyaworski: has joined #ruby
[23:13:36] leftylink: ... so yeah another reason why !! is the better
[23:38:32] ellcs: has joined #ruby
[23:50:50] AJA4350: has joined #ruby
[23:55:05] tylerc: has joined #ruby