« Back to channel list

#ruby - 06 May 2019

« Back 1 day Forward 1 day »
[00:03:58] jottr: has joined #ruby
[00:06:43] apparition: has joined #ruby
[00:06:58] lel: has joined #ruby
[00:14:12] jottr: has joined #ruby
[00:17:46] batcat84: has joined #ruby
[00:17:54] batcat84: al2o3-cr: I was able to upgrade to Ruby 2.6.3 so I think it worked.
[00:20:59] al2o3-cr: batcat84: great!
[00:21:40] al2o3-cr: you can prepend the path but i feel this is the best way.
[00:21:50] Inside: has joined #ruby
[00:21:53] Inside: ACTION sighs
[00:22:13] Inside: Why do you not have a scientific plotting library that can plot tents of thousands of points in real time :'(
[00:24:25] jottr: has joined #ruby
[00:34:37] jottr: has joined #ruby
[00:35:46] Liothen-: has joined #ruby
[00:36:23] Liothen-: has joined #ruby
[00:38:26] Liothen: has joined #ruby
[00:44:51] jottr: has joined #ruby
[00:50:00] zxq2: has joined #ruby
[00:52:48] nowhereman: has joined #ruby
[00:54:44] nowhereman: has joined #ruby
[00:55:05] jottr: has joined #ruby
[01:00:52] dsmythe: has joined #ruby
[01:07:36] beeshk: has joined #ruby
[01:12:10] jottr: has joined #ruby
[01:18:31] Swyper: has joined #ruby
[01:21:49] ramfjord: has joined #ruby
[01:22:22] jottr: has joined #ruby
[01:32:35] jottr: has joined #ruby
[01:42:48] jottr: has joined #ruby
[01:53:02] jottr: has joined #ruby
[01:56:41] houhoulis: has joined #ruby
[01:58:02] dar123: has joined #ruby
[02:00:59] fphilipe_: has joined #ruby
[02:03:15] jottr: has joined #ruby
[02:10:35] Swyper: has joined #ruby
[02:13:27] jottr: has joined #ruby
[02:18:40] skyikot: has joined #ruby
[02:19:14] suryc: has joined #ruby
[02:23:41] jottr: has joined #ruby
[02:30:14] jaequery: has joined #ruby
[02:33:51] djdduty: has joined #ruby
[02:33:54] jottr: has joined #ruby
[02:44:07] jottr: has joined #ruby
[02:54:20] jottr: has joined #ruby
[03:04:31] jottr: has joined #ruby
[03:09:06] braincrash: has joined #ruby
[03:10:48] jaequery: has joined #ruby
[03:12:09] laaron: has joined #ruby
[03:14:45] jottr: has joined #ruby
[03:24:57] jottr: has joined #ruby
[03:28:58] ramfjord: has joined #ruby
[03:35:10] jottr: has joined #ruby
[03:45:23] jottr: has joined #ruby
[03:55:36] jottr: has joined #ruby
[03:58:48] dsmythe: has joined #ruby
[04:00:26] ramfjord: has joined #ruby
[04:05:50] jottr: has joined #ruby
[04:16:04] jottr: has joined #ruby
[04:25:44] laaron: has joined #ruby
[04:26:18] jottr: has joined #ruby
[04:30:01] fphilipe_: has joined #ruby
[04:34:20] endemic: has joined #ruby
[04:40:38] Tharbakim: has joined #ruby
[04:40:38] Tharbakim: has joined #ruby
[04:44:48] jottr: has joined #ruby
[04:45:14] sonivi: has joined #ruby
[04:48:27] ur5us: has joined #ruby
[04:55:00] jottr: has joined #ruby
[04:56:31] jenrzzz: has joined #ruby
[05:02:27] dellavg_: has joined #ruby
[05:05:12] jottr: has joined #ruby
[05:05:43] hightower2: has joined #ruby
[05:09:49] pwnd_nsfw: has joined #ruby
[05:15:24] jottr: has joined #ruby
[05:20:44] conta: has joined #ruby
[05:25:39] jottr: has joined #ruby
[05:33:45] jenrzzz: has joined #ruby
[05:35:50] jottr: has joined #ruby
[05:46:05] jottr: has joined #ruby
[05:46:59] Dbugger: has joined #ruby
[05:56:18] jottr: has joined #ruby
[06:08:49] localhostdotdev: has joined #ruby
[06:10:00] blackmesa: has joined #ruby
[06:13:01] localhostdotdev: has left #ruby: ()
[06:20:45] LinuxKnight: has joined #ruby
[06:26:15] jottr: has joined #ruby
[06:29:50] jenrzzz: has joined #ruby
[06:30:38] aupadhye: has joined #ruby
[06:30:57] fphilipe_: has joined #ruby
[06:37:35] djdduty: has joined #ruby
[06:44:30] mikecmpbll: has joined #ruby
[06:49:38] hightower2: has joined #ruby
[06:52:38] Swyper: has joined #ruby
[06:53:06] conta1: has joined #ruby
[06:53:09] fphilipe_: has joined #ruby
[07:05:36] clemens3: has joined #ruby
[07:09:01] dsmythe: has joined #ruby
[07:10:40] akosednar: has joined #ruby
[07:10:40] akosednar: has joined #ruby
[07:19:22] jottr: has joined #ruby
[07:21:24] al2o3-cr: &>> class String alias | unpack1 end; "TW9ybmluZw==" | 'm0'
[07:21:30] rubydoc: # => "Morning" (https://carc.in/#/r/6up2)
[07:23:32] al2o3-cr: what a day to be alive!
[07:27:12] jefffrails35: has joined #ruby
[07:29:35] jottr: has joined #ruby
[07:32:55] jenrzzz: has joined #ruby
[07:33:18] cgfbee: has joined #ruby
[07:37:34] vondruch: has joined #ruby
[07:38:49] kyrylo: has joined #ruby
[07:39:48] jottr: has joined #ruby
[07:45:00] ellcs: has joined #ruby
[07:47:21] wildermind: has joined #ruby
[07:48:37] Axsuul: has joined #ruby
[07:50:00] jottr: has joined #ruby
[07:56:26] nowhereman: has joined #ruby
[08:00:14] jottr: has joined #ruby
[08:00:54] ramfjord: has joined #ruby
[08:10:27] jottr: has joined #ruby
[08:19:09] chaus: has joined #ruby
[08:19:34] papcx82: has joined #ruby
[08:20:40] jottr: has joined #ruby
[08:30:55] jottr: has joined #ruby
[08:31:47] vondruch: has joined #ruby
[08:33:30] balo: i wouldn't be able to tell what is this doing ^^
[08:34:26] papcx82: has joined #ruby
[08:37:45] jenrzzz: has joined #ruby
[08:38:53] ur5us: has joined #ruby
[08:41:07] jottr: has joined #ruby
[08:45:17] rafadc: has joined #ruby
[08:47:25] laaron: has joined #ruby
[08:51:19] jottr: has joined #ruby
[08:54:25] Swyper: has joined #ruby
[09:01:32] jottr: has joined #ruby
[09:04:27] iMadper: has joined #ruby
[09:11:44] jottr: has joined #ruby
[09:19:22] chaus: has joined #ruby
[09:20:47] ur5us: has joined #ruby
[09:21:57] jottr: has joined #ruby
[09:26:42] Mike11: has joined #ruby
[09:27:52] arthurwozniak: has joined #ruby
[09:32:11] jottr: has joined #ruby
[09:37:23] canton7: has joined #ruby
[09:39:08] jenrzzz: has joined #ruby
[09:42:25] jottr: has joined #ruby
[09:50:28] chaus: has joined #ruby
[09:52:37] jottr: has joined #ruby
[09:54:49] canton7: has joined #ruby
[10:00:43] chaus: has joined #ruby
[10:01:06] ramfjord: has joined #ruby
[10:02:52] jottr: has joined #ruby
[10:05:02] tdy: has joined #ruby
[10:12:40] chaus: has joined #ruby
[10:13:04] jottr: has joined #ruby
[10:23:16] jottr: has joined #ruby
[10:31:39] Emmanuel_Chanel: has joined #ruby
[10:33:29] jottr: has joined #ruby
[10:35:46] queip: has joined #ruby
[10:39:39] jenrzzz: has joined #ruby
[10:40:31] AJA4350: has joined #ruby
[10:41:22] beeshk: has joined #ruby
[10:43:42] jottr: has joined #ruby
[10:48:42] jefffrails35: has joined #ruby
[10:51:52] gdrc: has joined #ruby
[10:53:04] gdrc: hello, ruby newbie here. is there a framework/library that reads input from different sources using the chain of responsibility pattern?
[10:53:56] jottr: has joined #ruby
[10:55:01] gdrc: just to explain, i'm writing a command line tool where the input could be read as 1. parameter in the shell 2. environmental variable 3. from a YAML file
[10:55:14] conta: has joined #ruby
[11:04:09] jottr: has joined #ruby
[11:10:08] kyrylo: has joined #ruby
[11:12:48] jmcgnh: has joined #ruby
[11:14:20] reber: has joined #ruby
[11:14:24] jottr: has joined #ruby
[11:24:35] jottr: has joined #ruby
[11:27:51] mikecmpbll: has joined #ruby
[11:34:47] jottr: has joined #ruby
[11:39:32] ldnunes: has joined #ruby
[11:39:43] chaus: has joined #ruby
[11:42:13] Swyper: has joined #ruby
[11:43:32] Ai9zO5AP: has joined #ruby
[11:45:01] jottr: has joined #ruby
[11:46:36] chaus: has joined #ruby
[11:49:28] jenrzzz: has joined #ruby
[11:55:15] jottr: has joined #ruby
[11:55:31] Swyper: has joined #ruby
[11:59:28] Swyper: has joined #ruby
[12:05:27] jottr: has joined #ruby
[12:15:41] jottr: has joined #ruby
[12:19:56] ebbflowgo: has joined #ruby
[12:25:53] jottr: has joined #ruby
[12:36:07] jottr: has joined #ruby
[12:46:25] chaus: has joined #ruby
[12:46:27] jottr: has joined #ruby
[12:51:46] jcalla: has joined #ruby
[12:55:16] jenrzzz: has joined #ruby
[12:56:12] tdy: has joined #ruby
[12:56:32] jottr: has joined #ruby
[12:59:21] cthulchu: has joined #ruby
[13:00:35] cd: has joined #ruby
[13:03:12] dsmythe: has joined #ruby
[13:05:23] cthu|: has joined #ruby
[13:06:48] jottr: has joined #ruby
[13:08:43] djdduty: has joined #ruby
[13:16:59] jottr: has joined #ruby
[13:27:14] jottr: has joined #ruby
[13:32:45] Tempesta: has joined #ruby
[13:32:45] Tempesta: has joined #ruby
[13:33:52] laaron: has joined #ruby
[13:37:26] jottr: has joined #ruby
[13:46:51] pupsikov: has joined #ruby
[13:47:39] jottr: has joined #ruby
[13:52:54] chaus: has joined #ruby
[13:53:48] SeepingN: has joined #ruby
[13:57:56] jottr: has joined #ruby
[13:59:33] jenrzzz: has joined #ruby
[14:00:33] lucasb: has joined #ruby
[14:01:25] gnufied: has joined #ruby
[14:08:06] jottr: has joined #ruby
[14:18:17] jottr: has joined #ruby
[14:22:12] Inline: has joined #ruby
[14:25:31] spacesuitdiver: has joined #ruby
[14:28:05] hightower2: has joined #ruby
[14:28:31] jottr: has joined #ruby
[14:34:21] chaus: has joined #ruby
[14:35:18] moei: has joined #ruby
[14:38:46] jottr: has joined #ruby
[14:45:52] cthulchu_: has joined #ruby
[14:47:05] kapil____: has joined #ruby
[14:48:57] jottr: has joined #ruby
[14:51:56] Rudd0: has joined #ruby
[14:54:43] jaequery: has joined #ruby
[14:55:50] spacesuitdiver: has joined #ruby
[15:01:11] spacesuitdiver: has joined #ruby
[15:01:40] houhoulis: has joined #ruby
[15:05:05] havenwood: gdrc: OptionParser with ENV and Psych!
[15:07:02] jottr: has joined #ruby
[15:07:20] jenrzzz: has joined #ruby
[15:11:15] depesz: hi. is there any simple way to split array into array of arrays with up to N elements?
[15:11:26] depesz: i can write a loop, but perhaps there is some idiomatic way to do it
[15:11:47] Dbugger: has joined #ruby
[15:11:51] tdy: has joined #ruby
[15:12:56] adam12: depesz: Enumerable#each_slice is likely what you're looking for.
[15:13:11] depesz: adam12: yes, it is. thanks a lot.
[15:17:16] jottr: has joined #ruby
[15:23:22] jmcgnh: has joined #ruby
[15:25:00] polishdub: has joined #ruby
[15:27:47] jottr: has joined #ruby
[15:29:18] m27frogy: has joined #ruby
[15:36:49] agent_white: has joined #ruby
[15:41:02] GodFather: has joined #ruby
[15:44:47] jottr: has joined #ruby
[15:44:48] duderonomy: has joined #ruby
[15:48:51] rippa: has joined #ruby
[15:51:44] orbyt_: has joined #ruby
[15:54:58] jottr: has joined #ruby
[16:02:47] jmcgnh: has joined #ruby
[16:05:10] jottr: has joined #ruby
[16:10:24] rhuang: has joined #ruby
[16:11:15] chaus: has joined #ruby
[16:13:39] haengma: has joined #ruby
[16:14:13] conta: has joined #ruby
[16:15:22] m_antis: has joined #ruby
[16:15:24] jottr: has joined #ruby
[16:17:05] jenrzzz: has joined #ruby
[16:20:08] m_antis_: has joined #ruby
[16:22:35] m27frogy: has joined #ruby
[16:25:37] jottr: has joined #ruby
[16:25:44] m_antis: has joined #ruby
[16:29:49] m_antis: has joined #ruby
[16:31:15] planigan: has joined #ruby
[16:33:23] jefffrails35: has joined #ruby
[16:33:47] hightower2: has joined #ruby
[16:35:34] scientes: has joined #ruby
[16:35:39] scientes: how do i get EVERY regexp match?
[16:35:50] jottr: has joined #ruby
[16:35:51] scientes: there is no .each or .match_all et cetera
[16:36:15] fphilipe_: has joined #ruby
[16:36:26] havenwood: scientes: #scan
[16:36:35] havenwood: scientes: or the match return value includes all matches
[16:46:04] jottr: has joined #ruby
[16:46:17] nowhereman: has joined #ruby
[16:48:37] eckhardt: has joined #ruby
[16:53:59] m_antis_: has joined #ruby
[16:54:11] duderonomy: has joined #ruby
[16:54:28] fphilipe_: has joined #ruby
[16:56:17] jottr: has joined #ruby
[17:02:36] rhuang: has joined #ruby
[17:03:14] pupsikov: has joined #ruby
[17:05:30] jenrzzz: has joined #ruby
[17:06:29] jottr: has joined #ruby
[17:10:28] havenwood: all captures*
[17:11:50] havenwood: scientes: do you mean overlapping matches, or just consecutive matches?
[17:11:58] scientes: consecuritve
[17:12:01] scientes: it worked, thanks
[17:12:01] havenwood: &>> 'abcd'.scan /../
[17:12:03] rubydoc: # => ["ab", "cd"] (https://carc.in/#/r/6uvf)
[17:15:08] clemens3: has joined #ruby
[17:16:42] jottr: has joined #ruby
[17:16:59] havenwood: &>> s = 'abcde'; pattern = /../; 1.upto(s.size).flat_map { |n| s.each_char.each_cons(n).map { |chars| chars.join.match(pattern)&.to_s } }.compact.uniq
[17:17:00] rubydoc: # => ["ab", "bc", "cd", "de"] (https://carc.in/#/r/6uvh)
[17:17:41] chaus: has joined #ruby
[17:21:44] jenrzzz: has joined #ruby
[17:26:58] jottr: has joined #ruby
[17:27:01] ramfjord: has joined #ruby
[17:27:58] chaus: has joined #ruby
[17:28:11] abaiste^: has joined #ruby
[17:34:55] r29v: has joined #ruby
[17:35:16] AJA4350: has joined #ruby
[17:37:09] jottr: has joined #ruby
[17:38:22] jefffrails35: has joined #ruby
[17:40:41] baweaver: &>> 'abcde'.chars.each_cons(2).to_a.map(&:join)
[17:40:42] rubydoc: # => ["ab", "bc", "cd", "de"] (https://carc.in/#/r/6uvj)
[17:47:23] jottr: has joined #ruby
[17:52:11] SuperL4g: has joined #ruby
[17:57:09] SuperLag: has joined #ruby
[18:00:05] postmodern: has joined #ruby
[18:00:15] r29v: has joined #ruby
[18:01:10] jmcgnh: has joined #ruby
[18:01:29] jenrzzz: has joined #ruby
[18:03:25] OneNeptune: has joined #ruby
[18:05:21] jottr: has joined #ruby
[18:11:55] fphilipe_: has joined #ruby
[18:15:36] jottr: has joined #ruby
[18:25:49] jottr: has joined #ruby
[18:33:51] yokel: has joined #ruby
[18:35:00] cthu|: has joined #ruby
[18:36:02] jottr: has joined #ruby
[18:43:40] yokel: has joined #ruby
[18:46:27] jottr: has joined #ruby
[18:47:34] ldnunes: has joined #ruby
[18:49:18] yokel: has joined #ruby
[18:53:38] tdy: has joined #ruby
[18:54:55] yokel: has joined #ruby
[19:00:08] yokel: has joined #ruby
[19:01:29] jottr: has joined #ruby
[19:04:44] AJA4350: has joined #ruby
[19:05:49] yokel: has joined #ruby
[19:06:47] jenrzzz: has joined #ruby
[19:07:28] laaron: has joined #ruby
[19:08:28] havenwood: baweaver: I guess that's a bad example regexp! :P
[19:09:29] havenwood: &>> s = 'aeibeiiacde'; pattern = /[aeiou]{1,3}/; 1.upto(s.size).flat_map { |n| s.each_char.each_cons(n).map { |chars| chars.join.match(pattern)&.to_s } }.compact.uniq
[19:09:31] rubydoc: # => ["a", "e", "i", "ae", "ei", "ii", "ia", "aei", "eii", "iia"] (https://carc.in/#/r/6uw1)
[19:09:37] maryo: has joined #ruby
[19:10:38] havenwood: i don't like the code anyway - pre-coffee rambling
[19:11:28] yokel: has joined #ruby
[19:11:35] jottr: has joined #ruby
[19:16:12] haengma: has joined #ruby
[19:17:07] yokel: has joined #ruby
[19:21:40] ramfjord_: has joined #ruby
[19:22:44] yokel: has joined #ruby
[19:25:20] brendan-: has joined #ruby
[19:26:55] jottr: has joined #ruby
[19:27:44] chaus: has joined #ruby
[19:30:27] Nicmavr: has joined #ruby
[19:31:59] Xiti`: has joined #ruby
[19:32:21] pwnd_nsfw`: has joined #ruby
[19:32:44] postmodern_: has joined #ruby
[19:33:10] kyrylo_: has joined #ruby
[19:33:33] Xeago_: has joined #ruby
[19:34:18] rafadc_: has joined #ruby
[19:34:22] Milos_: has joined #ruby
[19:35:05] Liothen-: has joined #ruby
[19:35:26] _whitelogger_: has joined #ruby
[19:37:13] jottr: has joined #ruby
[19:37:23] agent_wh1te: has joined #ruby
[19:37:24] polishdu1: has joined #ruby
[19:37:56] sh7d_: has joined #ruby
[19:38:29] sameerynho: has joined #ruby
[19:38:42] gix: has joined #ruby
[19:39:01] segy_: has joined #ruby
[19:39:13] Rudd0^: has joined #ruby
[19:39:14] SeepingN: has joined #ruby
[19:39:26] endemic: has joined #ruby
[19:39:29] yokel: has joined #ruby
[19:39:31] leah2_: has joined #ruby
[19:39:36] braincra-: has joined #ruby
[19:39:50] bga57: has joined #ruby
[19:39:52] djdduty: has joined #ruby
[19:40:01] Tharbakim: has joined #ruby
[19:40:01] Tharbakim: has joined #ruby
[19:42:35] haengma: has joined #ruby
[19:43:28] planigan: has joined #ruby
[19:45:32] Nicmavr: has joined #ruby
[19:47:25] jottr: has joined #ruby
[19:48:17] tdy: has joined #ruby
[19:49:15] joast: has joined #ruby
[19:53:18] fphilipe_: has joined #ruby
[19:55:31] spiette: has joined #ruby
[19:57:38] jottr: has joined #ruby
[19:59:30] fphilipe_: has joined #ruby
[20:06:59] hightower2: has joined #ruby
[20:11:09] yokel: has joined #ruby
[20:12:59] jenrzzz: has joined #ruby
[20:14:31] jottr: has joined #ruby
[20:17:05] sh7d: has joined #ruby
[20:17:54] ramfjord: has joined #ruby
[20:24:48] jottr: has joined #ruby
[20:25:06] fphilipe_: has joined #ruby
[20:32:35] jmcgnh: has joined #ruby
[20:35:01] jottr: has joined #ruby
[20:38:40] lucasb: has joined #ruby
[20:43:58] dsmythe: has joined #ruby
[20:45:13] jottr: has joined #ruby
[20:45:32] Nicmavr: has joined #ruby
[20:55:25] jottr: has joined #ruby
[20:58:25] OneNeptune: has joined #ruby
[21:02:19] nogic: has joined #ruby
[21:05:38] jottr: has joined #ruby
[21:12:09] Milos: has joined #ruby
[21:14:21] ur5us: has joined #ruby
[21:15:33] Kestrel-029: has joined #ruby
[21:15:53] jottr: has joined #ruby
[21:22:06] csr_: has joined #ruby
[21:23:34] code_zombie: has joined #ruby
[21:23:53] plujon: has joined #ruby
[21:26:06] jottr: has joined #ruby
[21:30:32] Nicmavr: has joined #ruby
[21:30:54] csr_: has left #ruby: ("Leaving")
[21:31:52] tdy: has joined #ruby
[21:36:17] jottr: has joined #ruby
[21:46:30] jottr: has joined #ruby
[21:56:03] fphilipe_: has joined #ruby
[21:56:08] jmcgnh: has joined #ruby
[21:56:30] SeepingN: has joined #ruby
[21:56:45] jottr: has joined #ruby
[21:59:59] tdy: has joined #ruby
[22:00:35] ruby[bot]: has joined #ruby
[22:00:35] ChanServ: +o ruby[bot]
[22:03:38] scientes: has joined #ruby
[22:06:57] jottr: has joined #ruby
[22:11:07] Fernando-Basso: has joined #ruby
[22:11:25] dsmythe_: has joined #ruby
[22:15:43] Eiam: has joined #ruby
[22:17:10] jottr: has joined #ruby
[22:17:54] SeepingN: has joined #ruby
[22:20:31] jmcgnh: has joined #ruby
[22:23:16] dsmythe: has joined #ruby
[22:26:07] jmcgnh: has joined #ruby
[22:26:29] hightower3: has joined #ruby
[22:27:23] jottr: has joined #ruby
[22:34:10] jmcgnh: has joined #ruby
[22:37:28] jenrzzz: has joined #ruby
[22:37:38] jottr: has joined #ruby
[22:42:24] adam12: I wonder what goodies RubyVM::AbstractSyntaxTree will eventually yield
[22:47:49] jottr: has joined #ruby
[22:48:39] jmcgnh: has joined #ruby
[22:49:17] tdy: has joined #ruby
[22:58:06] jottr: has joined #ruby
[22:59:06] jmcgnh: has joined #ruby
[22:59:20] lemoi: has joined #ruby
[22:59:41] lemoi: is there an easy way of achieving this: https://dpaste.de/VUHh
[23:01:35] bhaak: has joined #ruby
[23:01:51] OneNeptune: has joined #ruby
[23:02:00] lemoi: I'm basically trying to convert a yaml dictionary into cmdline arguments
[23:05:55] jmcgnh: has joined #ruby
[23:08:15] jottr: has joined #ruby
[23:08:36] jenrzzz: has joined #ruby
[23:09:32] jmcgnh: has joined #ruby
[23:14:41] ur5us: has joined #ruby
[23:15:20] jmcgnh: has joined #ruby
[23:15:33] Kestrel-029: has joined #ruby
[23:16:26] ramfjord: has joined #ruby
[23:18:30] jottr: has joined #ruby
[23:18:51] dviola: has joined #ruby
[23:19:44] neplushko: has joined #ruby
[23:22:36] adam12: lemoi: map and join.
[23:22:52] jmcgnh: has joined #ruby
[23:24:47] adam12: lemoi: https://gist.github.com/5cef2ccba58ec5c5743f17100c1675ec
[23:24:49] al2o3-cr: adam12: like this? {"-foo-bar"=>"xxx", "-bar-baz"=>"yyy"}.map { |cmd_args| cmd_args.join ' ' }
[23:25:06] al2o3-cr: that what i had in mind but wasn't sure
[23:25:09] ramfjord: has joined #ruby
[23:25:46] lemoi: adam12 works perfectly
[23:26:23] fphilipe_: has joined #ruby
[23:26:30] adam12: al2o3-cr: Might have worked? But I guess I'd call that map and join and join.
[23:26:57] tdy: has joined #ruby
[23:26:59] adam12: &>> {"-foo-bar" => "xxx", "-bar-baz" => "yyy"}.map {|*attr| attr.join(" ") }.join(" ")
[23:27:01] neplushko: hello, folks! i don't rly understand one moment. I've got a = []. and when I do a = (1..4).map {|x| a << x} my a becomes [[1,2,3,4], [1,2,3,4], [1,2,3,4], [1,2,3,4]]. can someone explain me this? thanks in advance
[23:27:01] rubydoc: # => "-foo-bar xxx -bar-baz yyy" (https://carc.in/#/r/6uxi)
[23:27:17] al2o3-cr: adam12: oh! i see what mean.
[23:28:43] jottr: has joined #ruby
[23:29:22] havenwood: neplushko: #map already implicitly builds a new collection from each iteration's return value. by manually also shoveling on, you're mutating `a`.
[23:29:33] adam12: neplushko: Not sure I follow exactly, but Arrays are passed by reference. You're mutating the same Array.
[23:29:50] havenwood: neplushko: The `a << x` changes `a`.
[23:30:35] adam12: &>> a = []; a = (1..4).map {|x| a << x }
[23:30:35] jmcgnh: has joined #ruby
[23:30:36] rubydoc: # => [[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]] (https://carc.in/#/r/6uxj)
[23:31:13] adam12: &>> [1] << 2
[23:31:14] rubydoc: # => [1, 2] (https://carc.in/#/r/6uxk)
[23:32:21] adam12: &>> a = [].freeze; a = (1..4).map {|x| a << x }
[23:32:22] rubydoc: stderr: -e:2:in `block in <main>': can't modify frozen Array (FrozenError) (https://carc.in/#/r/6uxl)
[23:32:40] neplushko: havenwood: so, if I got it in the right way, when I use 'a << x', #map returns [1,2,3,4] to #a four times?
[23:33:03] havenwood: neplushko: note the return value of each iterations is just whatever `a` is
[23:33:17] havenwood: neplushko: throughout the mapping, you add each digit to `a`
[23:33:33] havenwood: neplushko: by the end, you have: [a, a, a, a]
[23:33:51] havenwood: neplushko: and `a` is: [1, 2, 3, 4]
[23:34:46] havenwood: neplushko: you're mapping to a new array that is `a` 4 times, and in the process you're shoveling 1-4 onto `a`, which you see in the end
[23:34:53] adam12: neplushko: Are you just trying to understand what's happening or is this something your experiencing?
[23:35:24] al2o3-cr: &>> a = []; a << a
[23:35:25] rubydoc: # => [[...]] (https://carc.in/#/r/6uxm)
[23:35:31] neplushko: havenwood: ah, got it! thank you so much!
[23:35:40] al2o3-cr: them three dots indicate self reference
[23:35:41] neplushko: adam12: I'm trying to understand
[23:37:21] clemens3_: has joined #ruby
[23:37:23] phaul: &>> a = [1,2]; b = a; a << 3; b # there can be many variables pointing to the same object
[23:37:24] rubydoc: # => [1, 2, 3] (https://carc.in/#/r/6uxn)
[23:38:27] neplushko: many thanks to all of you!
[23:40:25] neplushko: I'm sorry if my question seemed too childish and stupid :p
[23:40:59] adam12: neplushko: Not at all. Mutation catches many experienced developers. It's good to understand.
[23:42:02] jmcgnh: has joined #ruby
[23:43:05] phaul: &>> a = Array.new(3, [1]) ; a[0] << 1; a
[23:43:06] rubydoc: # => [[1, 1], [1, 1], [1, 1]] (https://carc.in/#/r/6uxo)
[23:43:17] phaul: it can be tricky
[23:43:42] jottr: has joined #ruby
[23:44:15] neplushko: @adam12 well, anyway I have felt embarassed because this moment seemed a little bit tricky as for me and I couldn't understand why it happens in that way
[23:44:19] scientes: has joined #ruby
[23:47:01] GodFather: has joined #ruby
[23:47:19] havenwood: neplushko: it's understandably confusing
[23:48:18] havenwood: almost like a sleight of hand trick - you have to watch carefully to see the digits getting slipped under the cup into the array
[23:49:24] jmcgnh: has joined #ruby
[23:49:34] neplushko: havenwood: true, true
[23:50:29] havenwood: just published an article on Ruby 3 news from RubyKaigi: https://developer.squareup.com/blog/rubykaigi-and-the-path-to-ruby-3
[23:53:53] jottr: has joined #ruby
[23:55:29] adam12: havenwood: Nice.
[23:56:39] Nirvash: has joined #ruby
[23:56:46] adam12: havenwood: Did you see a talk on "Threadlets" at RubyKaigi? I dont' remember seeing one on the schedule.
[23:56:57] laaron: has joined #ruby
[23:57:07] abaiste^: has joined #ruby
[23:57:17] jmcgnh: has joined #ruby
[23:57:21] abaiste^: has joined #ruby
[23:57:36] abaiste^: has joined #ruby
[23:57:51] abaiste^: has joined #ruby
[23:58:05] abaiste^: has joined #ruby
[23:58:11] havenwood: adam12: You're right, it didn't have a discrete talk, but I gave it a shoutout because Matz and ioquatix both mentioned it in their talks.
[23:58:43] adam12: havenwood: No worries. I only saw references to it on the bug tracker and wondered if there was more going on that I wasn't aware of.
[23:58:57] Swyper: has joined #ruby
[23:59:38] Sp4rKy: has joined #ruby