« Back to channel list

#ruby - 22 February 2019

« Back 1 day Forward 1 day »
[00:02:21] Calinou: the thing is that a VM incurs a huge amount of latency (both visual and audio) which you'll easily notice when using a full-fledged desktop environment in it
[00:06:48] RougeR: try telling that to my manager who refuses to let me run ubuntu
[00:06:54] RougeR: even though 100% of my work is ruby
[00:10:10] SeepingN: you have macbook written all over you
[00:10:41] RougeR: yeah im not a fan of macs, but id rather one than windows
[00:10:49] RougeR: much prefer windows/ubuntu dual boot or vm
[00:27:29] orbyt_: has joined #ruby
[00:41:52] SeepingN: yall ain't serious enough yet
[00:46:31] mozzarella: has joined #ruby
[00:46:49] Renich_: has joined #ruby
[00:49:40] blackmesa: has joined #ruby
[00:50:26] laaron: has joined #ruby
[01:19:24] Forager: has joined #ruby
[01:24:14] bruul: has joined #ruby
[01:26:04] Dreamer3: has joined #ruby
[01:32:21] ansraliant: has joined #ruby
[01:37:22] Tempesta: has joined #ruby
[01:52:56] orbyt_: has joined #ruby
[02:04:11] duckpuppy: has joined #ruby
[02:09:54] r29v: has joined #ruby
[02:11:48] eb0t: has joined #ruby
[02:23:53] bga57: has joined #ruby
[02:24:02] Emmanuel_Chanel: has joined #ruby
[02:26:31] skyikot: has joined #ruby
[02:28:33] Renich: has joined #ruby
[02:40:20] elcontrastador: Holistic question: Looking for a <10k line ruby gem-packaged app on github that is a shining example of best practices to level up my game. Recommendations?
[03:00:00] r29v: has joined #ruby
[03:06:17] blackbaba: has joined #ruby
[03:11:06] awkwords: has joined #ruby
[03:33:54] baweaver: elcontrastador: What do you want to learn about?
[03:41:02] Tharbakim: has joined #ruby
[03:43:05] r29v: has joined #ruby
[03:55:52] tdy: has joined #ruby
[04:02:36] wolfshappen: has joined #ruby
[04:05:08] mkroman: has joined #ruby
[04:10:11] braincrash: has joined #ruby
[04:18:37] ur5us: has joined #ruby
[04:40:59] bruul: has joined #ruby
[05:05:10] v01d4lph4: has joined #ruby
[05:32:06] r29v: has joined #ruby
[05:46:04] skyikot: has joined #ruby
[05:57:02] fluxAeon: has joined #ruby
[06:15:55] dellavg__: has joined #ruby
[06:15:56] elcontrastador: baweaver: particulary, just the best ruby form
[06:17:22] elcontrastador: I've met jim weirich before he left us...just reading thru rake code now.... much respect for jim
[06:18:11] conta: has joined #ruby
[06:22:53] havenwood: elcontrastador: I couldn't agree more.
[06:23:45] havenwood: elcontrastador: It's hard to pick, but I can't find a thing to improve in Roda's code so it might make a good read: https://github.com/jeremyevans/roda
[06:26:27] havenwood: elcontrastador: Or http.rb has some neat patterns too: https://github.com/httprb/http
[06:30:31] havenwood: elcontrastador: https://github.com/socketry/falcon
[06:34:44] syndikate: Is true parallelism possible in ruby using processes?
[06:36:15] havenwood: syndikate: sure, you can do things in parallel on multiple cores with multiple processes.
[06:37:23] havenwood: syndikate: is that what you mean?
[06:37:35] syndikate: Ah okay havenwood. Was reading through parallel_tests gem
[06:48:15] havenwood: syndikate: Ah, neat. Using separate processes is a fairly common pattern in Ruby since CRuby blocks most Threads from doing parallel non-IO work.
[06:48:33] havenwood: syndikate: (JRuby and TruffleRuby can do parallel work in Threads.)
[06:48:51] syndikate: Oh, they are helped by having the VM eh? havenwood
[06:48:59] havenwood: syndikate: Here's a good 3-part article about the CRuby global VM lock that prevents some parallel thread cases: https://www.jstorimer.com/blogs/workingwithcode/8085491-nobody-understands-the-gil
[06:49:25] syndikate: havenwood, Yeah that's what I meant. Oh okay nice will read through.
[06:49:44] havenwood: syndikate: CRuby has a VM too these days! (So it's a GVL technically, not a GIL.)
[06:49:55] havenwood: syndikate: CRuby got a VM in 1.9, with YARV.
[06:50:28] syndikate: Oh, I have never worked on it so pretty un-informed on these
[06:50:31] havenwood: syndikate: Then at Christmas the CRuby JIT landed. (JRuby's and TruffleRuby's are far further along at this point.)
[06:50:41] havenwood: syndikate: Welcome to Ruby!
[06:51:16] syndikate: havenwood, Thanks! I have been on rails for sometime but haven't written much tools in Ruby. Recently started looking into gems and seeing if I can get hands into more ruby stuff
[06:51:26] havenwood: syndikate: ah, nice
[06:52:39] syndikate: havenwood, Any pointers, suggestions, mentoring on stuff to begin contribution are all welcome :D socketry/falcon is something that I wanted to look into for a while now. Fibers as well.
[06:54:15] havenwood: syndikate: Fibers are interesting. I much more often use Enumerators, which are backed by Fibers internally.
[06:54:26] havenwood: syndikate: Happy to review any code or help here with anything that comes up!
[06:56:14] syndikate: havenwood, Oh didn't know that. Sure, I will probably request for clarification for things I don't understand :D
[06:59:52] havenwood: syndikate: If I use fibers directly it's usually for silly things like this: https://gist.github.com/havenwood/113c61b9540728d4932f
[07:00:15] havenwood: syndikate: or this: https://gist.github.com/havenwood/136aca0d7b01296f03c63bc464c4924e
[07:01:20] syndikate: Oh okay, let me check them. Might need some time :D
[07:01:55] havenwood: Enumerators really are useful!
[07:02:58] syndikate: Yeah I started picking up enumerators a while ago
[07:03:35] syndikate: But problem is that there is not much scope to write much stuff with all those in my current work as mostly it's the usual rails related stuff
[07:04:15] havenwood: Aye, I was just talking with some folk tonight at a meetup about how Rails development feels like putting things meticulously in the right drawers.
[07:04:53] havenwood: Which can be pleasing or maddening, depending on how tidily it fits in those drawers.
[07:06:53] havenwood: The author of that ^ GIL article wrote three great books, on processes, tcp sockets and threads.
[07:07:26] havenwood: syndikate: If you're interested in those arenas, his books are short but _very_ informative: https://www.jstorimer.com/products/working-with-tcp-sockets
[07:07:36] havenwood: Oops, meant to link: https://www.jstorimer.com/pages/books
[07:07:56] syndikate: Exactly, after a while the charm is lost - well for someone who wants to do something new most of the time. It's not that the current application is best ever but when you working with business requirements and timelines out of scope work is always in the backlogs. You do what's required and that's mostly straightforward stuff. So, I thought looking into more of ruby can help me take something back.
[07:08:25] syndikate: Oh alright, that's quite a lot of stuff to bookmark now :D
[07:08:47] syndikate: Thanks havenwood !
[07:08:54] luminous: has joined #ruby
[07:08:58] havenwood: You're welcome! Any time
[07:09:12] sauvin: has joined #ruby
[07:09:21] syndikate: I am trying to see how I can (If I can) improve the tooling and use it to it's utmost potential in my project
[07:09:35] syndikate: mostly the ruby gems and all
[07:23:03] nones: has joined #ruby
[07:33:45] aufi: has joined #ruby
[08:18:20] clemens3_: has joined #ruby
[08:18:26] dinfuehr: has joined #ruby
[08:18:31] conta: has joined #ruby
[08:27:30] dinfuehr: has joined #ruby
[08:46:21] blackmesa: has joined #ruby
[08:50:03] dinfuehr_: has joined #ruby
[08:55:20] sonofentropy: has joined #ruby
[08:55:38] SuperLag: has joined #ruby
[08:58:01] dinfuehr: has joined #ruby
[09:05:54] lxsameer: has joined #ruby
[09:06:54] mikecmpbll: has joined #ruby
[09:09:56] dionysus69: has joined #ruby
[09:24:31] RougeR: has joined #ruby
[09:28:03] alem0lars: has joined #ruby
[09:31:43] mozzarel1: has joined #ruby
[09:37:59] mikecmpb_: has joined #ruby
[09:39:25] mikecmpbll: has joined #ruby
[09:39:46] SplinTer0616: has joined #ruby
[09:40:07] Inline: has joined #ruby
[09:44:56] Nicmavr: has joined #ruby
[09:59:43] SplinTer0616: try to run ruby abd it says cant find it
[10:00:03] SplinTer0616: hosting is running freebsd
[10:00:10] SplinTer0616: have no ✘ root access
[10:01:17] dhollin3: has joined #ruby
[10:01:53] wolfshappen: has joined #ruby
[10:05:22] venmx: has joined #ruby
[10:07:36] tdy1: has joined #ruby
[10:18:47] sonofentropy: has joined #ruby
[10:27:33] mangold: has joined #ruby
[10:27:41] blackmesa: has joined #ruby
[10:31:15] sonofentropy: has joined #ruby
[10:42:40] conta: has joined #ruby
[10:55:48] fribmendes: has joined #ruby
[11:27:44] wildermind: has joined #ruby
[11:46:37] adgtl: has joined #ruby
[11:48:29] ur5us: has joined #ruby
[12:11:58] nones: has joined #ruby
[12:15:08] tAn: has joined #ruby
[12:25:12] lucasb: has joined #ruby
[12:26:49] gheegh: has joined #ruby
[12:29:52] CrazyEddy: has joined #ruby
[12:33:21] andywww: has joined #ruby
[12:34:10] andywww: I’ trying to get my head around composition and have the following:
[12:34:11] andywww: https://hastebin.com/difusaqiju.rb
[12:34:36] andywww: that is haild code and works, but I’m not sure if its the correct way to go stylistically?
[12:35:21] andywww: is it okay/common to pass the class in like that so the parent knows what to instantiate?
[12:35:26] andywww: or is there a better way to do it?
[12:35:43] andywww: haild = valid
[12:35:51] phaul: klasses are just objects. You can pass them around
[12:36:17] andywww: so theres nothing ‘wrong’ with doing it that way then?
[12:36:29] andywww: you wouldn’t wince if you saw that approach in a project?
[12:36:44] phaul: no, but probably I wouldn't do it either
[12:36:55] andywww: how might you do it different?
[12:37:17] gregf_: has joined #ruby
[12:37:39] tjbp: has joined #ruby
[12:38:27] phaul: what makes the decision on A or B? somewhere there is going to be a case that decides otherwise there is no point in the two possibilities. There I would just chose A or B and there is no need for parent class altogether
[12:39:01] phaul: that said I would probably transfer the decision into BaseHandler
[12:39:46] phaul: class BaseHandler; def self.for_thing(x) case x when X then AHandler; when Y then BHandler ...
[12:40:12] phaul: but it's subjective opinion and peoples preferences differ
[12:40:48] andywww: sorry, the particular instance I’ve applied this to are audio stream formats where the parent object is a broadcast which has many streams of different audio formats
[12:41:04] andywww: and I want to be able to add to those formats over time
[12:41:49] andywww: so the XHandler classes are for each format, if that makes sense
[12:41:59] phaul: sure. Imo the only way to really go wrong with this if you replicate the decision logic in multiple places. There should be 1 place which dispatches on A/B types.
[12:42:48] andywww: okay thanks
[12:43:00] sonofentropy: has joined #ruby
[12:59:13] phaul: the other thing I started doing, again it is very subjective, is to get rid of raise NotImplementedError methods. And if a common parent only has NotImplementedError methods then get rid of the parent class. And child classes just have the same methods without a common parent. Im sure this view is somewhat controversial. But for instance look at how TrueClass and FalseClass doesn't have a common parent.
[13:07:24] phaul: something like https://gist.github.com/6cf86b8481e9c54ccb8bdae7db28e708
[13:10:05] andywww: how would you introduce a CHandler?
[13:11:12] al2o3-cr: imo prefer andywww way of polymorphism here.
[13:13:00] phaul: there are 2 options. doing the same as for BHandler, or introducing a plugin like architecture where Handler.for picks up child classes automatically. Either form a common folder like /handlers or using hooks like inherited
[13:15:33] phaul: then each match check can be put in a class method and Handler.for just calls different handlers in a loop to check which can handle
[13:16:05] phaul: class AHandler; def can_handle?(thing) :a == thing; end ...
[13:17:03] phaul: def _self_.can_handle? ^
[13:22:27] andywww: brill, thanks for the input
[13:37:35] venmx: has joined #ruby
[13:40:47] fritzroy15: has joined #ruby
[13:41:29] fritzroy15: heyo, keep getting ! Terminating timed out worker: and puma doesn't seem to want to properly start. I'm running it inside ec2 on aws and no machine metrics look like it's reaching the limit in any way
[13:44:27] jcalla: has joined #ruby
[13:47:21] akem: has joined #ruby
[13:56:47] cd: has joined #ruby
[14:15:41] awkwords: has joined #ruby
[14:18:28] queip: has joined #ruby
[14:25:58] Inline: has joined #ruby
[14:27:39] awkwords_: has joined #ruby
[14:30:31] AJA4350: has joined #ruby
[14:39:50] sonofentropy: has joined #ruby
[14:51:23] orbyt_: has joined #ruby
[14:57:45] Rapture: has joined #ruby
[15:15:38] gnufied: has joined #ruby
[15:17:55] millerti: has joined #ruby
[15:21:22] skryking: has joined #ruby
[15:31:07] jobewan: has joined #ruby
[15:37:52] maryo: has joined #ruby
[15:38:16] mangold: has joined #ruby
[15:39:53] code_zombie: has joined #ruby
[15:43:18] polishdub: has joined #ruby
[15:45:48] FernandoBasso: has joined #ruby
[15:46:20] FernandoBasso: How do I assign a lambda to a name with a ?, like foo? = -> (x) { ... } ?
[15:46:25] FernandoBasso: I get a syntax error because of the ?
[15:53:41] skryking: has joined #ruby
[16:02:05] Inline: has joined #ruby
[16:02:07] wolfshappen_: has joined #ruby
[16:06:21] havenwood: fernandobasso: question marks just aren't allowed in variable names
[16:06:32] havenwood: fernandobasso: you could define a method that returns that lambda
[16:06:46] rippa: has joined #ruby
[16:06:55] yokel: has joined #ruby
[16:07:04] FernandoBasso: havenwood: All right. Thanks.
[16:07:31] FernandoBasso: Ah, não é possível. Nomes de variáveis não podem conter ?
[16:11:26] havenwood: you can use a tiny question mark :P
[16:11:34] havenwood: &>> foo﹖= ->{ 42 }; foo﹖.call
[16:11:37] rubydoc: # => (https://carc.in/#/r/6c2u)
[16:16:55] conta: has joined #ruby
[16:18:00] yokel: has joined #ruby
[16:26:06] agent_white: has joined #ruby
[16:28:01] tdy1: has joined #ruby
[16:30:03] stryek: has joined #ruby
[16:32:04] maryo: has joined #ruby
[16:37:00] phaul: TIL what a f*up gemspec add_development_dependency is. they are just under the assumption that you would use bundler anyways. But if that's the case really it should be removed as it doesn't work
[16:37:01] maryo: has joined #ruby
[16:37:10] phaul: https://github.com/rubygems/rubygems/issues/1104
[16:37:30] phaul: I'm closing this issue, because I believe it will sooner become irrelevant (by how technology advances) than coming to a resolution.
[16:37:40] phaul: that was said in 2014 :D
[16:42:24] skyikot: has joined #ruby
[16:47:01] \void: has joined #ruby
[16:47:43] thaikolja: has joined #ruby
[16:48:08] thaikolja: hello there. i have a small problem that i'm sure can be solved very quickly. may i ask in here?
[16:48:39] phaul: sure, thaikolja
[16:49:25] thaikolja: thank you. so, i'm using brew and ruby 2.6.1. however, when enter "brew update", it looks for 2.6.0, which isn't there, obviously
[16:49:48] thaikolja: i tried reinstalling all, but it doesnt change a thing
[16:49:54] [Butch]: has joined #ruby
[16:50:02] thaikolja: dyld: Library not loaded: /usr/local/Cellar/ruby/2.6.0/lib/libruby.2.6.dylib
[16:50:36] thaikolja: if i create a link from 2.6.1 to 2.6.0, it works, but it will be deleted once brew updates
[16:52:13] thaikolja: does anyone have any idea how to solve this?
[16:55:36] maryo: has joined #ruby
[17:01:23] havenwood: thaikolja: Any issues seems suspicious with?: brew doctor
[17:02:03] thaikolja: just some links to -configure files for php
[17:02:20] MyMind: has joined #ruby
[17:03:26] jcarl43: has joined #ruby
[17:08:35] havenwood: thaikolja: Could you gist the output of:
[17:08:36] havenwood: brew uninstall -d ruby && brew cleanup -sdv ruby && brew install ruby -dv
[17:10:48] thaikolja: still the same :( havenwood
[17:10:49] thaikolja: dyld: Library not loaded: /usr/local/Cellar/ruby/2.6.0/lib/libruby.2.6.dylib
[17:11:08] thaikolja: why is brew not calling 2.6.1?
[17:12:40] thaikolja: ruby -v also shows 2.6.0
[17:13:00] havenwood: thaikolja: I'd guess it wasn't linked, except that should show up under `brew doctor`.
[17:13:10] havenwood: thaikolja: Try?: brew link --overwrite ruby
[17:14:35] havenwood: thaikolja: You don't have any DYLD_* env vars set?: env | grep DYLD
[17:15:13] thaikolja: bew doctor shows no errors
[17:17:22] AJA4351: has joined #ruby
[17:20:34] thaikolja: havenwood: env | grep DYLD returns nothing
[17:21:47] havenwood: thaikolja: that's expected
[17:22:30] adgtl: has joined #ruby
[17:25:01] al2o3-cr: foo = :blah; foo﹖= ->{ 42 }; foo﹖; foofoo﹖= ->{ 42 }; foo﹖.call # why does this work?
[17:26:05] al2o3-cr: foo = :blah; foo﹖= ->{ 42 }; foo﹖; foofoo﹖= ->{ 42 }.call # i mean this.
[17:27:30] v01d4lph4: has joined #ruby
[17:27:43] conta: has joined #ruby
[17:30:53] phaul: al2o3-cr: looks fine to me. last part is just var = expr.some_instance_method or which part did you expect to fail?
[17:31:40] orbyt_: has joined #ruby
[17:32:23] al2o3-cr: phaul: concatenating foo and foo﹖ ?
[17:34:04] cthulchu: has joined #ruby
[17:34:25] phaul: I dont see concatenation, I see 3 local vars foo (symbol), foo﹖ (lambda), foofoo﹖ (integer)
[17:34:28] al2o3-cr: am i missing something here ?!? have i gone mental
[17:35:37] al2o3-cr: phaul: ignore me, i see it now. i'm a daft bat :(
[17:36:27] Arahael: has joined #ruby
[17:36:28] al2o3-cr: thought i was going stir crazy for a minute then
[17:36:38] phaul: nah extra pair of eyes. rubber duck. etc. we all been there
[17:37:15] al2o3-cr: glad you cleared that up ;)
[17:40:10] sonofentropy: has joined #ruby
[17:40:30] reber: has joined #ruby
[17:41:34] nowhere_man: has joined #ruby
[17:50:22] duckpuppy: has joined #ruby
[17:55:37] ravenousmoose: has joined #ruby
[17:55:44] tjbp: has joined #ruby
[17:57:52] darix-: has joined #ruby
[17:59:31] mikecmpbll: has joined #ruby
[17:59:55] sameerynho: has joined #ruby
[18:06:08] yokel: has joined #ruby
[18:18:29] yokel: has joined #ruby
[18:23:45] awkwords: has joined #ruby
[18:28:41] sonofentropy: has joined #ruby
[18:30:42] conta: has joined #ruby
[18:35:48] elcontrastador: havenwood: Thanks for the code sample recommendations. Looking at Roda....looks good.
[18:43:48] rockyh: has joined #ruby
[18:45:47] r3m: has joined #ruby
[18:47:41] phaul: hi rockyh
[18:52:19] orbyt_: has joined #ruby
[18:53:05] rockyh: I am using ruby 2.4.5 on FreeBSD 12.0; I am using Jekyll for GitHub Pages. Each repository has its own Gemfile.lock and needs some gems to be installed. FreeBSD `pkg' has a package for each gem, but it is almost impossible to match all the gems and/or versions needed in each repository with the ones available in `pkg'. In this condition, could it be a good solution to install gems only in my user home
[18:53:08] rockyh: directory, without affecting the system at all? With `bundle install --binstubs', IIUC
[18:54:19] rockyh: this would also avoid the use of `root' (discouraged) to install gems, and also the use of `sudo' (which I would install only to install gems)
[18:58:04] ghormoon: has joined #ruby
[19:02:03] Linuus: has joined #ruby
[19:07:49] blackmesa: has joined #ruby
[19:08:42] Inline: has joined #ruby
[19:08:51] AJA4350: has joined #ruby
[19:18:08] awkwords_: has joined #ruby
[19:21:47] lytol_: has joined #ruby
[19:21:52] laaron: has joined #ruby
[19:26:20] duckpuppy: has joined #ruby
[19:30:34] sonofentropy: has joined #ruby
[19:32:30] conta2: has joined #ruby
[19:36:33] xrexeon: has joined #ruby
[19:37:30] xrexeon: has joined #ruby
[19:50:00] SeepingN: has joined #ruby
[19:52:00] duckpuppy: has joined #ruby
[20:00:41] havenwood: rockyh: It's a common pattern to install gems in $GEM_HOME for multiple apps, then using `bundle exec` to limit each app to the exact version of gems in the Gemfile.lock.
[20:01:10] havenwood: rockyh: On the other hand, if it's prod, you can use the `--deployment` flag to install gems for each app in an app-local vendor/ dir.
[20:04:29] laaron-: has joined #ruby
[20:22:05] r3m: has joined #ruby
[20:25:11] Nicmavr: has joined #ruby
[20:40:47] tdy1: has joined #ruby
[20:59:51] awkwords: has joined #ruby
[21:00:10] tdy: has joined #ruby
[21:06:30] awkwords_: has joined #ruby
[21:17:01] sonofentropy: has joined #ruby
[21:32:39] Fernando-Basso: has joined #ruby
[21:33:04] rockyh: havenwood: oh, ok, thank you so much!!
[21:33:37] havenwood: rockyh: you're welcome!
[21:38:19] awkwords: has joined #ruby
[21:45:12] hays: has joined #ruby
[21:45:42] awkwords: has joined #ruby
[21:55:07] dviola: has joined #ruby
[21:58:44] tdy: has joined #ruby
[22:02:25] wolfshappen: has joined #ruby
[22:07:21] jenrzzz: has joined #ruby
[22:13:49] awkwords_: has joined #ruby
[22:14:30] cliluw: has joined #ruby
[22:14:41] sonofentropy: has joined #ruby
[22:18:18] awkwords: has joined #ruby
[22:29:19] my1es: has joined #ruby
[22:31:21] spiette: has joined #ruby
[23:04:34] hahuang6-: has joined #ruby
[23:15:43] tdy1: has joined #ruby
[23:21:00] tdy1: has joined #ruby
[23:40:25] hahuang65: has joined #ruby
[23:51:13] anothertorusr: has joined #ruby