« Back to channel list

#ruby - 23 July 2019

« Back 1 day Forward 1 day »
[00:01:08] yqt: has joined #ruby
[00:10:07] involans: has joined #ruby
[00:10:27] ramfjord: has joined #ruby
[00:10:43] ur5us: has joined #ruby
[00:10:52] skryking: has joined #ruby
[00:12:13] tdy: has joined #ruby
[00:17:07] ramfjord: has joined #ruby
[00:17:09] fphilipe: has joined #ruby
[00:21:48] tdy: has joined #ruby
[00:27:08] ramfjord: has joined #ruby
[00:27:39] Bounga: has joined #ruby
[00:28:48] BTRE: has joined #ruby
[00:31:42] Swyper: has joined #ruby
[00:36:20] Exuma: has joined #ruby
[00:47:30] DaRock: has joined #ruby
[00:50:07] jenrzzz: has joined #ruby
[00:54:38] sh7d: has joined #ruby
[00:58:15] involans: has joined #ruby
[01:00:59] yqt: has joined #ruby
[01:06:58] Swyper: has joined #ruby
[01:08:06] ramfjord: has joined #ruby
[01:16:52] gix-: has joined #ruby
[01:18:42] Bounga: has joined #ruby
[01:21:22] fphilipe: has joined #ruby
[01:32:12] s2013: has joined #ruby
[02:00:56] yqt: has joined #ruby
[02:15:59] morenoh11: has joined #ruby
[02:17:33] hhffppff: has joined #ruby
[02:32:02] havenwood: getting same number of fibers spun up now in the benchmark warmup phase as it used to be total :D
[02:32:26] havenwood: i like this new fiber pool
[02:37:01] ur5us: has joined #ruby
[02:44:27] ur5us: has joined #ruby
[02:53:16] sleetdrop: has joined #ruby
[02:55:55] comet23: has joined #ruby
[03:00:59] yqt: has joined #ruby
[03:05:15] oetjenj: has joined #ruby
[03:07:54] ramfjord: has joined #ruby
[03:10:14] morenoh11: has joined #ruby
[03:10:55] Bounga: has joined #ruby
[03:14:02] Mrgoose8: has joined #ruby
[03:15:46] jmcgnh: has joined #ruby
[03:16:38] Technodrome: has joined #ruby
[03:31:26] s2013: has joined #ruby
[03:35:58] kapilp: has joined #ruby
[03:39:55] davorb: has joined #ruby
[03:57:40] gix: has joined #ruby
[04:01:17] yqt: has joined #ruby
[04:04:22] morenoh11: has joined #ruby
[04:07:39] chalkmonster: has joined #ruby
[04:18:08] fphilipe: has joined #ruby
[04:30:05] englishm: has joined #ruby
[04:50:21] reed: has joined #ruby
[04:58:29] morenoh11: has joined #ruby
[05:00:59] yqt: has joined #ruby
[05:13:11] orbyt_: has joined #ruby
[05:22:12] conta: has joined #ruby
[05:24:50] ZAJDAN: has joined #ruby
[05:27:50] morenoh11: has joined #ruby
[05:28:21] esrse: has joined #ruby
[05:31:22] sauvin: has joined #ruby
[05:34:58] Exuma: has joined #ruby
[05:43:04] Furai: has joined #ruby
[05:44:44] Furai: has joined #ruby
[05:44:57] exmortus: has joined #ruby
[05:48:10] _whitelogger: has joined #ruby
[05:59:07] oetjenj: has joined #ruby
[06:01:00] yqt: has joined #ruby
[06:05:04] oetjenj: has joined #ruby
[06:05:44] oetjenj: has joined #ruby
[06:06:39] oetjenj: has joined #ruby
[06:07:16] oetjenj: has joined #ruby
[06:08:03] oetjenj: has joined #ruby
[06:08:18] s2013: has joined #ruby
[06:08:49] oetjenj: has joined #ruby
[06:09:33] oetjenj: has joined #ruby
[06:10:21] oetjenj: has joined #ruby
[06:11:09] oetjenj: has joined #ruby
[06:11:50] conta: has joined #ruby
[06:11:57] oetjenj: has joined #ruby
[06:12:41] oetjenj: has joined #ruby
[06:13:28] oetjenj: has joined #ruby
[06:14:11] oetjenj: has joined #ruby
[06:15:04] oetjenj: has joined #ruby
[06:15:46] oetjenj: has joined #ruby
[06:17:58] absolutejam4: has joined #ruby
[06:21:41] schne1der: has joined #ruby
[06:32:10] corellian: has joined #ruby
[06:39:49] snickers: has joined #ruby
[06:40:37] TomyWork: has joined #ruby
[06:42:52] oetjenj: has joined #ruby
[06:43:37] oetjenj: has joined #ruby
[06:44:23] oetjenj: has joined #ruby
[06:45:14] oetjenj: has joined #ruby
[06:45:59] oetjenj: has joined #ruby
[06:46:42] oetjenj: has joined #ruby
[06:47:28] oetjenj: has joined #ruby
[06:59:58] oetjenj: has joined #ruby
[07:01:00] yqt: has joined #ruby
[07:02:50] Exuma: has joined #ruby
[07:04:15] aupadhye: has joined #ruby
[07:05:14] Exuma: has joined #ruby
[07:05:17] andikr: has joined #ruby
[07:07:58] Exuma: has joined #ruby
[07:09:44] BH23: has joined #ruby
[07:11:00] wildermind: has joined #ruby
[07:11:23] Bounga: has joined #ruby
[07:17:03] AJA4350: has joined #ruby
[07:17:12] troulouliou_div2: has joined #ruby
[07:17:37] cats: has joined #ruby
[07:19:55] donofrio__: has joined #ruby
[07:21:17] cliluw: has joined #ruby
[07:22:03] Ropeney: has joined #ruby
[07:22:07] nirix: has joined #ruby
[07:22:10] Frobozz_: has joined #ruby
[07:22:35] AJA4350: has joined #ruby
[07:23:06] regent: has joined #ruby
[07:23:09] chunkypuffs: has joined #ruby
[07:23:30] andikr: has joined #ruby
[07:23:32] vondruch: has joined #ruby
[07:23:33] hays: has joined #ruby
[07:23:34] mcspud-: has joined #ruby
[07:24:17] guardian: has joined #ruby
[07:24:43] segy: has joined #ruby
[07:25:01] arooni: has joined #ruby
[07:26:31] teclator: has joined #ruby
[07:29:02] balo: has joined #ruby
[07:29:31] gigetoo: has joined #ruby
[07:31:41] jefffrails35: has joined #ruby
[07:31:42] absolutejam4: has joined #ruby
[07:36:56] tuor: has joined #ruby
[07:43:56] jmcgnh: has joined #ruby
[07:46:51] dionysus69: what would be a cool way to precampute default argument if not assigned based on another argument?
[07:47:28] dionysus69: let's say I have def method(collection: [obj1,obj2], model: collection.first.class)
[07:48:09] dionysus69: never seen anything like it in practice so I am little confused on how to approach it
[08:00:35] mikecmpbll: has joined #ruby
[08:00:59] yqt: has joined #ruby
[08:01:57] themsay: has joined #ruby
[08:02:25] fphilipe: has joined #ruby
[08:06:30] jinie: has joined #ruby
[08:11:18] lxsameer: has joined #ruby
[08:21:15] conta: has joined #ruby
[08:22:47] Bounga: has joined #ruby
[08:24:44] Technodrome: has joined #ruby
[08:29:37] Bounga`: has joined #ruby
[08:39:44] jenrzzz: has joined #ruby
[08:42:43] planigan: has joined #ruby
[08:45:24] ramfjord: has joined #ruby
[08:59:31] skryking: has joined #ruby
[09:01:15] yqt: has joined #ruby
[09:02:28] ur5us: has joined #ruby
[09:03:04] Sylario: has joined #ruby
[09:07:27] deepreds1: has joined #ruby
[09:17:42] tdy: has joined #ruby
[09:40:53] jmcgnh: has joined #ruby
[09:47:50] shtirlic: has joined #ruby
[09:57:37] conta: has joined #ruby
[10:00:34] schne1der: has joined #ruby
[10:00:58] yqt: has joined #ruby
[10:04:15] MatrixBridge: has joined #ruby
[10:04:17] MatrixBridge: has left #ruby: ("User left")
[10:17:56] chalkmon1: has joined #ruby
[10:19:59] conta: has joined #ruby
[10:23:48] morenoh11: has joined #ruby
[10:29:01] chalkmonster: has joined #ruby
[10:44:00] TheBrayn: has joined #ruby
[10:45:32] ramfjord: has joined #ruby
[10:49:21] exmortus: has joined #ruby
[10:52:07] IRC-Source_96: has joined #ruby
[10:55:43] TheBrayn: has joined #ruby
[10:57:55] conta: has joined #ruby
[11:03:35] absolutejam4: has joined #ruby
[11:10:49] vondruch_: has joined #ruby
[11:16:05] ellcs: has joined #ruby
[11:17:56] morenoh11: has joined #ruby
[11:29:05] aupadhye: has joined #ruby
[11:39:19] vondruch: has joined #ruby
[11:41:31] redlegion: has joined #ruby
[11:44:15] xco: has joined #ruby
[11:45:36] jenrzzz: has joined #ruby
[11:59:24] absolutejam4: has joined #ruby
[12:12:01] morenoh11: has joined #ruby
[12:15:25] griffindy: has joined #ruby
[12:18:47] conta: has joined #ruby
[12:21:20] absolutejam4: has joined #ruby
[12:27:11] yalue: has joined #ruby
[12:34:49] lmc: has joined #ruby
[12:37:42] DTZUZO: has joined #ruby
[12:45:50] ramfjord: has joined #ruby
[12:46:49] queip: has joined #ruby
[12:49:12] x0F_: has joined #ruby
[12:55:07] x0F: has joined #ruby
[12:59:41] vondruch: has joined #ruby
[13:02:19] joshua75: has joined #ruby
[13:08:51] morenoh11: has joined #ruby
[13:09:41] conta: has joined #ruby
[13:16:24] troulouliou_divn: has joined #ruby
[13:17:42] shansen: has joined #ruby
[13:19:15] tdy: has joined #ruby
[13:19:47] oetjenj: has joined #ruby
[13:20:36] oetjenj: has joined #ruby
[13:21:07] oetjenj: has joined #ruby
[13:21:20] griffindy: has joined #ruby
[13:21:50] lucasb: has joined #ruby
[13:21:53] oetjenj: has joined #ruby
[13:22:43] oetjenj: has joined #ruby
[13:23:33] oetjenj: has joined #ruby
[13:24:10] cd: has joined #ruby
[13:24:14] oetjenj: has joined #ruby
[13:24:29] absolutejam4: has joined #ruby
[13:25:42] ikbenhet: has joined #ruby
[13:31:09] ascarter: has joined #ruby
[13:37:26] chalkmonster: has joined #ruby
[13:43:45] oetjenj: has joined #ruby
[13:44:34] oetjenj: has joined #ruby
[13:45:18] oetjenj: has joined #ruby
[13:46:02] jenrzzz: has joined #ruby
[13:47:49] oetjenj: has joined #ruby
[13:48:23] involans: has joined #ruby
[13:48:41] oetjenj: has joined #ruby
[13:49:20] oetjenj: has joined #ruby
[13:49:46] adam12: dionysus69: Does that solution not work?
[13:49:54] oetjenj: has joined #ruby
[13:50:39] oetjenj: has joined #ruby
[13:51:26] oetjenj: has joined #ruby
[13:52:14] oetjenj: has joined #ruby
[13:52:59] oetjenj: has joined #ruby
[13:53:45] oetjenj: has joined #ruby
[13:54:31] oetjenj: has joined #ruby
[13:55:11] conta1: has joined #ruby
[13:55:24] oetjenj: has joined #ruby
[14:01:03] yqt: has joined #ruby
[14:03:18] morenoh11: has joined #ruby
[14:04:24] absolutejam4: has joined #ruby
[14:08:43] Rapture: has joined #ruby
[14:09:56] wildermind: has joined #ruby
[14:11:17] Inline: has joined #ruby
[14:27:09] MindSpark: has joined #ruby
[14:28:03] MindSpark: hey, I have a Rakefile that is including some packages. When I run rake, I get the error "LoadError: cannot load such file -- ra10ke"
[14:28:20] gremax: has joined #ruby
[14:28:22] MindSpark: Although I have the gems installed via bundler. Sorry, total noob here.
[14:36:02] matheusmoreira: has joined #ruby
[14:37:32] adam12: MindSpark: How about prefixing your rake command with `bundle exec`?
[14:38:18] andikr: has joined #ruby
[14:40:17] chalkmonster: has joined #ruby
[14:41:48] MindSpark: adam12, I think I figured it out. I needed to set $GEM_HOME and $GEM_PATH, or one of them.
[14:43:16] adam12: MindSpark: You shouldn't have to...
[14:43:35] adam12: MindSpark: Well, what did you have to set them to?
[14:43:44] MindSpark: I set them to ~/.gem
[14:43:57] adam12: MindSpark: Bundler alleviates the need for setting $GEM_HOME and $GEM_PATH.
[14:44:18] MindSpark: I think it's because I installed ruby via the puppet package instead of the default package manager?
[14:44:57] GodFather: has joined #ruby
[14:45:09] MindSpark: adam12, does that also apply to rake?
[14:45:17] MindSpark: Because bundler itself ran fine
[14:45:26] MindSpark: but when I ran rake, that's the error I got
[14:45:43] adam12: MindSpark: Bundler is basically 2 components. One part is depedency resolution / installation, and the other part is path management.
[14:45:56] ramfjord: has joined #ruby
[14:46:08] adam12: MindSpark: Bundler knows where it installed the gems, so when you need a gem, it's possible it's not installed in GEM_HOME but bundler knows that, so it manipulates the path.
[14:46:20] adam12: MindSpark: The two ways it does that are either, bundle exec being used, or require "bundler/setup"
[14:46:59] adam12: MindSpark: Rake is a system gem and installed outside of bundler, so it can be called directly, but the second you require a gem managed by bundler, it needs that load path manipulated. Either require "bundler/setup" at the top of your Rakefile or prefix your commands with bundle exec.
[14:47:29] jefffrails35: has joined #ruby
[14:47:41] MindSpark: Ah, ok... I'll try to require bundler/setup
[14:48:10] MindSpark: LoadError: cannot load such file -- bundler/setup
[14:48:27] adam12: Is your GEM_HOME and GEM_PATH environment variables still set/different?
[14:48:33] MindSpark: I unset them
[14:48:39] adam12: Maybe they had defaults.
[14:48:57] adam12: Did you set them, and _then_ install bundler?
[14:49:24] MindSpark: I set them after I installed bundler and things weren't working
[14:49:38] MindSpark: Then I stumbled upon https://unix.stackexchange.com/questions/203376/how-to-set-ruby-gem-home-and-gem-path
[14:49:51] xco: has joined #ruby
[14:50:10] adam12: MindSpark: Interesting. Well you could just re-install bundler or re-set the GEM_HOME and GEM_PATH. But something has gone hinky and it's too hard to determine what.
[14:50:26] MindSpark: I am guessing that if you install ruby via apt or rpm or aio or w/e, the environment is added into etc/bash.profile /
[14:50:32] MindSpark: And in that case it applies to all users?
[14:50:49] MindSpark: adam12, can you try and echo $GEM_PATH and $GEM_HOME on your machine?
[14:51:15] MindSpark: One thing to note of course is that my bundler and bundle binaries are in ~/.gem/bin. Which currently is not set in my path
[14:52:45] adam12: MindSpark: Both of mine are unset by default. I use direnv when working on projects and use GEM_HOME there (but never GEM_PATH)
[14:53:25] mdl8165: has joined #ruby
[14:53:32] MindSpark: yes, well it works when I have GEM_HOME set. I don't have to have GEM_PATH really. I think they're interchangeable
[14:53:38] adam12: MindSpark: A lot of package managers butcher the ruby install. Eventually I think ~/.gem will be default for `gem` command (I believe it's user-install option defaults to it)
[14:54:09] adam12: MindSpark: Ideally: you only need GEM_HOME set if you're installing gems as non-root.
[14:54:36] adam12: MindSpark: If you are using bundler, you need to ensure bundler is used. This can either be through it's binstubs, bundle exec, or require bundler/setup as mentioned.
[14:54:43] adam12: MindSpark: Outside of that, it should just work :)
[14:55:53] oetjenj: has joined #ruby
[14:56:37] MindSpark: adam12, what about bundle exec? Do I just execute this before I include any gems?
[14:57:24] adam12: MindSpark: bundle exec is used before calling any gem binaries. bundle exec rake, bundle exec rails, etc. The bundle exec portion sets up the $LOAD_PATH to find the bundle'd gem, not the one that might be installed elsewhere / outside of the load path.
[14:57:29] morenoh11: has joined #ruby
[15:00:54] MindSpark: Ah, so I would have had to call rake via bundle exec rake ?
[15:01:01] yqt: has joined #ruby
[15:04:10] s2013: has joined #ruby
[15:06:31] Dbugger: has joined #ruby
[15:15:05] absolutejam4: has joined #ruby
[15:17:46] aupadhye: has joined #ruby
[15:24:46] oetjenj: has joined #ruby
[15:24:56] adam12: MindSpark: Yes
[15:25:20] involans: has joined #ruby
[15:25:28] oetjenj: has joined #ruby
[15:26:01] havenwood: Prefix `bundle exec`, or it's not your bundle!
[15:26:19] oetjenj: has joined #ruby
[15:26:50] rikkipitt: has joined #ruby
[15:26:53] havenwood: https://i.imgur.com/2Hlpoov.png
[15:26:58] oetjenj: has joined #ruby
[15:27:47] oetjenj: has joined #ruby
[15:28:38] oetjenj: has joined #ruby
[15:28:51] Rapture: has joined #ruby
[15:29:19] oetjenj: has joined #ruby
[15:30:03] oetjenj: has joined #ruby
[15:30:59] oetjenj: has joined #ruby
[15:31:04] gix: has joined #ruby
[15:31:38] oetjenj: has joined #ruby
[15:32:24] oetjenj: has joined #ruby
[15:32:56] shtirlic: has joined #ruby
[15:33:09] oetjenj: has joined #ruby
[15:33:54] oetjenj: has joined #ruby
[15:34:40] oetjenj: has joined #ruby
[15:46:00] ramfjord: has joined #ruby
[15:46:25] jenrzzz: has joined #ruby
[15:46:35] ep4sh2k__: has joined #ruby
[15:49:07] reber: has joined #ruby
[15:51:46] morenoh11: has joined #ruby
[15:54:55] AJA4350: has joined #ruby
[15:59:14] Exuma: has joined #ruby
[16:01:09] yqt: has joined #ruby
[16:01:33] orbyt_: has joined #ruby
[16:04:16] lxsameer: has joined #ruby
[16:09:04] dviola: has joined #ruby
[16:44:28] TheBetrayer: has joined #ruby
[16:45:08] Rapture: has joined #ruby
[16:46:38] jenrzzz: has joined #ruby
[16:50:00] thebetra1: has joined #ruby
[16:50:28] griffindy: has joined #ruby
[16:55:40] gnufied: has joined #ruby
[16:55:47] deepreds1: has joined #ruby
[16:58:11] plujon: has joined #ruby
[16:58:39] plujon: Is there a ruby idiom for recursively sorting a nested hash by key, then value?
[17:00:03] plujon: { 'b' => ['c', 'a'], 'a' => { 'c' => 1, 'b' => 2 }, } # to sort something like this
[17:00:32] chalkmonster: has joined #ruby
[17:00:58] yqt: has joined #ruby
[17:05:47] duderonomy: has joined #ruby
[17:06:03] ramfjord: has joined #ruby
[17:13:00] Technodrome: has joined #ruby
[17:22:05] Technodrome: has joined #ruby
[17:23:38] nowhere_man: has joined #ruby
[17:24:34] insolentworm: has joined #ruby
[17:28:30] Nicmavr: has joined #ruby
[17:32:34] fphilipe: has joined #ruby
[17:35:55] dhollinger: has joined #ruby
[17:42:14] redlegion: has joined #ruby
[17:43:48] absolutejam4: has joined #ruby
[17:47:03] kaiser: has joined #ruby
[17:48:08] dhollinger: has joined #ruby
[17:56:20] dellavg: has joined #ruby
[17:59:13] ua: has joined #ruby
[18:15:28] thebetra1: has joined #ruby
[18:15:29] falconfox: has joined #ruby
[18:16:59] kaiser0: has joined #ruby
[18:17:35] orbyt_: has joined #ruby
[18:20:50] yalue: has joined #ruby
[18:25:01] mdl8615: has joined #ruby
[18:31:36] morenoh11: has joined #ruby
[18:39:15] Fusl: has joined #ruby
[18:41:33] Dr_MDMA_MD: has joined #ruby
[18:44:27] themsay: has joined #ruby
[18:45:26] havenwood: plujon: what should the result be?
[18:49:11] plujon: { 'a' => { 'b' => 2, 'c' => 1 }, 'b' => ['a', 'c'] }
[18:49:43] plujon: havenwood: sort by keys, and [maybe?] sort any arrays?
[18:57:15] havenwood: plujon: the first level is easy: h.sort.to_h
[19:00:34] zave: has joined #ruby
[19:01:28] thebetra1: has joined #ruby
[19:01:34] zave: hi all, does anyone here use .rbenv/cache with a downloaded ruby in a tar file?
[19:01:47] zave: for rbenv install <that tar file> , i mean?
[19:03:34] Inline: has joined #ruby
[19:05:23] morenoh11: how do I pass a block to .each ? https://repl.it/@morenoh149/OpulentTestyMass
[19:06:40] adam12: morenoh11: The `do` on line 13 is a syntax error.
[19:06:55] thebetra1: has joined #ruby
[19:07:20] adam12: morenoh11: For line 12 (each), you have 3 "block" passing strategies. do/end, {}, or &some_proc.
[19:10:33] morenoh11: ok I have https://repl.it/@morenoh149/OpulentTestyMass now, I can't seem to update the hash, should I construct a new one as I iterate?
[19:10:41] adam12: morenoh11: It's very out of place to see use of `for` in Ruby. Most people use the iterators provided by Enumerable. So answers.each rather than the use of for.
[19:11:04] havenwood: plujon: For your example, if it's only a single level deep, you can: h.sort.to_h { |key, value| [key, value.sort.public_send("to_#{value.class.name.chr.downcase}")] }
[19:11:29] havenwood: plujon: (replace that #to_h with #map and a #to_h on the end with an older Ruby)
[19:11:32] adam12: morenoh11: What should the result of that be?
[19:12:10] havenwood: &>> { 'b' => ['c', 'a'], 'a' => { 'c' => 1, 'b' => 2 }, }.sort.to_h { |key, value| [key, value.sort.public_send("to_#{value.class.name.chr.downcase}")] }
[19:12:13] adam12: morenoh11: You have a return value of `Integer`. Presuming you want something to be counted?
[19:12:17] rubydoc: # => {"a"=>{"b"=>2, "c"=>1}, "b"=>["a", "c"]} (https://carc.in/#/r/7a34)
[19:12:49] plujon: havenwood: Wowza. Thanks I wouldn't have thought of the public_send approach..
[19:13:00] morenoh11: I'm not too concerned with the Integer bit, just trying to get ruby loops and hash
[19:13:26] havenwood: plujon: There are many ways to do it! I might end up refactoring that to something a bit more straightforward.
[19:13:53] adam12: morenoh11: I'm presuming you're talking about updating the hash around line 1$?
[19:13:58] adam12: morenoh11: line 14 rather?
[19:16:11] adam12: morenoh11: If that's the case, what you're getting as 'value' is actually a value, not a reference. When you mutate it (value -= 2), you get another value. It's not touching the reference at all which remains the same. You likely want to re-assign it. hash[key] -= 2 or hash[key] = value - 2.
[19:17:31] hiroaki: has joined #ruby
[19:28:02] AJA4350: has joined #ruby
[19:30:12] Dr_MDMA_MD: has joined #ruby
[19:31:11] nst^: has joined #ruby
[19:31:51] havenwood: Since they left, one-liner time!
[19:31:54] havenwood: answers.group_by(&:itself).transform_values(&:size)
[19:32:47] adam12: havenwood: show off :P
[19:33:12] adam12: havenwood: Haven't seen transform_values before...
[19:33:38] havenwood: adam12: #transform_keys and #transform_values are handy new ones. They added one then the other.
[19:33:59] adam12: havenwood: Only seen transform_keys. Very nice. I wonder which Ruby version they came in.
[19:34:10] havenwood: adam12: then the new block form of #to_h for transforming both at once
[19:34:13] havenwood: adam12: 2.5 for keys and 2.6 for values iir
[19:34:24] havenwood: err, 2.4 keys, 2.5 values, 2.6 to_h?
[19:34:33] havenwood: adam12: i don't remember. >.> i used to know.
[19:34:42] adam12: havenwood: I'll not be lazy and look it up :P
[19:35:09] havenwood: my final guess is 2.4 keys, 2.5 values, 2.6 to_h
[19:40:18] havenwood: adam12: In 2.7 the oneliner becomes a very short one. :)
[19:40:24] havenwood: answers.tally
[19:40:36] havenwood: #=> => {1=>2, 0=>3}
[19:40:57] havenwood: I'd probably write it: answers.tally.transform_values(&reduce_population)
[19:42:11] havenwood: https://gist.github.com/havenwood/377956e68d54206d3cd00f127ef0c6e6
[19:47:05] adam12: havenwood: why a method that returns a proc vs just assigning a proc to a local? preference?
[19:49:34] havenwood: adam12 Multitasking example fail. I'd actually use a constant, to not be churning out procs.
[19:50:13] adam12: havenwood: Save your GC with this one weird trick!
[19:50:28] kaiser0: has joined #ruby
[19:50:37] havenwood: adam12: fixed: https://gist.github.com/havenwood/377956e68d54206d3cd00f127ef0c6e6
[19:50:58] jenrzzz: has joined #ruby
[19:51:08] adam12: havenwood: Freezing a proc? You monster. :P
[19:51:23] adam12: &>> Proc.new.freeze
[19:51:24] rubydoc: stderr: -e:2:in `new': tried to create Proc object without a block (ArgumentError) (https://carc.in/#/r/7a3b)
[19:51:33] havenwood: &>> Proc.new { }.freeze
[19:51:33] rubydoc: # => #<Proc:0x0000564b39f1e1b0@-e:2> (https://carc.in/#/r/7a3c)
[19:51:34] adam12: Oh yah. Thanks Ruby 2.new.
[19:51:45] adam12: Interesting.
[19:54:20] havenwood: adam12: `lamba(&prok)` or `prok.curry` gets you an unfrozen version, fwiw.
[19:54:47] havenwood: #to_proc stays frozen
[19:54:59] adam12: havenwood: I wonder the benefit to freezing the proc.
[19:55:09] havenwood: keeps longer
[19:56:59] havenwood: adam12: Nobody will go adding singleton methods to it if you freeze it. Trying to think of other wins...
[19:57:12] havenwood: ¯\_(ツ)_/¯
[19:57:29] adam12: havenwood: lulz. I like my proc's to be freeze dried and then rehydrated.
[19:57:42] adam12: ACTION goes to submit PR to ruby-lang/ruby for Object#rehydrate
[19:59:50] LtHummus: has joined #ruby
[20:02:39] leftylink: surely they would have added transform_values before transform_keys
[20:03:13] leftylink: transform_values is more aplpicable and requires less care than transform_keys (for the latter, one has to think about what happens if you map two former keys to the same new key)
[20:04:27] deepredsky: has joined #ruby
[20:04:47] absolutejam: has joined #ruby
[20:05:34] galaxie: has joined #ruby
[20:07:52] zapata: has joined #ruby
[20:08:41] morenoh11: has joined #ruby
[20:13:11] morenoh11: adam12: yes, is there a way to update a has as you iterate or should I construct a new one
[20:14:27] ellcs: has joined #ruby
[20:21:45] jenrzzz: has joined #ruby
[20:26:52] Jonopoly: has joined #ruby
[20:30:23] fphilipe: has joined #ruby
[20:34:24] redlegion: has joined #ruby
[20:41:03] agent_white: has joined #ruby
[20:42:37] nowhere_man: has joined #ruby
[20:44:57] absolutejam: has joined #ruby
[20:45:57] heyimwill: has joined #ruby
[20:48:00] _sfiguser: has joined #ruby
[20:48:03] xco: has joined #ruby
[20:48:20] ur5us: has joined #ruby
[20:48:52] _sfiguser: guys i just started ruby and i really like the language... i was wondering if the ruby language is alive in 2019 and if new projects are implemented in ruby...
[20:48:54] krasnus: has joined #ruby
[20:49:28] _sfiguser: i mean i want to spend some time learning some modern language i can use for network programming and for writing scripts for network security assessment and system admin
[20:49:52] s2013: has joined #ruby
[20:49:54] leftylink: https://github.com/search?q=language%3Aruby
[20:50:42] _sfiguser: leftylink, ok if i sort by recently updated i get this Updated on Sep 27, 2018
[20:51:02] SeepingN: has joined #ruby
[20:51:44] leftylink: counterexample, https://github.com/rails/rails is certainly written in ruby and was certainly updated more recently than september 27
[20:52:40] havenwood: _sfiguser: At Square we create a new Ruby app and gem about once a month these days, fwiw.
[20:54:19] _sfiguser: what about multithreading does it also have the GIL as python?
[20:56:44] havenwood: _sfiguser: The reference implementation of Ruby (CRuby) does have a GIL (GVL).
[20:57:05] havenwood: _sfiguser: JRuby, TruffleRuby and some other implementations don't have a GIL.
[20:57:35] xco: has joined #ruby
[20:58:43] havenwood: _sfiguser: The CRuby path forward on that front appears to be the introduction of Guilds in Ruby 3 for parallel computation, and Async I/O backed by Fibers for parallel IO.
[21:00:18] _sfiguser: what's a module to do async http requests in ruby ?
[21:01:01] leftylink: out of curiosity I also looked at rubinius. then I saw its readme says it doesn't supprot refinements. guess I can't use it then, DOH
[21:02:10] havenwood: _sfiguser: Check out the socketry async libraries, including the async gem: https://github.com/socketry
[21:05:22] bambanx: has joined #ruby
[21:16:15] schne1der: has joined #ruby
[21:21:28] jenrzzz_: has joined #ruby
[21:21:52] joshuacronemeyer: has joined #ruby
[21:21:59] xco: has joined #ruby
[21:23:28] morenoh11: has joined #ruby
[21:23:33] Swyper: has joined #ruby
[21:24:23] redlegion: has joined #ruby
[21:25:26] _sfiguser: do ruby have bindings for libcurl ?
[21:26:23] SeepingN: https://jhawthorn.github.io/curl-to-ruby/
[21:29:04] houhoulis: has joined #ruby
[21:29:42] havenwood: _sfiguser: There are several gems with libcurl bindings or ffi.
[21:30:10] havenwood: _sfiguser: Typhoeus and Curb are two. I think Patron might be deprecated?
[21:30:17] havenwood: _sfiguser: I'd recommend Typhoeus.
[21:30:19] Swyper: has joined #ruby
[21:31:06] havenwood: _sfiguser: Here's a spreadsheet that compares many aspects of Ruby HTTP clients: https://docs.google.com/spreadsheets/d/1vPlk6nMIFa3sI5ISl7zZ5r6lDNpVQX6Jxi3ksXCyVbs/edit?usp=sharing
[21:31:23] havenwood: Yeah, I removed Patron. It must be dead.
[21:31:27] havenwood: ¯\_(ツ)_/¯
[21:36:08] Swyper: has joined #ruby
[21:36:50] mdl8615: has joined #ruby
[21:40:50] jenrzzz: has joined #ruby
[21:46:15] catbusters: has joined #ruby
[21:58:05] gnufied: has joined #ruby
[22:03:42] Technodrome: has joined #ruby
[22:11:17] evdubs: has joined #ruby
[22:14:58] m27frogy: has joined #ruby
[22:31:31] Technodrome: has joined #ruby
[22:33:40] ramfjord: has joined #ruby
[22:34:56] s2013: has joined #ruby
[22:42:25] jenrzzz: has joined #ruby
[22:42:51] Fernando-Basso: has joined #ruby
[23:10:11] DaRock: has joined #ruby
[23:12:39] adam12: I saw Patron removed from a project I'm on as well, but without any backstory. Maybe it is?
[23:13:17] adam12: Actually it looks active..
[23:27:48] havenwood: adam12: Maybe it just had a downturn then came back?
[23:37:41] joshuacronemeyer: has joined #ruby
[23:40:34] bogn: has joined #ruby
[23:40:51] henninb: has joined #ruby
[23:41:15] FastJack: has joined #ruby
[23:58:07] bogn: has joined #ruby