« Back to channel list

#ruby - 10 March 2017

« Back 1 day Forward 1 day »
[00:08:22] grant: has joined #ruby
[00:12:41] elifoster: has joined #ruby
[00:13:27] ResidentBiscuit: has joined #ruby
[00:14:30] jhack: has joined #ruby
[00:14:30] jhack: has joined #ruby
[00:15:02] esObe_: has joined #ruby
[00:18:00] cibs: has joined #ruby
[00:18:40] Ruby_Rocks_007: has joined #ruby
[00:21:27] elifoster: has joined #ruby
[00:22:06] tfitts: has joined #ruby
[00:24:06] rkazak_: has joined #ruby
[00:24:20] herbmillerjr: has joined #ruby
[00:25:40] jenrzzz: has joined #ruby
[00:25:50] jenrzzz: has joined #ruby
[00:26:29] jnoob22: has joined #ruby
[00:26:42] chouhoul_: has joined #ruby
[00:29:15] Nicmavr: has joined #ruby
[00:29:49] charliesome: has joined #ruby
[00:33:35] boombox_: has joined #ruby
[00:34:38] bg: has joined #ruby
[00:36:00] ramfjord_: has joined #ruby
[00:38:01] nobitanobi: has joined #ruby
[00:38:49] hlmjr: has joined #ruby
[00:40:02] Xiti: has joined #ruby
[00:43:43] hotpancakes: has joined #ruby
[00:46:53] herbmillerjr: has joined #ruby
[00:48:04] GSilva: has joined #ruby
[00:50:00] yusrideb: has joined #ruby
[00:53:37] lele: has joined #ruby
[00:54:40] nettoweb: has joined #ruby
[00:55:56] SteenJobs_: has joined #ruby
[00:56:19] tercenya: has joined #ruby
[00:57:37] ElDoggo: has joined #ruby
[00:59:35] pawnbox: has joined #ruby
[01:00:51] tildes_: has joined #ruby
[01:01:21] skweeke: has joined #ruby
[01:01:32] tercenya: has joined #ruby
[01:07:30] cdg: has joined #ruby
[01:08:01] hutch34: has joined #ruby
[01:10:27] cdg: has joined #ruby
[01:11:26] jhack: how does one become a 'specialist'?
[01:12:27] lupine: http://www.imdb.com/title/tt0110413/
[01:12:32] lupine: it's pretty much exactly like this
[01:12:54] bg: jhack: by watching rubytapas
[01:13:28] jhack: interesting... someone spoke about rubytapas today too
[01:13:49] jhack: lupine, brb gonna watch it now
[01:15:12] tercenya: has joined #ruby
[01:15:36] mula: has joined #ruby
[01:15:43] jhack: bg, how good is rubytapas
[01:15:52] bg: the best
[01:17:00] SteenJobs_: has joined #ruby
[01:17:06] jhack: it's not specific for webdev right?
[01:19:54] jhack: any thoughts on upcase?
[01:22:30] hutch34: has joined #ruby
[01:23:02] Ruby_Rocks_007: has joined #ruby
[01:26:26] Wolfpack_12: has joined #ruby
[01:27:11] zenguy_pc: has joined #ruby
[01:27:42] SteenJobs_: has joined #ruby
[01:29:21] pawnbox: has joined #ruby
[01:29:50] nofxx: has joined #ruby
[01:29:59] avdi: bg: thanks!
[01:30:27] bg: avdi: did you buy a subscription?
[01:31:57] AndBobsYourUncle: has joined #ruby
[01:33:16] avdi: bg: nah I get mine for free. 'course, I have to make the videos first, but after that I get them for free ;-)
[01:33:34] bg: ACTION feels stupid
[01:33:40] grant: has joined #ruby
[01:34:52] jeyraof^mbpr: has joined #ruby
[01:38:12] raspado: has joined #ruby
[01:41:20] jhack: wait a minute
[01:42:43] SteenJobs_: has joined #ruby
[01:43:38] sarbs: has joined #ruby
[01:44:11] herbmillerjr: has joined #ruby
[01:45:23] jhack: brb signing up now
[01:47:37] zenguy_pc: has joined #ruby
[01:48:13] certainty: has joined #ruby
[01:51:31] Channel6: has joined #ruby
[01:52:33] nofxx: has joined #ruby
[01:53:30] zenguy_pc: has joined #ruby
[01:53:47] harfangk: has joined #ruby
[01:55:56] Channel6: has joined #ruby
[01:59:09] pawnbox: has joined #ruby
[01:59:35] SteenJobs_: has joined #ruby
[02:01:23] baweaver: ACTION is amused that avdi probably highlighted rubytapas
[02:01:50] baweaver: ACTION wonders if Radar highlights r4ia
[02:02:04] zenguy_pc: has joined #ruby
[02:04:09] avdi: I have a strobe light and klaxons installed in every room of the house
[02:05:10] enterprisey: has joined #ruby
[02:07:50] statelesscode: has joined #ruby
[02:10:12] xall: has joined #ruby
[02:16:20] nowhere_man: has joined #ruby
[02:18:09] d0nn1e: has joined #ruby
[02:18:44] raspado: has joined #ruby
[02:19:17] raspado: has joined #ruby
[02:20:10] montanonic: has joined #ruby
[02:28:31] griffindy: has joined #ruby
[02:28:52] pawnbox: has joined #ruby
[02:30:13] d^sh: has joined #ruby
[02:31:42] ramfjord: has joined #ruby
[02:33:18] sleetdrop: has joined #ruby
[02:35:36] electrostat: has joined #ruby
[02:39:34] SteenJobs_: has joined #ruby
[02:43:10] ss_much: has joined #ruby
[02:47:09] SteenJobs_: has joined #ruby
[02:48:34] duderonomy: has joined #ruby
[02:48:38] hotpancakes: has joined #ruby
[02:48:59] pawnbox: has joined #ruby
[02:50:16] Yoncise: has joined #ruby
[02:51:05] cibs: has joined #ruby
[02:54:42] Rodya_: has joined #ruby
[02:56:31] Disavowed: Hey all. I've written an API library that wraps HTTParty. I want to test that the underlying HTTParty.post method receives the correct headers, but I'm a little bit mixed up as to how I would do this. I'm using rspec if that helps.
[02:56:54] Disavowed: Apologies for what is no doubt a stupid question, but it's Friday afternoon here and I'm not exactly firing on all cylinders.
[02:58:13] Yoncise: has left #ruby: ()
[02:59:44] ule: has joined #ruby
[03:03:21] jhack_: has joined #ruby
[03:04:40] Yoncise: has joined #ruby
[03:05:53] libastral: has joined #ruby
[03:12:26] duderonomy: has joined #ruby
[03:13:52] SteenJobs_: has joined #ruby
[03:13:57] rkazak_: has joined #ruby
[03:18:45] certainty: has joined #ruby
[03:18:46] pawnbox: has joined #ruby
[03:19:04] yusrideb: has joined #ruby
[03:19:34] hotpancakes: has joined #ruby
[03:20:37] astrobunny: has joined #ruby
[03:29:42] skweek: has joined #ruby
[03:32:15] nobitanobi: has joined #ruby
[03:34:18] allisio: Disavowed: Sounds like you want to contribute to HTTParty's test suite?
[03:35:09] Wolfpack_12: has joined #ruby
[03:36:25] Disavowed: allisio: Well I'm not against that, but all I really want to do is check that the underlying request from my API is sent with the correct headers. I feel like I'm missing something really obvious
[03:37:02] allisio: Disavowed: You're missing trust.
[03:37:35] Disavowed: The headers are passed as an argument to the httparty.post method, so I guess what I'm asking is how do I check if an argument is present in a method call?
[03:38:58] allisio: Again, HTTParty is a battle-tested library; you should put some measure of stock in its correctness.
[03:39:39] brent__: has joined #ruby
[03:39:43] Disavowed: allisio: I trust it fully. I'm trying to test my code is passing the correct headers to the underlying httparty post method.
[03:40:07] allisio: Disavowed: Does it do The Right Thing? If so, you are; if not, you're not.
[03:40:36] allisio: It really sounds like you want to include a test for HTTParty in your own thing's test suite, and that's just not the done thing.
[03:40:58] Disavowed: Let me do a pastebin because I feel like I'm not explaining this very well
[03:43:46] Disavowed: http://pastebin.com/18Smv36v <- hopefully this either explains what I'm trying to achieve or highlights some totally idiotic underlying assumption I have made.
[03:43:48] ruby[bot]: Disavowed: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/0ddf7e2745a596b1d5fbfbf2b3ad0b41
[03:43:50] ruby[bot]: Disavowed: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[03:46:17] maloik: has joined #ruby
[03:47:00] xall: has joined #ruby
[03:47:53] allisio: Disavowed: They are.
[03:49:06] allisio: HTTParty.post invokes HTTParty.perform_request, which passes the `options` Hash into `#process_headers`, which checks for the existence of a `:headers` key and responds accordingly.
[03:50:07] allisio: I'm sure HTTParty has tests for this in their own suite; it would be silly of you to duplicate that effort.
[03:53:47] Disavowed: allisio: I feel like I'm still not explaining what I am trying to do very well.
[03:54:47] Disavowed: I don't care what httparty.post does - indeed I plan to mock the method. All I care about is that the wrapper method send() is passing the headers to the HTTParty.post method, or a mock version thereof
[03:55:20] Jameser: has joined #ruby
[03:55:21] Disavowed: I need a reasonable guarantee that such basic functionality works. I am certain that HTTParty is battle tested and perfectly fit for purpose, but that isn't germane right now
[03:56:08] scott4000: has joined #ruby
[03:56:24] xMopxShell: has joined #ruby
[03:56:59] allisio: Disavowed: Do you test that your Classes respond to #new?
[03:58:10] pawnbox: has joined #ruby
[03:58:37] Disavowed: allisio: I do not
[03:58:40] Disavowed: Perhaps this is what I'm missing
[03:58:48] hfp_work: has joined #ruby
[03:59:01] Disavowed: You're saying that I should not test that my method passes the correct arguments to an underlying function?
[03:59:23] xall: has joined #ruby
[04:00:58] allisio: Disavowed: It strikes me as a perfectly useless test in this particular scenario.
[04:02:14] staticfox: has joined #ruby
[04:03:14] Disavowed: allisio: I'll defer to your experience but it sounds incredibly dangerous to me, because if a content-type header isn't passed, then the whole library is broken. I'm clearly missing some idealogical practice in my understanding of testing methodologies (I'm not from a Ruby background originally) - could you recommend any resources I should consume to better understand the landscape?
[04:04:15] allisio: Disavowed: Right, that gets closer to the heart of the thing: shouldn't you just be testing that `@headers` includes a reasonable value for the 'Content-Type' key?
[04:05:35] Disavowed: That's right! So I test for that initially. My concern is that if the code changed and I forgot to pass @headers to HTTParty.post, then I would have no test to catch that event. Does that make sense?
[04:07:22] matthewd: Disavowed: You want rspec-mocks
[04:07:48] allisio: Disavowed: And you can tell your mock to expect to receive some method call with some set of arguments: https://relishapp.com/rspec/rspec-mocks/v/3-2/docs/setting-constraints/matching-arguments
[04:08:33] arret: has joined #ruby
[04:08:53] Disavowed: matthewd: allisio: You two are absolute saints! Thank you so much for making sense of my garbled explanations! This is what I was playing with but I couldn't get it to work and assumed I was approaching the problem wrong. Thank you for setting me back on the right track!
[04:11:51] allisio: Disavowed: Glad to have been of some help. :)
[04:12:19] allisio: (I stand by my original conviction. :P)
[04:14:03] bmurt: has joined #ruby
[04:14:25] Disavowed: allisio: I really think I'm misunderstanding Ruby testing - I mean I wouldn't test a .new method (unless perhaps it had a reasonable degree of complexity in the function signature). I guess I just have to keep asking stupid questions!
[04:15:04] allisio: Disavowed: I specifically mentioned *responding* to #new in service of advising you to have at least a modicum of trust in the "system" to do what it's supposed to.
[04:15:14] allisio: You should of course test that complex instantiations work correctly.
[04:16:33] Disavowed: Regardless, thank you so much for your patience.
[04:17:59] ThereIsNoYeti: has joined #ruby
[04:18:16] pawnbox: has joined #ruby
[04:18:19] jackjackdripper: has joined #ruby
[04:18:56] skweek: has joined #ruby
[04:27:49] hotpancakes: has joined #ruby
[04:32:01] Channel6: has joined #ruby
[04:32:45] charliesome: has joined #ruby
[04:33:50] akkad: has joined #ruby
[04:35:35] hahuang65: has joined #ruby
[04:36:53] gix: has joined #ruby
[04:37:23] xall: has joined #ruby
[04:48:55] bg: is rubyconf harmful
[04:48:59] hutch34: has joined #ruby
[04:50:39] bg: i'm watching this guy fucking butcher his program in a talk called "Refactoring from Good to Great"
[04:51:59] bg: this guy has been drank Uncle Bob's kool-aid
[04:52:09] bg: s/drank/drinking/
[04:52:27] bg: it's honestly scary
[04:54:33] bg: 687 likes, 8 dislikes
[04:54:56] bg: i can't believe what i'm watching
[04:57:13] pawnbox: has joined #ruby
[04:58:30] marcdel: has joined #ruby
[04:59:50] akkad: has joined #ruby
[05:00:53] cibs: has joined #ruby
[05:03:18] morfin: has joined #ruby
[05:03:44] Ruby_Rocks_007: has joined #ruby
[05:03:55] morfin: returning to yesterday topic - i saw gems for JRuby which interface with plain Java libraries
[05:05:08] xall: has joined #ruby
[05:06:56] rkazak_: has joined #ruby
[05:10:18] ElDoggo: has joined #ruby
[05:13:32] SteenJobs_: has joined #ruby
[05:13:49] Guest3038: has joined #ruby
[05:13:55] ResidentBiscuit: has joined #ruby
[05:15:00] cschneid_: has joined #ruby
[05:16:03] hotpanca_: has joined #ruby
[05:16:25] anisha: has joined #ruby
[05:17:30] Chipwaver: has joined #ruby
[05:17:47] Chipwaver: has joined #ruby
[05:21:02] pulkit4tech: has joined #ruby
[05:22:18] squ: has joined #ruby
[05:23:34] marie1972: has joined #ruby
[05:23:35] marie1972: has left #ruby: ()
[05:24:11] bmurt: has joined #ruby
[05:24:17] patarr: has joined #ruby
[05:26:35] jeyraof^mbpr: has joined #ruby
[05:26:49] pliniker: has joined #ruby
[05:34:31] AndBobsYourUncle: has joined #ruby
[05:38:17] jackjackdripper: has joined #ruby
[05:38:42] jackjackdripper: has joined #ruby
[05:38:45] nobitanobi: has joined #ruby
[05:42:32] baffoon: has joined #ruby
[05:48:06] igniting: has joined #ruby
[05:48:44] rkazak_: has joined #ruby
[05:49:11] certainty: has joined #ruby
[05:56:33] R0B0: has joined #ruby
[05:56:54] aupadhye: has joined #ruby
[05:58:33] thebaffoon: has joined #ruby
[06:01:31] xall: has joined #ruby
[06:01:54] xcesariox: has joined #ruby
[06:03:28] tds: has joined #ruby
[06:03:37] thebaffoon: has joined #ruby
[06:06:16] Cesariox: has joined #ruby
[06:06:50] xcesariox: has joined #ruby
[06:12:12] _whitelogger: has joined #ruby
[06:16:30] djbkd: has joined #ruby
[06:19:34] grant: has joined #ruby
[06:21:24] AndBobsYourUncle: has joined #ruby
[06:25:57] Polysics: has joined #ruby
[06:30:08] R0B0: has joined #ruby
[06:31:13] R0B0: has joined #ruby
[06:39:19] pawnbox: has joined #ruby
[06:40:08] AndBobsYourUncle: has joined #ruby
[06:45:11] teclator: has joined #ruby
[06:45:23] tildes_: has joined #ruby
[06:47:23] bocaneri: has joined #ruby
[06:49:20] akkad: has joined #ruby
[06:49:47] hutch34: has joined #ruby
[06:54:20] solocshaw: has joined #ruby
[06:54:29] charliesome: has joined #ruby
[06:55:06] jackjackdripper1: has joined #ruby
[07:03:30] cibs: has joined #ruby
[07:05:22] aufi: has joined #ruby
[07:10:08] nOwz: has joined #ruby
[07:10:56] AndBobsYourUncle: has joined #ruby
[07:13:23] andikr: has joined #ruby
[07:14:51] ResidentBiscuit: has joined #ruby
[07:16:49] marcdel: has joined #ruby
[07:17:32] solocshaw: has joined #ruby
[07:18:49] rhyselsmore: has joined #ruby
[07:22:10] tomphp: has joined #ruby
[07:25:02] patarr: has joined #ruby
[07:27:39] last_staff: has joined #ruby
[07:36:03] pulkit4tech: has joined #ruby
[07:36:44] mmasaki: has joined #ruby
[07:39:27] nobitanobi: has joined #ruby
[07:41:50] Arpanet69: has joined #ruby
[07:43:28] dionysus69: has joined #ruby
[07:44:36] norbertka: has joined #ruby
[07:45:09] nOwz: has joined #ruby
[07:45:21] hotpancakes: has joined #ruby
[07:59:06] pawnbox: has joined #ruby
[08:00:03] jeyraof^mbpr: has joined #ruby
[08:02:00] hotpancakes: has joined #ruby
[08:05:43] nobitanobi: has joined #ruby
[08:06:03] nowhere_man: has joined #ruby
[08:06:44] sarbs: has joined #ruby
[08:09:01] toretore: has joined #ruby
[08:09:23] esObe_: has joined #ruby
[08:11:22] rkazak_: has joined #ruby
[08:14:40] aganov: has joined #ruby
[08:15:16] pawnbox: has joined #ruby
[08:19:40] certainty: has joined #ruby
[08:25:00] Polysics: has joined #ruby
[08:26:17] conta: has joined #ruby
[08:28:09] jackjackdripper: has joined #ruby
[08:28:15] MrSamuel: has joined #ruby
[08:32:43] pwnd_nsfw`: has joined #ruby
[08:34:59] jackjackdripper1: has joined #ruby
[08:36:37] snickers: has joined #ruby
[08:42:27] ledestin: has joined #ruby
[08:44:22] thebaffoon: has joined #ruby
[08:48:20] conta: has joined #ruby
[08:50:35] hutch34: has joined #ruby
[08:50:47] mark_66: has joined #ruby
[08:53:05] pawnbox: has joined #ruby
[08:53:06] byte512: has joined #ruby
[08:53:52] vondruch: has joined #ruby
[08:57:44] reaVer: has joined #ruby
[09:02:10] lenwood: has joined #ruby
[09:03:35] hotpancakes: has joined #ruby
[09:06:02] pandaant: has joined #ruby
[09:06:11] teclator: has joined #ruby
[09:06:38] manjaro-kde5: has joined #ruby
[09:07:33] MrSamuel: has left #ruby: ()
[09:08:24] armyriad: has joined #ruby
[09:10:12] ANdi`: has joined #ruby
[09:10:34] djbkd: has joined #ruby
[09:10:43] ANdi`: hello can someone please explain to me what https://github.com/maltesa/Rofi-Leo-Dictionary/blob/master/leo_search.rb line 39 and line 48 is doing?
[09:11:23] mikecmpbll: has joined #ruby
[09:11:54] dminuoso: andi_: line 39 fetches an XML document and builds a Nokogiri::XML document from it
[09:12:21] dminuoso: andi_: And 48 uses css selectors (think like jQuery) to search in that document
[09:12:43] dminuoso: http://www.nokogiri.org/tutorials/searching_a_xml_html_document.html
[09:13:31] cfec0b8d: has joined #ruby
[09:14:07] ANdi`: dminuoso: ok, ill read up that link, and tyvm for that quick explanation
[09:15:16] postmodern: has joined #ruby
[09:15:21] ResidentBiscuit: has joined #ruby
[09:15:26] pawnbox: has joined #ruby
[09:16:52] conta: has joined #ruby
[09:25:59] patarr: has joined #ruby
[09:26:54] xorgnak: has joined #ruby
[09:27:17] rolls: has joined #ruby
[09:29:35] dangerousdave: has joined #ruby
[09:30:36] schickung: has joined #ruby
[09:31:21] xorgnak: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[09:31:36] cschneid_: has joined #ruby
[09:31:44] flying: has joined #ruby
[09:44:58] burgestrand: has joined #ruby
[09:45:03] lxsameer: has joined #ruby
[09:48:03] chemelson: has joined #ruby
[09:50:06] chemelson: hi, is anybody home?
[09:51:04] jaruga__________: has joined #ruby
[09:56:11] anisha: has joined #ruby
[09:56:31] dminuoso: chemelson: No.
[09:56:45] czerasz: has joined #ruby
[09:57:46] chemelson: thanks dude
[09:57:51] dminuoso: I would like a reverse rockets syntax in Ruby
[09:58:05] dminuoso: so you can do { "a" => 1, 2 <= "b" }
[09:58:22] Arpanet69: has joined #ruby
[09:58:47] herwin: ArgumentError: comparison of Fixnum with String failed
[09:59:06] pawnbox: has joined #ruby
[09:59:13] dminuoso: herwin: upgrade to ruby 2.4
[09:59:31] ruby[bot]: dminuoso: I don't know anything about next
[09:59:34] dminuoso: ACTION kicks ruby[bot] 
[09:59:41] dminuoso: apeiros: can we also allow ruby[bot] to respond to ! commands?
[10:00:13] dminuoso: apeiros: Also a factoid for !next => "Another satified customer.. NEXT!!" ;o
[10:00:49] GSilva: has joined #ruby
[10:01:09] dminuoso: herwin: Im genuinely wondering whether you can parse this with LR(1)
[10:01:20] dminuoso: (Without triggering the ambiguity you implied)
[10:02:13] dstrunk: has joined #ruby
[10:04:56] certainty: has joined #ruby
[10:07:35] Beams: has joined #ruby
[10:10:37] CloCkWeRX: has joined #ruby
[10:11:35] kristofferR: has joined #ruby
[10:12:41] jeyraof^mbpr: has joined #ruby
[10:12:42] Vircung: has joined #ruby
[10:16:05] marr: has joined #ruby
[10:18:07] sarbs: has joined #ruby
[10:19:41] workmad3: has joined #ruby
[10:26:59] KicStart: has joined #ruby
[10:28:39] certainty: has joined #ruby
[10:32:44] kaffekoppen: has joined #ruby
[10:34:05] orvckb: has joined #ruby
[10:37:36] hotpancakes: has joined #ruby
[10:40:01] Cohedrin: has joined #ruby
[10:42:29] biberu: has joined #ruby
[10:44:21] Wolfpack_12: has joined #ruby
[10:45:25] sid_fules: has joined #ruby
[10:49:14] djbkd: has joined #ruby
[10:52:56] hutch34: has joined #ruby
[10:53:42] pawnbox: has joined #ruby
[10:53:46] ferr1: has joined #ruby
[10:57:16] pawnbox: has joined #ruby
[11:01:09] bkxd: has joined #ruby
[11:13:44] schickung: has joined #ruby
[11:15:50] ResidentBiscuit: has joined #ruby
[11:18:48] jenrzzz: has joined #ruby
[11:19:08] charliesome: has joined #ruby
[11:21:04] Tempesta: has joined #ruby
[11:21:17] pawnbox_: has joined #ruby
[11:21:40] certainty: has joined #ruby
[11:25:44] Terens: has joined #ruby
[11:26:32] patarr: has joined #ruby
[11:28:24] gnufied: has joined #ruby
[11:28:39] govg: has joined #ruby
[11:31:16] Terens: has joined #ruby
[11:33:37] hotpancakes: has joined #ruby
[11:34:32] JeanCarloMachado: has joined #ruby
[11:37:44] renchan: has joined #ruby
[11:47:35] Fernando-Basso: has joined #ruby
[11:52:10] ExcelTronic: has joined #ruby
[11:59:23] vali: has joined #ruby
[12:05:03] burgestrand: has joined #ruby
[12:06:13] Jameser: has joined #ruby
[12:09:59] pawnbox: has joined #ruby
[12:14:37] ResidentBiscuit: has joined #ruby
[12:18:05] ExcelTronic: has joined #ruby
[12:19:37] GSilva: has joined #ruby
[12:23:27] Beams: has joined #ruby
[12:24:37] jonjoe: has joined #ruby
[12:24:53] patarr: has joined #ruby
[12:27:24] cgfbee: has joined #ruby
[12:34:51] ldnunes: has joined #ruby
[12:41:46] d0nn1e: has joined #ruby
[12:43:26] tomphp: has joined #ruby
[12:45:28] csk: has joined #ruby
[12:46:00] psychicist__: has joined #ruby
[12:47:23] snickers: Can I create singleton object in rails that will exist in whole app, not only in single request?
[12:47:48] conta: has joined #ruby
[12:47:49] cpruitt: has joined #ruby
[12:47:50] czerasz: has joined #ruby
[12:49:48] lenwood: has joined #ruby
[12:53:06] KicStart: Snickers: You can, but unless you have good reason many people will dispute whether you should. Rails Logger is a good example, for more discussion... http://stackoverflow.com/questions/13313993/when-is-it-wise-to-use-singleton-classes-in-ruby
[12:53:40] hutch34: has joined #ruby
[12:54:28] polyzium: has joined #ruby
[12:54:29] polyzium: has joined #ruby
[12:55:37] resin: has joined #ruby
[12:55:43] snickers: my app will connect to external api, and i would like to have control on connection number.
[12:58:18] snickers: KicStart when i mix Singelton module to class i will have singleton object, but only in current request, or in whole app?
[13:00:46] cpruitt_: has joined #ruby
[13:00:51] nobitanobi: has joined #ruby
[13:06:34] norbertka: has joined #ruby
[13:06:36] t-recx: has joined #ruby
[13:10:40] sepp2k: has joined #ruby
[13:10:59] pragmaticus: has joined #ruby
[13:11:13] schickung: has joined #ruby
[13:11:17] KicStart: has joined #ruby
[13:11:21] KicStart: has left #ruby: ()
[13:11:26] allisio: dminuoso: That's fun.
[13:11:49] sid_fules: has joined #ruby
[13:12:01] hutch34: has joined #ruby
[13:17:06] burgestrand: has joined #ruby
[13:17:33] ElDoggo: has joined #ruby
[13:17:46] allisio: I was hoping there'd be a way to get in front of the syntax error with `core#hash_from_ary`, but that's not viable.
[13:18:01] allisio: And `['a' => 1, 2 <= 'b'].to_h` can't be used either. :/
[13:19:31] millerti: has joined #ruby
[13:20:38] bg: has joined #ruby
[13:24:46] xen0fon: has joined #ruby
[13:25:22] Xiti: has joined #ruby
[13:27:18] morfin: nolyc has that
[13:30:09] Silthias1: has joined #ruby
[13:31:49] polyzium: can i use nodejs libs in ruby
[13:32:03] polyzium: because i cannot find what i need in gem repos
[13:32:15] polyzium: but it's available in npm
[13:33:01] allisio: polyzium: Sort of: https://github.com/chancancode/javascript
[13:35:25] rippa: has joined #ruby
[13:41:12] elaptics: has joined #ruby
[13:41:42] hotpancakes: has joined #ruby
[13:42:48] tyang: has joined #ruby
[13:42:58] toretore: polyzium: what can't you find?
[13:43:15] polyzium: toretore, libopenmpt/libxmp/libmikmod.
[13:45:24] Jameser: has joined #ruby
[13:45:55] polyzium: toretore, nodejs has all of what i need, including these libs above
[13:46:00] toretore: wow, blast from the past
[13:46:10] bkxd: has joined #ruby
[13:46:17] toretore: why are you using ruby and not nodejs?
[13:46:23] itsautomatisch: has joined #ruby
[13:46:37] igniting: has joined #ruby
[13:46:40] polyzium: the reason is simplicity and some guy told me to learn it
[13:47:16] toretore: i foresee many problems in your future if you try to use node libs from ruby
[13:47:35] polyzium: k how about c libs?
[13:47:49] toretore: pulling that out of my ass, but that's my instinct
[13:47:56] toretore: c should be easier
[13:48:14] toretore: c -> js -> ruby < c -> ruby
[13:49:16] polyzium: toretore, less by what? performance?
[13:49:20] toretore: but if you don't have any particular reason to use ruby, and such a specific need for libraries, it could be better to use a language where support already exists
[13:49:36] toretore: just an unnecessary step
[13:50:00] toretore: and probably performance, as you'd have to use a js runtime
[13:50:40] ujjain: has joined #ruby
[13:50:40] ujjain: has joined #ruby
[13:50:53] polyzium: r.i.p. i cannot combine these
[13:52:03] polyzium: so i guess i should wait for someone making a binding for libopenmpt/libxmp/libmikmod or switch back to node
[13:52:25] toretore: it sounds like something python would have
[13:52:45] bmurt: has joined #ruby
[13:52:55] jamesaxl: has joined #ruby
[13:53:21] polyzium: toretore, there is a port of libxmp to python. but pip is a mess
[13:56:04] Jameser: has joined #ruby
[13:56:41] burgestrand: If you're very intent on using Ruby for whatever reason, and the API surface of the libraries you want to use is not too complex, then FFI is quite a nice experience for binding C libraries in Ruby.
[13:57:26] polyzium: lol i know nothing about c as i used node before ruby
[13:58:04] pragmaticus: has joined #ruby
[13:58:44] teddysmoker: has joined #ruby
[13:58:53] polyzium: but i'll take a look.
[14:01:23] troulouliou_div2: has joined #ruby
[14:01:25] millerti: has joined #ruby
[14:01:47] hutch34: has joined #ruby
[14:03:58] Jameser: has joined #ruby
[14:07:01] ebcz: has joined #ruby
[14:08:25] herwin: Burgestrand: you realize he's now going to load the V8 engine in ruby to run JS?
[14:09:17] charliesome: has joined #ruby
[14:09:59] burgestrand: herwin I didn't write anything about running JS within Ruby. :)
[14:10:24] jaruga__________: has joined #ruby
[14:12:04] minasploit: has joined #ruby
[14:12:28] bg: hi minasploit
[14:12:41] bg: im fantastic, thank you!
[14:12:45] bg: how are you?
[14:13:11] minasploit: good too... am new to irc anything i shud know?
[14:13:47] charliesome: has joined #ruby
[14:13:47] bg: you should know that the people in this channel are wonderful ^_______^
[14:14:12] jancsi: has joined #ruby
[14:14:37] minasploit: so shud we talk online about ruby or
[14:14:40] bg: and you should know that if you have a question, you will have to be patient
[14:14:43] ramortegui: has joined #ruby
[14:14:55] bg: people aren't always looking at irc so sometimes there will be like an hour or two with no activity
[14:15:23] minasploit: oww no problem... should questions only be about ruby?
[14:15:38] pawnbox: has joined #ruby
[14:15:46] allisio: Probably don't say "oww" if you're not in pain.
[14:15:57] griffindy: has joined #ruby
[14:16:24] jancsi: hi all! I have ruby 2.1.9 installed on my Gentoo machine. I'm trying to install whois-parser with "gem install whois-parser" but I'm getting an error, that the "activesupport-5.0.2" dependency requires ruby >= 2.2.2. Unfortunately, ruby 2.1.9 is the only stable version available on gentoo. In whois-parser's package file it says it needs activesupport >=4.0. Is there a way to force the gem installation to not to use activesupport >5 ?
[14:16:33] jancsi: Please note that I'm a first-day ruby guy here. :)
[14:16:44] pawnbox: has joined #ruby
[14:16:47] minasploit: has left #ruby: ()
[14:19:50] failshell: has joined #ruby
[14:21:55] bg: jancsi: how about u build mri from source like a real gentoo power user
[14:22:53] bg: u can pry (lol) ruby 2.4 from my cold dead hands
[14:23:04] leah2: jancsi: 2.1 is almost EOL'ed
[14:23:08] leah2: just unmask it :P
[14:23:12] allisio: jancsi: You mentioned you run Gentoo, and are now reaping your sown. :P
[14:23:19] baked__beans: has joined #ruby
[14:23:23] allisio: bg: What's wrong with 2.5?
[14:23:34] bg: ACTION goes to install 2.5
[14:23:46] allisio: I mean, you were the one who mentioned building from source?
[14:24:24] bg: i actually didn't, since homebrew has relatively new versions available
[14:24:36] bg: if my system package manager had 2.1.9 i'd build from source
[14:24:48] ResidentBiscuit: has joined #ruby
[14:24:50] s2013: has joined #ruby
[14:25:01] jancsi: sorry for asking, I'll go and flush myself down the toilet
[14:25:15] bg: jancsi: :s
[14:25:27] leah2: jancsi: you probably can install an older version of whois-parser as well else
[14:25:46] jancsi: no worries, I'll figure it out
[14:25:49] bg: jancsi: i luv u and i want u 2 enjoy the latest and greatest that ruby has to offer
[14:26:11] bg: i have ur best interests in mind
[14:26:50] allisio: jancsi: Clone the project, modify those ">= 4"s to be "~> 4", `gem build *.gemspec`, `gem install *.gem`.
[14:27:15] bg: allisio: do u watch rubyconf
[14:27:45] bg: like do u attend it or watch the videos online
[14:28:09] allisio: bg: I probably won't join you in your tirade against refactoring, if that's why you're asking. ;)
[14:28:27] bg: i'm not against refactoring... wtf
[14:28:42] bg: it's the *way* that this guy refactors
[14:28:58] bg: i just need someone to tell me if this is serious or if it's some kind of joke that is going over my head
[14:28:59] bg: https://www.youtube.com/watch?v=DC-pQPq0acs
[14:30:27] bg: also a question for you ruby gurus
[14:31:38] __Yiota: has joined #ruby
[14:31:48] jancsi: has left #ruby: ()
[14:31:51] polyzium: has left #ruby: ("Leaving")
[14:32:02] bg: def f a; a[0] + a[1]; end
[14:32:10] bg: def f (a, b); a + b; end
[14:32:48] bg: why are the parentheses around parameters optional when it causes this ambiguity with array-decomposition parameters
[14:34:57] matthewd: I never know how to answer a "why" question like that
[14:35:08] allisio: It should be ignored, ideally.
[14:35:16] bg: allisio: the question should be ignored?
[14:35:26] tobiasvl: why are any parentheses optional
[14:36:25] bg: it's a valid question
[14:36:42] bg: you should ignore it because it hints at a flaw in your favorite language?
[14:37:50] tobiasvl: how is precedence ambiguity a flaw
[14:38:01] tobiasvl: it exists in all languages that are not… lisp
[14:38:04] DLSteve_: has joined #ruby
[14:38:12] bg: it's not precedence ambiguity
[14:38:26] bg: what even is precedence ambiguity
[14:38:40] bg: if all operators have well-defined precedence and associativity, there's really no ambiguity
[14:38:57] tobiasvl: well, ambiguity to the programmer
[14:39:04] SteenJobs_: has joined #ruby
[14:39:14] snickers: has joined #ruby
[14:39:18] tobiasvl: surely there's no ambiguity for ruby, not with array-decomposition parameters either?
[14:39:28] millerti: has joined #ruby
[14:39:31] bg: that's right
[14:40:00] singularity42: has joined #ruby
[14:40:02] bg: this isn't a precedence thing though
[14:40:26] cdg: has joined #ruby
[14:40:47] bg: i wonder why [a, b] is not used for array-decomposition parameters
[14:41:01] bg: more intuitive and it solves this problem
[14:41:03] certainty: has joined #ruby
[14:41:13] hotpancakes: has joined #ruby
[14:41:44] acalycine: has joined #ruby
[14:41:47] jonjoe: has joined #ruby
[14:41:50] cdg: has joined #ruby
[14:41:52] matthewd: "why" again :/
[14:42:03] singularity42: hey all. can anyone direct me, or explain to me how in the world I use pipelines in ruby exec/system/backticks? I just get "command not found" any time I want to add a new pipe
[14:42:06] bg: what is wrong with asking why?
[14:42:27] bg: curiosity is frowned upon in the ruby community?
[14:42:50] bg: singularity42: yes because pipes are interpreted by the shell
[14:43:00] dminuoso: Do you folks feel like an exception constant should have the word "Error" in it?
[14:43:00] bg: exec('a | b') looks for a binary called 'a | b'
[14:43:17] singularity42: bg: right. so how do i chain commands?
[14:43:36] bg: try exec()ing /bin/sh sh or similar with the arguments -c 'a | b'
[14:43:50] bg: or use a richer interface to spawn multiple processes and handle the piping yourself
[14:44:07] dminuoso: singularity42: What do you mean by "chaining"
[14:44:11] matthewd: bg: The phrasing presupposes there's a different, more correct, option, and asks for a justification for it being done differently from that
[14:44:30] bg: matthewd: right
[14:44:42] bg: do you not feel [a, b] would be better?
[14:44:49] dminuoso: singularity42: If you use "exec", you can do exec("foo"); exec("bar"); ... :\
[14:45:05] dminuoso: bg: because Ruby is not Javascript.
[14:45:19] singularity42: bg: adding an additional layer of complication, this is for powershell commands. such as `powershell Get-NetAdapter | Get-NetIPAddress`
[14:45:26] dminuoso: 15:40 < bg> i wonder why [a, b] is not used for array-decomposition parameters
[14:45:26] matthewd: dminuoso: I generally prefer it, but if the name otherwise implies something sufficiently bad, I wouldn't feel strongly about it
[14:45:40] dminuoso: matthewd: UnknownPredicate bad enough?
[14:45:40] burgestrand: has joined #ruby
[14:46:09] matthewd: Yeah, I think Error on there would be superfluous, maybe even less clear
[14:46:38] jsaak: has joined #ruby
[14:46:41] singularity42: dminuoso: sorry, i mean piping, not chaining
[14:47:19] bg: what even are Get-NetAdapter and Get-NetIPAddress
[14:47:29] bg: are they actual programs or just functions inside of powershell
[14:47:39] singularity42: functions correct
[14:48:02] bg: then you can't even run them with exec(), let alone construct a pipeline out of them
[14:48:16] bg: you have to exec() powershell itself with some arguments the make it run a command line
[14:48:24] dminuoso: Interesting..
[14:48:37] dminuoso: >> [1,2].map &-> (e) { |a,b| }
[14:48:38] ruby[bot]: dminuoso: # => /tmp/execpad-13d72ebc0ce8/source-13d72ebc0ce8:2: syntax error, unexpected '|' ...check link for more (https://eval.in/752294)
[14:48:39] dminuoso: I like this.
[14:48:57] bg: u like errors?
[14:49:01] dminuoso: >> [1,2].map &-> (e) { p e }
[14:49:02] ruby[bot]: dminuoso: # => 1 ...check link for more (https://eval.in/752296)
[14:49:10] dminuoso: >> [1,2].map &-> (a,b,c) { p e }
[14:49:11] ruby[bot]: dminuoso: # => wrong number of arguments (given 1, expected 3) (ArgumentError) ...check link for more (https://eval.in/752297)
[14:49:14] dminuoso: bg: ^- this.
[14:49:17] singularity42: bg: ruby processes the first function without issue , i just cant do anyhing with it after that :( ive been trying literally for 2 work days to get some results
[14:49:20] Trynemjoel: has joined #ruby
[14:49:21] dminuoso: I should stop using blocks immediately.
[14:49:27] dminuoso: and procify lambdas instead.
[14:49:58] bg: dminuoso: what is &->
[14:50:03] dminuoso: bg: & is the to_proc operator
[14:50:47] singularity42: i dont see why it seems so complicated to send a basic command structure :(
[14:51:30] bg: singularity42: could you write a powershell script and run that from ruby?
[14:52:35] dminuoso: >> def f(l); l.each &-> (e) { if(e == 10); return; end }; puts "hooray"; end; f([1,10])
[14:52:36] ruby[bot]: dminuoso: # => hooray ...check link for more (https://eval.in/752299)
[14:52:42] dminuoso: >> def f(l); l.each { |e| if(e == 10); return; end }; puts "hooray"; end; f([1,10])
[14:52:43] ruby[bot]: dminuoso: # => nil (https://eval.in/752300)
[14:52:48] singularity42: bg: hmmm. that might be an idea. I cant use powershell cause the system I am passing the info to doesnt support structured data from powershell. but it does from ruby. so i am trying to do it through ruby. i didnt think of going that route though
[14:53:36] kernelPaniq: has joined #ruby
[14:54:03] bg: dminuoso: why didn't it print anything
[14:55:13] TomyWork: has joined #ruby
[14:55:16] bg: what is returning from in the first one
[14:55:27] bg: what is it returning from*
[14:57:23] tercenya: has joined #ruby
[14:57:49] bg: dminuoso: what is -> (e) { ... }
[14:59:11] bg: i don't understand what & is doing there
[14:59:37] bg: `-> (e) { 42 }` is a Proc
[15:00:05] bg: `&-> (e) { 42 }` is a syntax error on its own -- but i don't know why
[15:00:39] dminuoso: 15:59 < bg> `-> (e) { 42 }` is a Proc
[15:00:39] allisio: I do this weird thing where I assume people with very short nicks are competent netizens.
[15:00:42] dminuoso: bg: it is not.
[15:00:43] allisio: I guess I should probably stop.
[15:00:59] dminuoso: bg: It is a lambda,
[15:01:15] allisio: >> ->{}.is_a? Proc
[15:01:16] ruby[bot]: allisio: # => true (https://eval.in/752310)
[15:01:18] allisio: (Sorry. :P)
[15:01:24] dminuoso: Fine you make a valid point
[15:01:29] dminuoso: but it's a lambda Proc.
[15:01:29] leah2: never got why this -> syntax was added...
[15:01:39] dminuoso: leah2: 16:01 < dminuoso> but it's a lambda Proc.
[15:01:45] dminuoso: leah2: lambda{ |e| } is fugly
[15:01:50] leah2: it's just superfluous
[15:01:57] dminuoso: you prefer lambda{} ?
[15:01:57] leah2: and why are the parameters before the block
[15:02:08] leah2: but i started with 1.6, so ;)
[15:02:16] dminuoso: leah2: because almost all languages do that way too
[15:02:18] dminuoso: its much more consistent
[15:03:12] allisio: Is there a way to lambdafy a non-lambda Proc?
[15:03:31] bg: dminuoso: ok but you said & is the to_proc operator
[15:03:55] bg: so why is `&-> (e) { 4 }` invalid syntax
[15:04:02] leah2: because its not a call
[15:04:10] bg: allisio: How am I not a competent netizen?
[15:04:11] patarr: has joined #ruby
[15:04:34] leah2: bg: & is not a generic operator, but syntax for passing a lambda as a block
[15:04:35] dminuoso: bg: In this particular case it forces a proc into a block slot.
[15:05:02] bg: if it is used to pass things as blocks, why is it called to_proc?
[15:05:07] sid_fules: has joined #ruby
[15:05:20] dminuoso: bg: well technically there's implicit casting going on, and in doing that to_proc is called
[15:05:29] dminuoso: I guess its a valid point, & is not the to_proc operator
[15:05:38] dminuoso: but rather a "turn this proc into a block"
[15:05:40] leah2: >> ["foo", "bar", "baz"].map(&:reverse)
[15:05:41] ruby[bot]: leah2: # => ["oof", "rab", "zab"] (https://eval.in/752311)
[15:05:48] dminuoso: which will cast the thing into proc using to_proc if its not
[15:05:50] dminuoso: for example:
[15:05:51] allisio: It's "turn this into a Proc and then pass it as a block".
[15:05:52] leah2: using Symbol#to_proc
[15:05:56] dminuoso: >> :foo.to_proc
[15:05:57] ruby[bot]: dminuoso: # => #<Proc:0x41435c24(&:foo)> (https://eval.in/752312)
[15:06:35] dminuoso: so in fact &:foo is just shorthand for &:foo.to_proc
[15:06:39] FastJack: has joined #ruby
[15:06:42] bg: that's cool. i had seen &:foo before but i didn't know it was just Symbol#to_proc
[15:06:45] dminuoso: or conceptually its:
[15:06:48] dminuoso: :foo.to_proc.to_block
[15:07:02] dminuoso: bg: ^- I think this is the best explanation
[15:07:08] Pumukel: has joined #ruby
[15:07:10] dminuoso: except there is no to_block method ;-)
[15:07:35] conta: has joined #ruby
[15:07:41] bg: so & is special syntax used where a block is expected that lets you use anything with a to_proc method as a block?
[15:08:04] dminuoso: bg: and & also binds blocks to procs
[15:08:18] dminuoso: >> def foo(&something); puts something.class end; foo() {}
[15:08:19] ruby[bot]: dminuoso: # => Proc ...check link for more (https://eval.in/752314)
[15:08:34] dminuoso: so its basically a block<>proc conversion operator
[15:08:37] dminuoso: depending on where you use it
[15:08:39] allisio: >> class Fixnum; def to_proc; -> _ { self } end end; [1,2,3].map &42
[15:08:40] ruby[bot]: allisio: # => [42, 42, 42] (https://eval.in/752315)
[15:08:51] bg: allisio: Can you please tell me what I did wrong? I'd like to be a competent netizen but I can't if you don't communicate.
[15:09:18] Pumukel: has joined #ruby
[15:09:27] dminuoso: bg: One great purpose of using to_proc is in certain FP techniques. :-)
[15:09:44] allisio: dminuoso bg: & is the to_proc operator
[15:09:51] allisio: That struck me as ample Google fodder is all.
[15:10:20] bg: >> class Integer; def to_proc; -> k { k + self } end end; [1, 2, 3].map &42
[15:10:21] ruby[bot]: bg: # => [43, 44, 45] (https://eval.in/752316)
[15:10:37] dminuoso: allisio: 16:05 < dminuoso> I guess its a valid point, & is not the to_proc operator
[15:10:38] bg: I'm a Ruby god now.
[15:10:55] tercenya: has joined #ruby
[15:11:04] dminuoso: allisio: henceforth I shall call it the proc<>block conversion operator.
[15:11:24] allisio: dminuoso: It's very nearly that.
[15:12:27] allisio: Of course, looking at it that way reveals `&block` to be something of a misnomer, but there's no going back now.
[15:13:25] allisio: bg: `&+42` would've been godly.
[15:13:52] Trynemjoel: has joined #ruby
[15:14:30] dminuoso: allisio: Indeed.
[15:14:51] dminuoso: allisio: At this point I'm hoping for some new things added to the stdlib, such as:
[15:15:02] dminuoso: >> [1,10, "FOO"].all?(String)
[15:15:03] ruby[bot]: dminuoso: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/752320)
[15:15:23] dminuoso: Now that would be sexy. :-)
[15:15:26] agent_white: has joined #ruby
[15:15:41] allisio: That it would. ;)
[15:15:51] bg: what is unary +
[15:16:02] bg: it's not a method is it?
[15:16:06] dminuoso: allisio: Ox0dea made a feature request for this like 2 years ago, even with working patch..
[15:16:14] agent_white: Mornin' folks
[15:16:15] dminuoso: But nobu being nobu..
[15:16:18] allisio: It is a method.
[15:16:22] chouhoulis: has joined #ruby
[15:16:49] cagmz: has joined #ruby
[15:17:01] Ruby_Rocks_007: has joined #ruby
[15:17:28] bg: >> class Integer; def +@; -> k { k + self } end end; +32(10)
[15:17:29] ruby[bot]: bg: # => /tmp/execpad-5bc504cb91cf/source-5bc504cb91cf:2: syntax error, unexpected '(', expecting keyword_end ...check link for more (https://eval.in/752321)
[15:17:49] allisio: You have to say `32.+@(10)`, so best just to not.
[15:18:17] bg: oh, because '+32' is an integer literal?
[15:18:42] bg: oh you can't even call a proc with just () can you
[15:18:52] Rodya_: has joined #ruby
[15:19:06] allisio: There are four ways to call a Proc, but bare parens is (alas) not one of them.
[15:19:21] GSilva: has joined #ruby
[15:19:36] allisio: You can say `+(32)` to invoke `#+@`, but that doesn't let you pass arguments.
[15:20:32] MasterRex: has joined #ruby
[15:20:36] bg: >> class Integer; def +@; -> k { k + self } end end; (+(32)).call 10
[15:20:37] ruby[bot]: bg: # => 42 (https://eval.in/752322)
[15:20:59] allisio: >> class Integer; def call n; self + n end end; 32.(10)
[15:21:01] ruby[bot]: allisio: # => 42 (https://eval.in/752323)
[15:21:13] banisterfiend: has joined #ruby
[15:21:22] bg: morning agent_white
[15:29:55] certainty: has joined #ruby
[15:31:29] rkazak_: has joined #ruby
[15:32:44] renchan: has joined #ruby
[15:34:54] allisio: dminuoso: I twvtjia gxe dgfdtsk ex ia xbgmg tqpittl mucp. :)
[15:36:24] viuo: has joined #ruby
[15:37:38] certainty: has joined #ruby
[15:39:28] EV3RYDAYPR0GRESS: has joined #ruby
[15:42:17] allisio: It's Ithkuil.
[15:42:27] allisio: Or ROTrot, I forget which.
[15:44:29] norbertka: has joined #ruby
[15:46:06] hxegon: morning bg, morning all
[15:46:17] bg: hxegon: hi ^___^
[15:47:15] dminuoso: allisio: I just encode all my messages with RO26
[15:47:25] burgestrand: has joined #ruby
[15:47:41] allisio: dminuoso: 2ROT13 is top-shelf cryptographic technology.
[15:48:08] dminuoso: allisio: 2ROT13 is not as good as ROT26 though.
[15:48:13] Silthias1: has left #ruby: ()
[15:48:25] dminuoso: allisio: It's inefficient because it does its rotation twice.
[15:48:36] allisio: dminuoso: Optimizing compilers should handle that.
[15:49:09] shinnya: has joined #ruby
[15:49:15] Silthias: has joined #ruby
[15:49:16] dminuoso: allisio: alas.. MRI.. :(
[15:49:36] dminuoso: And dont get me started on Ruby 3.0 -> it will be years too late.
[15:50:18] bg: is ruby 3 going to be like python 3
[15:50:30] bg: and perl 6
[15:51:04] bg: so when 3.0 releases you expect most people will migrate right away?
[15:51:16] yeticry_: has joined #ruby
[15:51:47] matthewd: We had that hump moving on from 1.8
[15:51:52] jgnagy: has joined #ruby
[15:52:14] dminuoso: Today we had someone in #rubyonrails who was upgrading his rails 2 project...
[15:53:14] cajone: has left #ruby: ()
[15:55:48] chopin: has joined #ruby
[15:56:08] bruce_lee: has joined #ruby
[15:56:45] hxegon: I'd say that's in the minority though. Pretty sure I read somewhere that generally ruby people migrate to new versions pretty quickly
[15:57:13] bg: i love migrating
[15:57:28] bg: who doesn't want the latest and greatest
[15:58:33] raspado: has joined #ruby
[15:59:05] millerti: has joined #ruby
[16:00:10] nettoweb: has joined #ruby
[16:01:37] bg: Test = Module.new do def self.f; 42 end end
[16:02:11] bg: how did i not realize i was not typing in pry
[16:02:12] sid_fules: has joined #ruby
[16:03:12] cschneid_: has joined #ruby
[16:05:35] ResidentBiscuit: has joined #ruby
[16:09:17] lenwood: has joined #ruby
[16:09:46] certainty: has joined #ruby
[16:12:29] Lord_of_Life: has joined #ruby
[16:13:33] ElDoggo: has joined #ruby
[16:15:39] allisio: dminuoso: My ROTrot implementation, anyway: https://eval.in/752354
[16:15:46] allisio: The gruesomeness is entirely deliberate, I swear.
[16:16:30] dminuoso: allisio: the output says its not rotrot
[16:16:35] dminuoso: the output says its rotrotshift
[16:16:56] tercenya: has joined #ruby
[16:16:58] allisio: It's good.
[16:17:10] dminuoso: allisio: under what license to you publish that code?
[16:17:19] dminuoso: my code editor is ready, waiting in insert (paste) mode
[16:17:21] jamesaxl: has joined #ruby
[16:17:27] allisio: dminuoso: Public domain so the French can't have it.
[16:17:57] dminuoso: allisio: Of course I shall rename that method to def enhance ...
[16:17:59] allisio: It parameterizes to unrotrot with alarming ease.
[16:18:22] dminuoso: Im trying really hard to have my code uploaded to thedailywtf some day.
[16:18:30] allisio: They like nesting there.
[16:19:38] dminuoso: allisio: I like your style. Let's see if you can do something more elaborate than this: https://eval.in/752356
[16:19:41] bg: ([:succ] * ((i += n) % 26)).reduce(c, :send)[-1]
[16:19:57] dminuoso: bg: It's amazing.
[16:20:27] ResidentBiscuit: has joined #ruby
[16:22:08] bg: TIL 'z'.succ == 'aa'
[16:22:12] allisio: It exposes that #succ should probably take an argument.
[16:22:16] cagmz: what does this do? ary1 = %i[a b]
[16:22:22] allisio: >> %i[a b]
[16:22:23] ruby[bot]: allisio: # => [:a, :b] (https://eval.in/752359)
[16:22:42] dangerousdave: has joined #ruby
[16:22:58] millerti: has joined #ruby
[16:23:28] bg: more like it exposes #succ is the wrong tool for the job
[16:23:33] matthewd: https://eval.in/752360
[16:23:52] matthewd: Doesn't really feel much better :/
[16:24:02] ych: has joined #ruby
[16:24:16] allisio: It doesn't handle uppercase and is therefore objectively worse. :P
[16:25:20] matthewd: Yeah, that's fair :)
[16:26:15] hxegon: Yall trying to summon satan again?
[16:26:16] allisio: String#<< can take codepoints, so it can probably be golfed down with a call to #bytes instead of #chars.
[16:27:09] hxegon: nvm, 0xOdea would have to be here
[16:28:18] matthewd: allisio: Oh, TIL
[16:28:43] matthewd: allisio: And you just knocked 2 characters off my solution to https://codefights.com/challenge/jzs6k2FedHaDfCWtv :)
[16:29:04] Alina-malina: has joined #ruby
[16:29:29] nobitanobi: has joined #ruby
[16:29:52] willardg: has joined #ruby
[16:30:03] willardg: has left #ruby: ()
[16:32:12] bg: how can you mutate locals inside of a block
[16:32:21] bg: the locals were defined outside the block
[16:32:50] allisio: For better or worse, blocks are not "scope gates".
[16:33:13] allisio: They probably should be, but what's done is done.
[16:33:15] allisio: matthewd: Nice.
[16:33:22] bg: doesn't that mean i should be able to mutate locals?
[16:33:51] matthewd: bg: Yes, you can set a local that was defined before the block, and it will retain the new value after the block
[16:34:14] bg: oh i can. i had another stupid mistake
[16:34:22] Beams_: has joined #ruby
[16:35:07] bg: https://eval.in/752388
[16:35:07] dionysus69: has joined #ruby
[16:35:32] brent__: has joined #ruby
[16:35:33] bg: ugh ignore that missing space before the brace
[16:35:36] bg: ACTION twitches
[16:36:10] certainty: has joined #ruby
[16:36:48] cajone: has joined #ruby
[16:37:17] brent__: has joined #ruby
[16:37:59] millerti: has joined #ruby
[16:40:16] matthewd: Yeah, I think #times is the way to go... https://eval.in/752400
[16:42:33] montanonic: has joined #ruby
[16:43:43] allisio: That looks hard to beat, and reminds me that a `.=` operator would be nice to have on occasion.
[16:44:55] bkxd: has joined #ruby
[16:45:26] hotpancakes: has joined #ruby
[16:45:43] baweaver: So what's the golf task?
[16:46:23] MasterRex: has joined #ruby
[16:46:30] baweaver: because String#tr would murder most ROT* tasks
[16:46:35] baweaver: &ri String#tr
[16:46:36] `derpy: http://ruby-doc.org/core-2.4.0/String.html#method-i-tr
[16:46:38] allisio: Not likely.
[16:46:47] allisio: You'd have to spend a lot of code setting up the translation tables.
[16:46:55] szulak_: has joined #ruby
[16:47:06] baweaver: where's the original problem?
[16:47:08] allisio: #rotrot should rotate the first character by 0, the second by 1, and so on.
[16:47:33] matthewd: baweaver: I tried: https://eval.in/752360
[16:47:51] matthewd: (and as allisio noted, that failed to handle uppercase)
[16:48:44] allisio: My original got up to all kinds of silliness, but I was quickly made aware of its verbosity: https://eval.in/752406
[16:49:16] baweaver: Huh, this is rather silly.
[16:49:21] allisio: You're rather silly.
[16:49:24] baweaver: naturally I'm going to spend hours on it
[16:50:21] allisio: I just really like `#reduce` with `:send`. :<
[16:51:35] jackjackdripper: has joined #ruby
[16:53:00] JeanCarloMachado: has joined #ruby
[16:54:30] allisio: matthewd: You can do away with the modulo in your solution, but it otherwise looks unbeatable barring some crazy bitwise sorcery.
[16:55:56] jaruga__________: has joined #ruby
[16:58:00] kernelPaniq: has joined #ruby
[16:58:09] millerti: has joined #ruby
[16:58:48] sid_fules: has joined #ruby
[16:58:52] tercenya: has joined #ruby
[17:00:20] raspado: has joined #ruby
[17:02:08] sid_fules: has joined #ruby
[17:02:31] JeanCarloMachado: has joined #ruby
[17:03:39] Alina-malina: has joined #ruby
[17:04:25] nobitanobi: has joined #ruby
[17:04:36] baweaver: matthewd / allisio: bytes
[17:04:49] allisio: baweaver: #succ nicely handles case.
[17:04:52] baweaver: s.bytes.reduce('') ...
[17:04:54] allisio: *String#succ
[17:05:21] baweaver: well so much for that savings
[17:05:43] allisio: And wraparound too, courtesy of the 'z' => 'aa' convenience.
[17:05:43] rex: has joined #ruby
[17:06:17] amclain: has joined #ruby
[17:07:39] Exuma: has joined #ruby
[17:07:50] gusrub: has joined #ruby
[17:08:54] xzhao: has joined #ruby
[17:09:15] tercenya: has joined #ruby
[17:09:19] baweaver: `s.gsub(/[a-z]/i)` to `s.downcase` -6
[17:09:27] baweaver: [-1] to [0] -1
[17:09:43] allisio: I thought there might be something about mutating a translation table as you chomp along the string, but the lack of slices makes that a non-starter.
[17:10:08] allisio: `'z'.succ.succ` needs to be 'b', not 'a'.
[17:10:14] allisio: Have you had your coffee? :P
[17:10:26] matthewd: downcase changes the output for uppercase inputs
[17:10:36] Beams: has joined #ruby
[17:11:06] baweaver: ACTION wanders off to get coffee
[17:12:03] SeepingN: has joined #ruby
[17:12:41] baweaver: gah, Ox0dea is offline.
[17:12:58] baweaver: they lurk in other channels on occasion.
[17:13:01] samdvr: has joined #ruby
[17:13:24] millerti: has joined #ruby
[17:13:43] BackEndCoder: has joined #ruby
[17:16:22] bg: has joined #ruby
[17:18:54] xzhao: has joined #ruby
[17:20:11] ElDoggo: has joined #ruby
[17:20:13] mula: has joined #ruby
[17:21:17] SteenJobs_: has joined #ruby
[17:25:43] jackjackdripper: has joined #ruby
[17:26:20] conta: has joined #ruby
[17:27:34] tercenya: has joined #ruby
[17:29:17] xzhao: has joined #ruby
[17:30:15] Alina-malina: has joined #ruby
[17:32:16] Alina-malina: has joined #ruby
[17:33:44] SteenJobs_: has joined #ruby
[17:37:19] djbkd: has joined #ruby
[17:43:10] ramfjord: has joined #ruby
[17:43:40] samdvr: has joined #ruby
[17:43:53] mula: has joined #ruby
[17:46:14] jaruga__________: has joined #ruby
[17:49:01] samdvr: has joined #ruby
[17:51:21] sid_fules: has joined #ruby
[17:52:06] mula: has joined #ruby
[17:54:34] rgiscard: has joined #ruby
[17:57:07] AndBobsYourUncle: has joined #ruby
[17:59:01] lxsameer: has joined #ruby
[17:59:07] tildes_: has joined #ruby
[18:02:11] willardg: has joined #ruby
[18:02:15] millerti: has joined #ruby
[18:04:14] gusrub: has joined #ruby
[18:04:30] brent__: has joined #ruby
[18:08:55] khaki: has joined #ruby
[18:09:18] gusrub: has joined #ruby
[18:11:46] kirun: has joined #ruby
[18:15:24] cgdub: has joined #ruby
[18:15:42] electrostat: has joined #ruby
[18:21:49] montanonic: has joined #ruby
[18:23:49] rex: has joined #ruby
[18:24:21] pifon: has joined #ruby
[18:26:17] hahuang65: has joined #ruby
[18:28:04] ramfjord: has joined #ruby
[18:32:03] redsandhand: has joined #ruby
[18:34:00] ramfjord_: has joined #ruby
[18:34:42] Ruby_Rocks_007: has joined #ruby
[18:35:03] bg: has joined #ruby
[18:36:59] tercenya: has joined #ruby
[18:39:06] antoniobeyah: has joined #ruby
[18:40:30] cdg: has joined #ruby
[18:41:37] hotpancakes: has joined #ruby
[18:42:34] dionysus69: has joined #ruby
[18:44:51] hahuang61: has joined #ruby
[18:46:23] renchan: has joined #ruby
[18:46:45] cdg: has joined #ruby
[18:47:25] duderonomy: has joined #ruby
[18:51:14] brent__: has joined #ruby
[18:51:37] brent__: has joined #ruby
[18:54:32] millerti: has joined #ruby
[18:57:14] patarr1: has joined #ruby
[19:00:17] ColeHub: has joined #ruby
[19:02:48] psychicist__: has joined #ruby
[19:04:00] Bob8989|2: has joined #ruby
[19:04:43] chouhoulis: has joined #ruby
[19:06:28] Tatou: has joined #ruby
[19:07:08] Tatou: Hi. In puppet you have these. What are these called in Ruby?
[19:07:24] Tatou: http://pastebin.com/WkP0s5vT
[19:07:26] ruby[bot]: Tatou: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/43029b3212f970bfb6de328a7afdf16d
[19:07:26] ruby[bot]: Tatou: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[19:08:00] allisio: Tatou: That's just calling a method with a Hash argument.
[19:08:24] elomatreb: Is it? That does not look like valid Ruby syntax
[19:08:37] Tatou: Is it not valid ruby syntax? That is what is confusing me..
[19:09:16] rex: has joined #ruby
[19:09:27] OldN0rse: has joined #ruby
[19:10:33] allisio: Tatou: Yeah, never mind. But then you'll have to clarify what you mean by "these".
[19:10:57] Tatou: allisio: That's how you declare things in a puppet manifest..
[19:11:08] Tatou: I was wondering if there is a name for such a thing in Ruby. Is that just valid ruby?
[19:11:23] allisio: Nah, there's a few things that make it syntactically invalid.
[19:11:33] allisio: It's meant to look a lot like Ruby, obviously, and you can get there with a bit of finagling.
[19:11:40] baweaver: Valid ruby would be: user {name: 'mitchell', ensure => present, ... }
[19:11:54] Tatou: Ok.. Well, I don't know if this is good news or not!
[19:11:57] cfec0b8d: has joined #ruby
[19:12:20] Tatou: I was trying to work out if I can make my own user style type, but with random fields
[19:12:46] szulak: has joined #ruby
[19:12:50] Tatou: In puppet?
[19:12:53] elomatreb: baweaver: Would it be valid? Wouldn't it think ensure is a keyword?
[19:13:01] JoshS: has joined #ruby
[19:13:16] baweaver: if it eval'd to true/false though
[19:13:22] baweaver: that's what I was half thinking
[19:13:35] TomyLobo: has joined #ruby
[19:13:40] millerti: has joined #ruby
[19:13:42] mula: has joined #ruby
[19:13:53] milardovich: has joined #ruby
[19:14:27] Eiam: has joined #ruby
[19:14:42] cek: Am I right saying that if attacker gains access to executing ruby code inside any of my class instance, I'm screwed.
[19:15:17] baweaver: If an attacker has any type of eval access to anything you're screwed
[19:15:20] elomatreb: If an attacker gains access to executing ruby code anywhere in not in a heavily sandboxed env, you're screwed
[19:15:32] baweaver: `sudo rm -rf /` and boom
[19:15:38] baweaver: DO NOT RUN THAT COMMAND IN RUBY
[19:15:43] allisio: It's safe.
[19:15:49] elomatreb: --no-preserve-root
[19:15:53] baweaver: that as well
[19:16:01] allisio: `rm -rf ~` is considerably more sinister.
[19:17:13] baweaver: If you have to ask, it's probably a bad idea for security.
[19:17:14] cek: they won't be able to access a secret in object not referenced and unreachable from within the context. I don't care about system being wiped. The question was about global object pointer table or alike, if such exists.
[19:17:27] allisio: cek: Yeah, ObjectSpace exists.
[19:17:34] elomatreb: You can't rely on access control for security, it's always bypassable
[19:17:34] allisio: You can get to anywhere from anywhere else in Ruby.
[19:17:42] cek: you have to understand ruby very well in order to answer my question.
[19:17:57] allisio: cek: Try to hide something in a Ruby program.
[19:18:04] allisio: I'll happily show you how to get to it.
[19:18:10] elomatreb: You can literally enumerate all current objects from anywhere
[19:18:15] cek: apeiros: what do you think?
[19:18:35] allisio: cek: Why not just accept my challenge?
[19:18:39] baweaver: ACTION grabs popcorn
[19:20:20] allisio: cek: In the final analysis, ObjectSpace + Fiddle makes it delightfully straightforward to get hold of every single live object in the system, and even some dead ones.
[19:20:45] allisio: You could stick your thing on FrozenCore or some such, but even that's not terra incognita.
[19:21:12] allisio: You have to understand Ruby very well in order to properly ask your question.
[19:21:19] hahuang65: has joined #ruby
[19:22:46] antoniobeyah: allisio: personal curiosity, what is Fiddle?
[19:23:07] allisio: antoniobeyah: The layer between Ruby and C is actually surprisingly thin, and Fiddle makes it all but disappear.
[19:23:18] hxegon: antoniobeyah: http://ruby-doc.org/stdlib-2.4.0/libdoc/fiddle/rdoc/Fiddle.html
[19:24:09] mwlang: has joined #ruby
[19:24:23] GSilva: has joined #ruby
[19:24:31] _joes__: has joined #ruby
[19:25:47] mula: has joined #ruby
[19:29:41] cdg: has joined #ruby
[19:31:36] allisio: cek: I was kinda hoping you'd play along. :/
[19:31:53] Arpanet69: has joined #ruby
[19:33:47] minimalism: has joined #ruby
[19:34:27] cek: debug & introspect features disabled, only basic libs present
[19:35:01] hotpancakes: has joined #ruby
[19:35:29] cek: no libffi and such, very basic and stripped setup.
[19:35:53] allisio: Moving the goalposts is generally an admission of defeat, for what that's worth.
[19:35:59] nofxx: has joined #ruby
[19:36:14] cek: Any other way to gain access to live objects / global pointer table ?
[19:36:14] allisio: ObjectSpace is available on boot and Fiddle is in the standard library.
[19:36:42] mula: has joined #ruby
[19:37:15] vali: has joined #ruby
[19:39:30] willardg: has joined #ruby
[19:39:53] cek: so no other method
[19:40:06] allisio: cek: Try to make some value inaccessible from some starting point.
[19:40:36] _joes__: has joined #ruby
[19:40:40] esObe__: has joined #ruby
[19:41:02] jphase: has joined #ruby
[19:41:19] cdg_: has joined #ruby
[19:41:28] allisio: I'd genuinely like to try to get there without the obvious approaches.
[19:41:39] allisio: But it becomes circumstantial in that case, so you'll need to post some code.
[19:42:04] esObe___: has joined #ruby
[19:42:37] pulkit4tech: has joined #ruby
[19:43:12] bkxd: has joined #ruby
[19:48:35] cek: >> puts (a = Object.new).object_id; def ctx; puts :need_a, a; end
[19:48:36] ruby[bot]: cek: # => 552578340 ...check link for more (https://eval.in/752577)
[19:51:32] psychicist__: has joined #ruby
[19:52:56] allisio: cek: https://eval.in/752579
[19:54:35] cek: they introduced BEGIN? is that perl now?
[19:54:38] nadir: has joined #ruby
[19:56:00] allisio: Pretty sure it's been there from the beginning, but Perl borrowed it from AWK.
[19:56:07] xen0fon: has joined #ruby
[19:56:16] hxegon: Just to double check here, you BEGIN runs a block before anything else in the program, you patched Object to assign self to a global var?
[19:56:31] hxegon: s/you/your
[19:57:46] allisio: It's just a minimally demonstrative example of the theory.
[19:57:54] cek: never heard of BEGIN. Well, at this point I'm sure there exist additional ways of circumventing traditional encapsulation concept then.
[19:58:03] patarr: has joined #ruby
[19:58:12] allisio: In Ruby, everything is always open.
[19:58:27] allisio: If it's closed, you can open it with little more than a method call.
[19:58:35] cek: this is very, very daunting.
[19:59:15] elomatreb: Why would you want this though?
[19:59:40] allisio: If your thing involves letting the user run arbitrary Ruby code, there are battle-tested sandboxen at your disposal.
[19:59:47] allisio: You really don't want to home-grow something like that.
[20:00:15] cek: yes, that code is called dsl
[20:01:31] cek: it seems you have to write / use a parser instead of what you would normally accomplish with simple ruby dsl
[20:04:21] jackjackdripper1: has joined #ruby
[20:04:49] rex: has joined #ruby
[20:07:02] allisio: You haven't said much about what it is you're trying to do, but if your aim is to hide something from users of your library *within* that same library, definitely give it up as a fool's errand.
[20:07:48] chouhoulis: has joined #ruby
[20:09:55] Ruby_Rocks_007: has joined #ruby
[20:14:35] cvander: has joined #ruby
[20:16:36] cek: has left #ruby: ()
[20:16:49] millerti: has joined #ruby
[20:17:20] Silox|: has joined #ruby
[20:17:28] pabloh: has joined #ruby
[20:18:32] psychicist__: has joined #ruby
[20:23:13] johnny56: has joined #ruby
[20:23:27] ColeHub: has joined #ruby
[20:23:32] psychicist__: has joined #ruby
[20:23:35] tercenya: has joined #ruby
[20:24:06] elifoster: has joined #ruby
[20:28:53] tercenya: has joined #ruby
[20:29:47] johnny56: has joined #ruby
[20:31:15] chouhoul_: has joined #ruby
[20:32:43] aesthetikx: has joined #ruby
[20:35:24] tildes_: has joined #ruby
[20:37:27] aesthetikx: Does anyone know when 2.4.1 is going to come out, waiting to update but that weird instance_exec block argument thing is breaking my build
[20:39:24] dmin7b5: has joined #ruby
[20:39:26] dminuoso: aesthetikx: Can you link the bug?
[20:39:48] skweek: has joined #ruby
[20:40:03] dminuoso: aesthetikx: And if it breaks your build, then downgrade Ruby.
[20:40:13] aesthetikx: https://bugs.ruby-lang.org/issues/13074
[20:40:41] aesthetikx: we are still on 2.3.4, 2.4.0 has that which breaks some intersting usage of factory_girl
[20:40:57] aesthetikx: not a huge deal just curious because I have heard 2.4.0 has nice gc improvements
[20:43:14] dminuoso: aesthetikx: Then you have heard more than I have.
[20:45:49] hotpanca_: has joined #ruby
[20:46:39] millerti: has joined #ruby
[20:49:06] xzhao: has joined #ruby
[20:50:06] montanonic: has joined #ruby
[20:50:52] Xiti: has joined #ruby
[20:53:38] Jackneill: has joined #ruby
[20:57:07] milardovich: has joined #ruby
[20:57:48] patarr: has joined #ruby
[20:59:29] hxegon: Question: You find a gem that you need to make work because <business reasons>, and you are going to rely on it for mission critical tasks all the time. But the code is awful. It's complex, non-idiomatic, hardly readable semi-garbage. The test suite runs against some undocumented endpoint. Documentation is outdated at best, completely non-existant at worst. You aren't familiar with the problem domain, and
[20:59:35] hxegon: reading the code brings up more questions than answers. What do you do?
[21:00:12] Papierkorb: hxegon: Not use it
[21:00:22] allisio: But <business reasons>!
[21:01:15] Papierkorb: hxegon: If you're not comfortable using a certain library in general: Don't use it.
[21:01:39] hxegon: Papierkorb: If it were you, you'd rewrite it vs try to refactor?
[21:02:06] Papierkorb: hxegon: I can't tell you without context. both may be reasonable.
[21:02:27] dhollinger: has joined #ruby
[21:02:51] skweek: has joined #ruby
[21:04:10] baweaver: Indeed. Which gem specifically?
[21:04:37] hxegon: https://github.com/akretion/ooor
[21:05:28] hxegon: I was a little hard on it, there are spots that are decent, but...
[21:07:12] cek: has joined #ruby
[21:07:44] johnny56: has joined #ruby
[21:07:47] jamesaxl: has joined #ruby
[21:07:54] hxegon: just to give an approximate taste, sloccount gives it about 2000 lines of ruby, and rubocop gives lib/ 1368 offenses
[21:08:29] baweaver: ignore rubocop
[21:08:32] hxegon: Not that I try and adhear to rubocop strictly, but in this case
[21:08:47] baweaver: For a library, focus on structure and docs.
[21:09:02] baweaver: Rubocop gripes are worthless unless you intend to fix them everywhere
[21:09:22] Papierkorb: rubocop can be pretty nitpicky at times, especially if you don't adhere exactly to its ruleset (e.g. because you didn't use rubocop or because your rubocop.yml is outdated)
[21:09:25] baweaver: in this case they're skimpy on docs everywhere and don't know what SQL actually does in some areas.
[21:09:56] baweaver: TL;DR: Rubocop is not the law, don't get hung up on it when viewing someone elses code
[21:11:55] milardovich: has joined #ruby
[21:12:16] hxegon: the rubocop corrections are really needed honestly
[21:12:50] hutch34: has joined #ruby
[21:13:08] baweaver: because a lot of them are really nitpicky and worthless to worry about unless it's your codebase.
[21:13:16] cek: i now have totally forgotten closures in ruby. How do I unbind a proc and execute it in caller context, not the context it's been defined?
[21:13:41] hxegon: well for example the style rule that adds underscores to unused arguments helps, because they are all over the place
[21:13:47] hxegon: helps to know up front
[21:14:43] hxegon: making comments not start at the beginning of a line regardless of the surrounding indentation
[21:14:45] baweaver: don't get hung up on those. CodeClimate is a way better indication, and even that's not the best (see README)
[21:14:54] hxegon: again, many small improvements
[21:15:03] Papierkorb: cek: you're looking for instance_exec(&the_proc)
[21:15:13] baweaver: and it catches some interesting classes of issues
[21:15:18] cek: no, i'm not. that changes the self
[21:15:40] hxegon: A lot of it's stuff I'd end up doing myself anyway
[21:16:09] hxegon: changing normal strings from using " to '
[21:16:31] baweaver: again, really frivolous to worry over
[21:17:00] hxegon: not to worry over, these aren't the issues that matter, but I can just run it over the whole code base and it's a minor improvement
[21:17:23] baweaver: you should worry about things like Session login being ridiculously strongly coupled
[21:17:49] hxegon: Or the mind numbing demeter violations in errors
[21:17:56] baweaver: https://github.com/akretion/ooor/blob/master/lib/ooor/session.rb#L51
[21:18:25] baweaver: One thing to remember here though: building your own is a support liability. Make dead sure you can support it.
[21:18:42] baweaver: that, and this gem is made by the official owners of this engine
[21:19:07] Tatou: has left #ruby: ()
[21:24:55] cek: seems I missed the difference in instance_exec{ proc[] } vs instance_exec(&proc)
[21:25:57] patarr: has joined #ruby
[21:26:04] bg: has joined #ruby
[21:27:52] milardovich: has joined #ruby
[21:28:55] cek: it's sad docs don't specifically mention the proc pass mode and try to emphasize on {|var| block } instead.
[21:31:49] szulak: has joined #ruby
[21:34:28] bg: cek: what does that mean
[21:35:06] cek: bg: best answer would be http://blog.bigbinary.com/2010/05/28/instance-exec-changing-self-and-parameters-to-proc.html
[21:36:33] oryman: has joined #ruby
[21:37:18] cek: docs say: > Executes the given block within the context of the receiver ..., the variable self is set to obj while the code is executing,
[21:37:55] cek: so you'd expect your { tproc.call } would be executed in self context, but it isn't , because it will be executed in tproc's defining context
[21:39:01] Wolfpack_12: has joined #ruby
[21:39:55] hxegon: probably right baweaver, hate to admit it. I'd *like* to rewrite, but realistically I don't think it's an option given my time constraints.
[21:40:27] baweaver: The fact of the matter is that a lot of things we use are ducttape. Ignorance is bliss and whatnot.
[21:43:31] hxegon: I'd like to ignore as much as possible, but It's going to be to critical to operations to try and sweep under the rug. Once we get going downtime would be really bad
[21:46:59] djbkd: has joined #ruby
[21:46:59] Lord_of_Life: has joined #ruby
[21:47:18] andrevan: has joined #ruby
[21:48:02] banisterfiend: has joined #ruby
[21:48:12] vuoto: has joined #ruby
[21:50:11] dstrunk: has joined #ruby
[21:54:49] mula: has joined #ruby
[21:55:08] alibby: has joined #ruby
[21:55:10] djbkd: has joined #ruby
[21:55:30] Papierkorb: hxegon: IMHO the biggest improvement would then writing (additional) tests. Then you can somewhat safely refactor later on. But at least you're sure it at least works, or does not and you find a bug before you hit it in prod :)
[21:56:54] hxegon: Papierkorb: need to get the tests working first, but yeah :)
[21:58:01] SeepingN: has joined #ruby
[21:58:54] psychicist__: has joined #ruby
[22:03:34] djbkd: has joined #ruby
[22:04:12] eclecticjohny: has joined #ruby
[22:08:40] Asher: has joined #ruby
[22:10:57] dstrunk: has joined #ruby
[22:11:43] tomphp: has joined #ruby
[22:12:03] lianj: has joined #ruby
[22:12:03] lianj: has joined #ruby
[22:19:34] sid_fules: has joined #ruby
[22:20:49] resin: has joined #ruby
[22:21:45] electrostat: has joined #ruby
[22:26:15] JeanCarloMachado: has joined #ruby
[22:27:24] Trynemjoel: has joined #ruby
[22:27:41] mwlang: *sigh* … Every major macOS upgrade brings the dance of “how to install imagemagick and rmagick” and “how to install nokogiri” dance back to life.
[22:28:47] dminuoso: mwlang: use docker with an ubuntu base image?
[22:28:57] dminuoso: And never give a fuck again
[22:29:39] mwlang: dminuoso: funny you mention that…that’s essentially what I just did to get back to operational on Ruby 1.8.6 and 1.8.7. I guess it’s time to go all in.
[22:30:02] mwlang: I just haven’t because I have about 70 or so live projects I have to dockerize.
[22:30:41] dminuoso: mwlang: Then you definitely should approach it carefully, as you probably want to plan ahead with your CI chain, docker registry, etc.
[22:30:47] mwlang: and I probably need to invest in a 1TB SSD, too.
[22:31:23] mwlang: dminuoso: lots of moving parts, for sure.
[22:31:37] dstrunk: has joined #ruby
[22:32:40] mwlang: dminuoso: I’m curious though…isn’t there still a maintenance overhead maintaining the OS images? For example, installing the extension packs every where every time VirtualBox puts out a new release?
[22:33:01] zeroDi: has joined #ruby
[22:36:02] dminuoso: mwlang: and what does this have to do with VirtualBox?
[22:38:50] psychicist__: has joined #ruby
[22:39:10] dminuoso: mwlang: remember that the OS images are maintained by *other* folks.
[22:39:12] mwlang: dminuoso: woah, things have changed with docker. I just had docker lying around from a few years ago on coreos VM and cloned that puppy and got things running thatta way.
[22:39:28] mwlang: Didn’t know there’s a mac app now. :-o
[22:39:52] dminuoso: mwlang: there's just some subtle annoyances under mac.
[22:40:10] dminuoso: but other than that its install and it works.
[22:40:28] rex: has joined #ruby
[22:41:01] mwlang: ACTION going off to read up on “modern docker practices"
[22:41:29] dminuoso: mwlang: ship early, ship often!
[22:41:35] dminuoso: Oh wait. Wrong paradigm.
[22:42:05] pilne: has joined #ruby
[22:42:09] dminuoso: mwlang: Though honestly the girl analogy has helped me a lot with git.
[22:42:10] mwlang: I think the pardigm you’re looking for is “git widah program, already!”
[22:42:12] KnownSyntax_: has joined #ruby
[22:42:30] dminuoso: mwlang: Well, the git paradigm is: "treat git like girlfriends. commit early and commit often"
[22:43:46] dminuoso: Oh my. I just found this funny git joke
[22:43:53] dminuoso: A branch, a tag, and a reflog walk into a bar. The bartender says, "What is this, some sort of rebase?"
[22:44:24] evaleval: has joined #ruby
[22:44:49] dstrunk: has joined #ruby
[22:45:55] dminuoso: mwlang: This one I heard in #git a long while ago:
[22:45:57] evaleval: I'm using Resque to process some objects and part of the processing is to generate a unique slug (using friendly_id). Unfortunately, there are times when two processes check the db for the slug, see no one has it, and assign it which causes the second to fail.
[22:45:58] dminuoso: Git gets easier once you get the basic idea that branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space.
[22:46:06] pabloh: anyone here familiar with sequel?
[22:46:27] evaleval: I'm trying to figure out a sane solution. My thought was to queue to the objects up and process their slug one by one.
[22:46:33] Papierkorb: pabloh: just ask
[22:46:44] mwlang: ACTION uses sequel
[22:46:51] djbkd: has joined #ruby
[22:47:04] Papierkorb: ACTION thinks sequel is the best thing since sliced bread
[22:47:24] SeepingN: and almost as old
[22:47:33] mwlang: dminuoso: that’s about right…about how my mind blanks out when going through the nitty gritty of Ruby Net/…. libraries. :-)
[22:47:34] Papierkorb: it's actively developed
[22:47:44] pabloh: Papierkorb, mwkang, do you know any plugin, or functionality to do profiling?
[22:48:02] pabloh: I would like to count the number of queries during requests?
[22:48:14] mwlang: pabloh: I thought Sequel exposes profiling through #explain or something like that.
[22:48:38] dminuoso: That being said, I just found the simplest explanation on what a Monad is..
[22:48:43] dminuoso: All told, a monad in X is just a monoid in the category of endofunctors of X, with product × replaced by composition of endofunctors and unit set by the identity endofunctor.
[22:48:44] pabloh: and have tests to detect if a N+1 problem arises?
[22:49:10] baweaver: pabloh: that's called don't call it in a loop
[22:49:15] pabloh: like something like bullet
[22:49:25] pabloh: (and many others)
[22:49:31] pabloh: but for sequel
[22:50:06] pabloh: I would like to use (or write) a library like this one: https://github.com/brigade/db-query-matchers
[22:50:20] pabloh: (which only supports ActiveRecord)
[22:50:51] bmurt: has joined #ruby
[22:51:04] maattdd: has joined #ruby
[22:51:29] Papierkorb: pabloh: can't find something right now. There's #sequel, getting an answer might take a while though
[22:52:03] pabloh: Papierkorb, I already asked there, maybe I could try the google group later
[22:52:15] pabloh: the mailing list I mean
[22:52:19] Papierkorb: pabloh: "take a while" = up to 24 hours
[22:53:25] mwlang: pabloh: that’s not really something writing test cases for are useful. Far better to just have console scrolling the log and spotting such scenarios while “useful” unit tests are running. Because once you fix it, the test becomes pretty worthless.
[22:53:39] Arpanet69: has joined #ruby
[22:54:17] mwlang: pabloh: just stay connected to the #sequel channel. Jeremy’s pretty frickin’ consistent about coming through with answers.
[22:54:34] mwlang: otherwise, post it on Stack Overflow.
[23:00:43] dstrunk: has joined #ruby
[23:01:57] a1fa: has joined #ruby
[23:03:34] montanonic: has joined #ruby
[23:04:09] tvw: has joined #ruby
[23:09:30] Arpanet69: has joined #ruby
[23:11:00] bg: do u guys have a favorite talk about ruby
[23:11:25] khaki: has joined #ruby
[23:11:29] bg: i'd love for u to share it with me
[23:12:09] raspado: has joined #ruby
[23:16:54] rgiscard: has joined #ruby
[23:18:09] adam12: bg: A lot of Sandi Metz's talks are good. You can find them on Youtube.
[23:19:13] allisio: bg: http://codon.com/programming-with-nothing
[23:21:36] postmodern: has joined #ruby
[23:23:11] bg: adam12, allisio: thanks!
[23:25:15] last_staff: has joined #ruby
[23:25:23] psychicist__: has joined #ruby
[23:26:04] Wolfpack_12: has joined #ruby
[23:26:56] Wolfpack_12: has joined #ruby
[23:27:50] abdulmugni: has joined #ruby
[23:27:55] Wolfpack_12: has joined #ruby
[23:28:32] Wolfpack_12: has joined #ruby
[23:29:12] Wolfpack_12: has joined #ruby
[23:30:51] psychici1t__: has joined #ruby
[23:31:13] pawnbox: has joined #ruby
[23:34:20] josh25: has joined #ruby
[23:46:50] josh25: As I iterate through and array, how would I correctly remove the current element if it equals a given value? http://pastebin.com/R32Rjhtq
[23:46:51] ruby[bot]: josh25: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/c5dd3adb8d9e69d3a51be657499d81c1
[23:46:51] ruby[bot]: josh25: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[23:48:34] millerti: has joined #ruby
[23:49:24] SeepingN: talk about terrible formatting. what's with the 8 space tabs
[23:49:53] SeepingN: oh they used real tabs so I guess I can blame the browser
[23:51:22] Semtex-H: has joined #ruby
[23:54:50] JeanCarloMachado: has joined #ruby
[23:55:30] jhack: has joined #ruby
[23:55:31] jhack: has joined #ruby
[23:57:16] cschneid_: has joined #ruby