« Back to channel list

#ruby - 19 December 2018

« Back 1 day Forward 1 day »
[00:01:25] themsay: has joined #ruby
[00:04:46] akem: has joined #ruby
[00:12:03] MasterAsia: has joined #ruby
[00:12:52] Inside: has joined #ruby
[00:13:18] Inside: Heyo~ cross posting from the #RoR channel, but I am having issues with bundle bumping from one revision of rails to another: https://gist.github.com/Insood/d0a9df88f8ce2e0e1eee1fe8e70f2c46
[00:13:42] Inside: Like the first conflict makes no sense since it looks like actionpack & simple_form should be satisfied..
[00:21:05] nowhere_man: has joined #ruby
[00:21:41] cthulchu: has joined #ruby
[00:23:41] davidw: has joined #ruby
[00:24:46] Inside: Deprecation warnings galore~
[00:24:58] Inside: Turns out nuking a single gem from the gemfile that I didn't need anyway fixed everything D
[00:30:49] cpruitt: has joined #ruby
[00:30:56] go|dfish: has joined #ruby
[00:31:38] jottr: has joined #ruby
[00:34:40] Eiam: bah, w.e
[00:37:47] ramfjord: has joined #ruby
[00:38:49] Inside: it was more of a ruby question ;P
[00:42:02] nchambers: has joined #ruby
[00:50:09] cnsvc_: has joined #ruby
[00:52:12] cthulchu: has joined #ruby
[01:03:38] jottr: has joined #ruby
[01:12:37] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[01:19:01] akem: has joined #ruby
[01:22:10] davidw: has joined #ruby
[01:33:05] stooj: has joined #ruby
[01:49:48] Exuma: has joined #ruby
[01:56:09] cnsvc_: has joined #ruby
[02:08:11] Xiti: has joined #ruby
[02:08:41] sonne: has left #ruby: ()
[02:11:04] themsay: has joined #ruby
[02:16:40] nchambers: in %r{^exe/} is the / literal here?
[02:17:12] Exuma: has joined #ruby
[02:17:34] darkhanb: has joined #ruby
[02:18:30] nchambers: Iambchop: yeah, you were right. i was having a brainfart and forgot bash was doing things to build[release]
[02:18:37] nchambers: 'build[release]' of course fixed it
[02:22:26] orbyt_: has joined #ruby
[02:39:14] jthomas1: has joined #ruby
[02:48:45] Exuma: has joined #ruby
[02:54:55] carbone5: has joined #ruby
[02:58:25] pwnd_nsfw: has joined #ruby
[03:01:23] orbyt_: has joined #ruby
[03:06:33] hutch: has joined #ruby
[03:23:36] darkhanb: has joined #ruby
[03:39:02] houhoulis: has joined #ruby
[03:42:01] cschneid: has joined #ruby
[03:45:22] mrush: has joined #ruby
[03:58:02] dbz: has joined #ruby
[04:00:45] mrush: finally got eloquent ruby
[04:03:01] davidw: has joined #ruby
[04:06:40] dbz: has joined #ruby
[04:06:50] cnsvc_: has joined #ruby
[04:09:34] braincrash: has joined #ruby
[04:11:08] davidw_: has joined #ruby
[04:16:23] mrush: has left #ruby: ()
[04:16:30] roshanavand1: has joined #ruby
[04:19:43] \void: has joined #ruby
[04:22:06] MasterAsia: has joined #ruby
[04:28:00] kapil____: has joined #ruby
[04:47:44] dellavg_: has joined #ruby
[04:54:20] rippa: has joined #ruby
[04:57:33] yxhuvud: has joined #ruby
[04:59:26] s3nd1v0g1us: has joined #ruby
[05:09:28] Azure: has joined #ruby
[05:11:03] conta: has joined #ruby
[05:11:59] cnsvc_: has joined #ruby
[05:12:30] cschneid: has joined #ruby
[05:13:59] za1b1tsu: has joined #ruby
[05:29:12] conta: has joined #ruby
[05:33:36] cnsvc_: has joined #ruby
[05:58:20] hutch: has joined #ruby
[05:59:03] brandonkal: has joined #ruby
[06:03:06] paranoicsan: has joined #ruby
[06:05:16] dinfuehr: has joined #ruby
[06:38:43] neuraload: has joined #ruby
[06:39:59] endemic: has joined #ruby
[06:41:35] Guest31: has joined #ruby
[06:43:55] cschneid: has joined #ruby
[06:53:02] reber: has joined #ruby
[06:57:56] cnsvc_: has joined #ruby
[06:58:37] aupadhye: has joined #ruby
[07:16:26] ramfjord: has joined #ruby
[07:30:22] aufi: has joined #ruby
[07:31:17] paranoicsan: has joined #ruby
[08:05:59] clemens3_: has joined #ruby
[08:07:58] dbz: has joined #ruby
[08:13:04] ellcs: has joined #ruby
[08:18:53] dinfuehr: has joined #ruby
[08:20:55] paranoicsan: has left #ruby: ()
[08:22:45] kapil____: has joined #ruby
[08:32:39] BH23: has joined #ruby
[08:39:37] paranoicsan: has joined #ruby
[08:58:51] zipace: has joined #ruby
[09:10:38] jthomas1: has joined #ruby
[09:15:42] HailTheRobots: has joined #ruby
[09:16:38] ramfjord: has joined #ruby
[09:23:41] lxsameer: has joined #ruby
[09:28:59] cnsvc_: has joined #ruby
[09:43:04] m0w: has joined #ruby
[09:46:17] tjbp: has joined #ruby
[09:48:01] paranoicsan: has joined #ruby
[09:49:22] ams__: has joined #ruby
[09:50:19] sleetdrop: has joined #ruby
[10:02:10] sleetdrop: has joined #ruby
[10:03:05] phaul: has joined #ruby
[10:05:45] saTchymoto: has joined #ruby
[10:07:41] Pisuke: has joined #ruby
[10:08:37] venmx: has joined #ruby
[10:13:18] cnsvc_: has joined #ruby
[10:17:20] Averna: has joined #ruby
[10:24:34] saTchymoto: has joined #ruby
[10:32:40] cnsvc_: has joined #ruby
[10:49:36] Averna: has joined #ruby
[10:59:57] Averna: has joined #ruby
[11:02:33] jottr: has joined #ruby
[11:06:02] paranoicsan: has joined #ruby
[11:16:51] ramfjord: has joined #ruby
[11:21:31] HailTheRobots: has joined #ruby
[11:24:00] keden: has joined #ruby
[11:26:39] teclator: has joined #ruby
[11:47:34] zapata: has joined #ruby
[11:47:41] TheBloke-: has joined #ruby
[11:54:45] jottr: has joined #ruby
[11:56:25] conta1: has joined #ruby
[11:57:15] lucasb: has joined #ruby
[12:02:57] nowhere_man: has joined #ruby
[12:07:54] ellcs: has joined #ruby
[12:19:37] AJA4350: has joined #ruby
[12:22:44] dinfuehr: has joined #ruby
[12:30:37] coderphive: has joined #ruby
[12:33:18] cnsvc_: has joined #ruby
[12:36:24] m0w: has joined #ruby
[12:40:34] KeyJoo: has joined #ruby
[12:43:33] cpruitt: has joined #ruby
[13:09:28] crash_hacker: has joined #ruby
[13:19:32] crash_hacker: has left #ruby: ("catch you later")
[13:19:36] mostlybadfly: has joined #ruby
[13:21:45] cd: has joined #ruby
[13:34:20] catphish: has joined #ruby
[13:34:50] catphish: feature request (unless it already exists): the ability to defer signal handlers until the end of a block
[13:35:40] catphish: defer_signals {dont_interrupt_this; or_this};
[13:36:10] catphish: i assume one could create this manually by setting up and tearing down signal handlers as needed
[13:36:43] catphish: maybe not very thread safe :(
[13:41:56] venmx: has joined #ruby
[13:42:14] troulouliou_div2: has joined #ruby
[13:48:33] keden: has joined #ruby
[13:52:02] GodFather: has joined #ruby
[13:59:50] keden: has joined #ruby
[14:03:14] jottr: has joined #ruby
[14:07:34] DTZUZO: has joined #ruby
[14:08:34] krawchyk: has joined #ruby
[14:09:03] alan_w: has joined #ruby
[14:09:10] JoshS: has joined #ruby
[14:14:07] MasterAsia: has joined #ruby
[14:17:30] akem: has joined #ruby
[14:28:30] darix: catphish: so what to do when the signal gets thrown in that block?
[14:28:38] darix: a signal that might indicate a serious error
[14:29:18] ramfjord: has joined #ruby
[14:29:37] marz_d`ghostman: has joined #ruby
[14:29:58] marz_d`ghostman: Any good gem that would make testing concurrency easy? Currently using concurrent-ruby gem in my script
[14:32:22] catphish: darix: defer processing of it until after the block :)
[14:33:00] catphish: it makes sense that the signals to defer would be selectable
[14:36:22] paranoicsan: has joined #ruby
[14:37:03] darix: catphish: imho signal usually means something important needs to be done now
[14:38:23] conta: has joined #ruby
[14:46:46] catphish: darix: i rarely find that to be the case
[14:47:29] catphish: the most common signal my applications will see is TERM, and i don't necessarily want a process to exit until it's finished something critical
[14:48:03] catphish: other signals are just used to trigger things, and again i may not want them to happen instantly
[14:49:09] darix: catphish: your signal handler could just set a variable and your event loop could check those variable at the beginning of the next iteration?
[14:49:40] catphish: darix: that's what i usually do, yes, but it would be nice to abstract that
[14:50:21] darix: that is a pretty small code already imho
[14:52:26] paranoicsan: has left #ruby: ()
[14:58:00] paranoicsan: has joined #ruby
[15:02:16] SeepingN: has joined #ruby
[15:02:43] ellcs: has joined #ruby
[15:03:29] cnsvc_: has joined #ruby
[15:07:38] gnufied: has joined #ruby
[15:08:37] Rapture: has joined #ruby
[15:15:50] mikecmpbll: has joined #ruby
[15:28:00] gigetoo: has joined #ruby
[15:31:52] paranoicsan: has joined #ruby
[15:32:35] ellcs: has joined #ruby
[15:34:14] linuxdaemon: has joined #ruby
[15:36:20] polishdub: has joined #ruby
[15:44:00] jthomas1: has joined #ruby
[15:44:54] cschneid: has joined #ruby
[15:46:43] Inside: has joined #ruby
[15:49:15] WA9ACE: Anyone have opinions on Marc-André's http://truthabouteventloops.com/ course?
[15:49:35] WA9ACE: I'm thinking about buying the recorded sessions to go over this holiday season
[15:49:44] jthomas1: has joined #ruby
[15:58:32] exchgr`: has joined #ruby
[16:00:40] reber: has joined #ruby
[16:03:06] hutch: has joined #ruby
[16:07:10] catphish: one should definitely learn event driven coding
[16:07:20] catphish: no idea about that course :)
[16:14:31] akem: has joined #ruby
[16:15:50] havenwood: Update to RubyGems 3.0: gem update --system
[16:20:56] davidw_: has joined #ruby
[16:25:23] devpolish: has joined #ruby
[16:26:45] maryo: has joined #ruby
[16:29:20] catphish: has left #ruby: ("Leaving")
[16:32:54] doubledup: has joined #ruby
[16:34:06] Inline: has joined #ruby
[16:35:25] Inline: has joined #ruby
[16:37:06] bmurt: has joined #ruby
[16:44:44] impermanence: has joined #ruby
[16:58:41] Arkantos: has joined #ruby
[16:59:33] careta: has joined #ruby
[17:00:03] careta: guys, I need too spawn a background process, then after some time "connect" to it and allow the user to interact with it. How can I achieve this?
[17:04:58] rubydoc: has joined #ruby
[17:06:21] phaul: has joined #ruby
[17:06:35] akemot: has joined #ruby
[17:18:03] donofrio: has joined #ruby
[17:22:01] venmx: has joined #ruby
[17:22:52] Arkantos: has joined #ruby
[17:25:04] d10n-work: has joined #ruby
[17:30:56] gix: has joined #ruby
[17:33:43] cnsvc_: has joined #ruby
[17:37:00] havenwood: careta: inter-process communication by unix socket is one option
[17:39:10] Inside: careta: what kind of communication?
[17:39:34] Inside: you could setup a simple web server (ie: rack)
[17:39:56] Inside: Might be over kill
[17:40:15] Inside: Or you could setup a websocket server..
[17:40:41] Inside: if the interaction & the process occur within the same application, you would use threads..
[17:40:46] Inside: and mutexes
[17:42:09] dbz: has joined #ruby
[17:42:30] CrazyEddy: has joined #ruby
[17:43:30] dbz: has joined #ruby
[17:46:03] dbz: has joined #ruby
[17:46:31] mikecmpbll: has joined #ruby
[17:47:33] donofrio: has joined #ruby
[17:50:19] careta: has joined #ruby
[17:51:34] Eiam: or you could use XPC or IPC if this is macOS
[17:51:45] Eiam: which is bsaically what havenwood said
[17:52:12] Eiam: there was a gem ages ago... it took ruby from one client, passed it over the wire, then ran it on another client
[17:52:16] havenwood: Eiam: reminds me of my old, deprecated ipc futures gem: https://github.com/havenwood/ifuture
[17:53:06] Eiam: it wasn't remote_ruby cause this was 7 years ago
[17:53:13] Eiam: well hell let me see if I have the repo still I can just look at the gemfile =o
[17:54:22] careta: havenwood, ok thanks for the tips, I'll look into that
[17:54:38] careta: it might be easier just to use expect or something like that and echo at the end of the output
[17:54:43] careta: since the other end is a shell
[17:55:03] havenwood: careta: How about use DRb? :)
[17:55:59] careta: I don't have control over the other end, I need to interact with a slimmed down shell, not even bash
[17:56:37] havenwood: careta: Both processes on the same machine?
[17:57:58] ramfjord: has joined #ruby
[17:58:51] phaul: I was practising coding and I made a sudoku solver https://gist.github.com/phaul/1d36018bf925bd212c64671a5ca20217. I tried to write idiomatic Ruby, refactor, and write understandable code, rather than be the fastest. But I also tried to solve all puzzles in acceptable amount of time. Please give me suggestions on how the code could be improved
[18:01:18] Eiam: hah past me trying to document his gemfile # Strictly for development for sane debugging & stepping behavior
[18:01:18] Eiam: gem "pry"
[18:01:18] Eiam: gem "pry-byebug"
[18:01:18] Eiam: gem "pry-remote"
[18:01:32] Eiam: havenwood: ahh yes it was DRB!!!
[18:01:51] Eiam: https://ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html
[18:02:40] dinfuehr: has joined #ruby
[18:05:38] hiroaki: has joined #ruby
[18:10:19] slima: has left #ruby: ()
[18:12:07] cthulchu: has joined #ruby
[18:12:10] code_zombie: has joined #ruby
[18:15:55] Inside: phaul: looks pretty sexy
[18:16:07] Inside: I'm gonna upgrade from ruby 2.4 to 2.5
[18:16:11] Inside: any pitfalls I should look out for?
[18:18:08] \void: has joined #ruby
[18:18:56] phaul: Inside: thanks
[18:19:36] Eiam: Inside: just use chruby and run your unit tests?
[18:19:48] Eiam: if it looks good, deploy to QA and verify then off to production?
[18:23:29] jcarl43: has joined #ruby
[18:24:15] gnufied: has joined #ruby
[18:29:30] m0w: has joined #ruby
[18:30:56] kidosatori: has joined #ruby
[18:32:41] phaul: posted on reddit. let's see what sort of responses I get..
[18:33:17] duckpuppy: has joined #ruby
[18:34:36] Scrooge: has joined #ruby
[18:35:11] havenwood: phaul: Use `private_constant` instead of the @private comment: https://gist.github.com/phaul/1d36018bf925bd212c64671a5ca20217#file-sudoku-rb-L20
[18:35:23] havenwood: phaul: https://www.rubydoc.info/gems/yard/file/docs/Tags.md#private
[18:35:46] mostlybadfly: has joined #ruby
[18:37:03] havenwood: phaul: I prefer `__method__` to `:rows` so you can change the method name without changing the symbol - but I could see not liking that too: https://gist.github.com/phaul/1d36018bf925bd212c64671a5ca20217#file-sudoku-rb-L26
[18:38:24] phaul: havenwood: I am looking into those, thanks
[18:38:47] lxsameer: has joined #ruby
[18:40:28] phaul: &ri private_constant
[18:40:29] rubydoc: https://ruby-doc.org/core-2.5.3/Module.html#method-i-private_constant
[18:43:15] gnufied: has joined #ruby
[18:47:44] d^sh: has joined #ruby
[18:50:06] phaul: I have to say I need to relearn what private means, as private_constant makes 0 sense to me atm.
[18:51:00] phaul: private is that you can;t put explicit receiver on it, right? So what does that mean for a constant
[18:53:15] cpruitt: has joined #ruby
[18:55:32] tjarvis: has joined #ruby
[18:57:54] phaul: hm. interesting.
[18:58:25] phaul: &>> module A; X = 1; private_constant :X; end; A::X
[18:58:27] rubydoc: # => private constant A::X referenced (NameError) (https://carc.in/#/r/5trk)
[18:59:58] hutch: has joined #ruby
[19:00:39] cnsvc_: has joined #ruby
[19:02:12] havenwood: phaul: Yeah, it makes it inaccessible outside the class - unless you use metaprogramming, of course.
[19:03:04] havenwood: phaul: I'd say DRY these up with extract method: https://gist.github.com/phaul/1d36018bf925bd212c64671a5ca20217#file-sudoku-rb-L53
[19:05:34] havenwood: phaul: I'd say #size instead of #count, but you can just use #one? here: https://gist.github.com/phaul/1d36018bf925bd212c64671a5ca20217#file-sudoku-rb-L124
[19:06:29] havenwood: phaul: You can alias with #def_instance_delegator
[19:09:05] havenwood: phaul: #dup *just works*, so you don't need to implement it
[19:09:38] phaul: is that true for Set, Array instance vars too?
[19:09:48] phaul: if I need deep copy
[19:11:00] cthulchu: has joined #ruby
[19:11:11] havenwood: phaul: good point
[19:11:24] havenwood: phaul: makes me wonder if you should marshal dump and load
[19:11:35] havenwood: phaul: yeah, never mind me on that one
[19:14:53] phaul: the gnarly stuff comes in IterativeDeepening, so based on your reaction so far, I'm expecting a heart attack :)
[19:15:14] havenwood: phaul: haha
[19:17:17] akaiiro: has joined #ruby
[19:17:49] havenwood: phaul: I'd say `.flatten` or `.flatten(1)` in place of `inject(:+)` here: https://gist.github.com/phaul/1d36018bf925bd212c64671a5ca20217#file-sudoku-rb-L438
[19:21:50] tjarvis: has joined #ruby
[19:22:19] nowhere_man: has joined #ruby
[19:25:44] hutch: has joined #ruby
[19:25:47] tjarvis: has joined #ruby
[19:25:53] dviola: has joined #ruby
[19:26:00] beaky: has joined #ruby
[19:26:09] dbz_: has joined #ruby
[19:26:57] tjarvis: has joined #ruby
[19:29:07] tjarvis: has joined #ruby
[19:29:27] tjarvis: has joined #ruby
[19:29:46] themsay: has joined #ruby
[19:30:07] tjarvis: has joined #ruby
[19:37:08] dbz: has joined #ruby
[19:37:16] postmodern: has joined #ruby
[19:39:10] dbz: has joined #ruby
[19:44:00] dbz: has joined #ruby
[19:46:54] Inside: I should come here for code reviews too
[19:48:43] Inside: I'm serious
[19:48:55] Inside: those are pretty good comments
[19:48:57] Eiam: considering I pay people on my team to do code reviews
[19:49:07] Inside: I should write a small gem or something that can be easily reviewed
[19:49:12] Eiam: I'd find it mildly offensive to request free code reviews as an actual task =)
[19:49:43] Inside: think of it as an internship
[19:49:44] Zarthus: Eiam: I think so long you're friendly, you keep your usecase small and their time valued, it's a completely valid question
[19:49:53] Zarthus: If people aren't up to it, they will simply not answer.
[19:49:58] Inside: you raise the general knowledge and skill level of the industry
[19:50:00] Zarthus: But reading other's code is a good way to train yourself too.
[19:50:13] Eiam: Zarthus: not disputing it as a random thing, but as an actual like ongoing action to just have all your code get reviewed here?
[19:50:25] Zarthus: if you get all of it reviewed here, you've got problems :)
[19:50:39] Eiam: yeah, probably legal ones =)
[19:50:42] Zarthus: just make sure your code is presentable. a 500 line gist with no indentation is the rude part.
[19:51:16] WA9ACE: a 500 line gist with no indentation asking "please make this totally not my homework run"
[19:51:29] phaul: Zarthus: you are not talking about my gist, or is the indentation gone??
[19:51:45] Zarthus: phaul: General stupidity I see on IRC, I haven't looked at your code yet.
[19:51:51] Lytol: has joined #ruby
[19:51:58] phaul: ah ok. nm
[19:52:10] Zarthus: ha, it's almost 500 lines
[19:52:10] Inside: phaul: you're good <3
[19:52:16] Inside: it could also be homework :D
[19:52:25] WA9ACE: with things like slack communities and gitter I'm still surprised to see people making their way to IRC channels tbh
[19:52:34] Inside: IRC will be here long after slack
[19:52:41] WA9ACE: I hate both of those products with a passion
[19:52:48] Zarthus: Inline: Depends on if you mean "in popularity" or not.
[19:52:49] Inside: seriously slack..
[19:52:55] Inside: 1GB of RAM to.. run a chat app?!
[19:53:23] WA9ACE: Inline I pay for IRCCloud, they have an API level integration to Slack, and you can now connect to IRCCloud and treat it as a bouncer
[19:53:36] WA9ACE: so I'm connected to all my slacks from my IRC client again, even though they killed the IRC bridge
[19:53:36] Inside: inside c_C
[19:54:15] WA9ACE: yeah sorry, wrong ping
[19:58:48] Eiam: WA9ACE: when you go into an ios dev channel on slack its got 3000 people or more. good luck.
[19:59:17] Eiam: I know most the active people here and have seen and conversed with them off and on for years. hard to do that in slack groups that big
[19:59:45] WA9ACE: Eiam the go slack is 30k people
[19:59:49] WA9ACE: IRCCloud pooped itself
[20:00:03] Eiam: even ##javascript can get rough to follow, its 1111 people
[20:00:34] Inside: how is slack any different though?
[20:00:36] Zarthus: Eiam: the number'll grow smaller over the years :)
[20:01:08] Zarthus: FYI: irc is also being monopolized by a single entity.
[20:01:25] Eiam: whose that, Big OSS?
[20:01:32] Zarthus: PrivateInternetAccess
[20:02:08] Inside: because the whole point of IRC is that it's a chat relay...
[20:02:12] Zarthus: they already fund development of kiwiirc, inspircd, and servers for freenode and snoonet. the rest of the free time OSS devs won't keep up
[20:02:32] Zarthus: and when they withdraw that funding things are gonna suck.
[20:02:38] Zarthus: not like ircv3.com is moving at any pace at all
[20:02:49] Inside: IRC is also used as a backend for some games as well
[20:02:58] Inside: didn't Wow use IRC servers?
[20:03:04] Inside: also.. eve online?
[20:03:14] Zarthus: wow doesn't use irc, at least not in recent decades
[20:03:28] sameerynho: has joined #ruby
[20:03:41] Zarthus: Osu! does, and runescape had a SwiftKit which integrated irc
[20:03:52] WA9ACE: I'm pretty sure Twitch Chat is and IRCd written in Go
[20:04:03] Zarthus: WA9ACE: it's a fork of unrealircd (c), afaik
[20:04:13] WA9ACE: it got rewritten in 2015
[20:05:12] Zarthus: anyway, most networks are shrinking a lot
[20:05:23] Zarthus: irc is not in the most healthy state, and it's not gonna become better.
[20:05:55] cthulchu: has joined #ruby
[20:08:25] duckpuppy: has joined #ruby
[20:09:01] Guest49234: has joined #ruby
[20:09:57] dbz: has joined #ruby
[20:11:23] dbz_: has joined #ruby
[20:18:16] desnudopenguino: has joined #ruby
[20:19:01] holdenjd: has joined #ruby
[20:19:27] elphe: has joined #ruby
[20:24:01] Scrooge: has joined #ruby
[20:33:59] havenwood: nice, did_you_mean now detects typos with keywords in version 1.3
[20:34:06] havenwood: gem update did_you_mean
[20:34:11] havenwood: https://github.com/yuki24/did_you_mean/commit/2a082a71991f5afe2e27ce9538103eac4c428025
[20:34:45] Zarthus: havenwood, ironic, that feature has a typo in it
[20:34:46] Zarthus: # +VariableNameChecker::RB_RESERVED_WORDS+, those reserved words reqquires
[20:39:13] havenwood: Zarthus: And require there should be singular ¯\_(ツ)_/¯
[20:40:53] dbz: has joined #ruby
[20:41:06] Scrooge: is there something like arr1 & arr2, except it filters using a certain regex?
[20:41:33] dbz: has joined #ruby
[20:41:38] havenwood: Scrooge: arr1.grep(regex) & arr2.grep(regex)
[20:41:56] havenwood: Scrooge: or: (arr1 & arr2).grep(regex)
[20:42:14] Scrooge: the first one is perfect, thanks
[20:42:46] Scrooge: actually, i realized i asked my question wrong, but method 1 gave me an idea of how i can do it
[20:53:44] orbyt_: has joined #ruby
[21:04:03] SeepingN: has joined #ruby
[21:11:31] nowhere_man: has joined #ruby
[21:20:04] kspencer: So I'm pretty sure someone has already noticed this, but ruby-doc.org/core-2.5.*/Struct.html (I did put an asterisk in there because it affects 2.5.0-2.5.3)
[21:20:04] kspencer: But the documentation for Struct asks you to use a 'Customer' constant, which in affected versions of ruby will raise a Dynamic Constant Assignment Error
[21:20:04] kspencer: Which yes, I do know is not a bug, but a feature of 2.5.* but is a bug with the documentation documents. Just letting more people know
[21:21:33] miah: its not asking you to use a constant named Customer, its only using Customer as an example
[21:22:11] kspencer: right, but why show an example of it, if its going to cause an exception
[21:23:43] miah: i suspect you already have a Customer defined somewhere in your code. when I do this in pry it works fine.
[21:24:06] havenwood: kspencer: Which of the examples do you mean?
[21:24:51] havenwood: kspencer: The ::new example?
[21:25:23] havenwood: kspencer: https://ruby-doc.org/core/Struct.html#method-c-new
[21:25:32] kspencer: https://dpaste.de/Xkvo
[21:26:02] wolfshappen: has joined #ruby
[21:26:06] havenwood: kspencer: like miah said, that doesn't cause a warning
[21:26:36] havenwood: kspencer: (Unless you already have Customer defined.)
[21:27:01] havenwood: kspencer: Doing it twice in the same IRB session would cause a warning.
[21:27:38] havenwood: kspencer: There also shouldn't be anything 2.5-specific about it.
[21:29:27] kspencer: https://dpaste.de/ipEc
[21:29:33] kspencer: lines 11-24
[21:30:36] akaiiro: has joined #ruby
[21:31:16] kspencer: my problem is not with the code I have, its that the docs say its allowed in 2.5 when its not, before with 2.3 i'd get a warning but with 2.5 I'm getting an exception, with the docs, that's a bit of a issue when it says it would be allowed and not saying anything about it causing an exception
[21:33:02] orbyt_: has joined #ruby
[21:33:29] miah: can you show the exception?
[21:33:55] dbz_: has joined #ruby
[21:34:10] havenwood: kspencer: it seems you're defining your struct but never initializing one
[21:34:38] havenwood: kspencer: Like: Account.new
[21:34:40] themsay: has joined #ruby
[21:34:42] miah: also any time #account is called its creating a new Account
[21:35:26] havenwood: kspencer: https://gist.github.com/havenwood/afd1c2d64897ebc653d1735dbb8c5d7f
[21:35:40] kspencer: https://dpaste.de/Boz2
[21:35:41] havenwood: kspencer: Note, Account is the struct, not an instance of it.
[21:36:16] cthulchu: has joined #ruby
[21:36:30] havenwood: kspencer: each time you run that method, you redefine the constant - hence the error
[21:37:01] miah: you should define your struct outside of the #account method
[21:37:21] havenwood: kspencer: this wouldn't have worked in any version of Ruby though - it's not 2.5-specific
[21:37:46] miah: and then in your account method create a instance variable that holds a Account, eg `@account ||= Account.new`
[21:37:50] kspencer: pretty sure in 2.3 you'd get a warning but it would still work
[21:38:01] havenwood: kspencer: this wouldn't work in 2.3 ¯\_(ツ)_/¯
[21:38:23] havenwood: kspencer: try it!
[21:38:45] miah: oldest ruby i have installed is 2.4.0 so i cant validate =)
[21:38:51] kspencer: I only have 2.5.3 on my computer
[21:39:11] pwnd_nsfw: has joined #ruby
[21:39:29] Azure: has joined #ruby
[21:39:32] kspencer: and I don't use rvm or anything because it causes me too many problems with scope when i want something to use the full user etc.
[21:39:48] miah: (why i use chruby)
[21:39:50] havenwood: kspencer: It doesn't work on the 30 versions of Ruby I have on this computer. :P
[21:39:53] havenwood: (I also use chruby)
[21:40:07] kspencer: i may checkout chruby then
[21:40:39] miah: chruby + ruby-install
[21:42:29] za1b1tsu: has joined #ruby
[21:42:41] kspencer: will chruby play nice with rubymine?
[21:43:34] havenwood: kspencer: It does work. I'll remove the WIP: https://youtrack.jetbrains.com/issue/RUBY-14086
[21:44:04] havenwood: kspencer: Fixed
[21:44:05] miah: it should you just need to tell it the path to your ruby
[21:44:23] miah: i used it years back
[21:44:35] havenwood: now it should be automagical
[21:54:36] GodFather: has joined #ruby
[22:02:33] nowhere_man: has joined #ruby
[22:09:42] haylon: has joined #ruby
[22:09:50] bungled: has joined #ruby
[22:12:07] Exuma: has joined #ruby
[22:12:10] lucasb: has joined #ruby
[22:13:36] havenwood: A nice update on the CRuby JIT: https://medium.com/@k0kubun/ruby-2-6-jit-progress-and-future-84e0a830ecbf
[22:13:52] ellcs: has joined #ruby
[22:16:25] akem: has joined #ruby
[22:18:26] druonysus: has joined #ruby
[22:19:58] hutch: has joined #ruby
[22:23:50] blackmesa: has joined #ruby
[22:25:14] Puffball: has joined #ruby
[22:25:18] coderphive: has joined #ruby
[22:31:38] dbz: has joined #ruby
[22:31:43] cnsvc_: has joined #ruby
[22:32:32] cthulchu: has joined #ruby
[22:32:54] dbz_: has joined #ruby
[22:34:14] dbz_: has joined #ruby
[22:34:27] m0w: has joined #ruby
[22:35:14] dbz_: has joined #ruby
[22:35:33] orbyt_: has joined #ruby
[22:38:58] dbz: has joined #ruby
[23:00:30] cahoots: has joined #ruby
[23:06:06] EminenceHC: has joined #ruby
[23:12:11] cnsvc_: has joined #ruby
[23:19:56] orbyt_: has joined #ruby
[23:22:02] cahoots: hi, i want to get a base 2 number (as a string of 1's and 0's) approximating a decimal number (e.g. 0.1), with as many bits as i want. what's the easiest way to do this?
[23:27:13] hutch: has joined #ruby
[23:51:05] za1b1tsu: has joined #ruby
[23:56:43] Arkantos: has joined #ruby
[23:58:47] Arkantos: has joined #ruby