« Back to channel list

#ruby - 24 August 2017

Forward 1 day »
[01:41:49] helpa: has joined #ruby
[01:42:31] gr33n7007h: Radar: a week
[01:42:40] ascarter: has joined #ruby
[01:44:12] aduabu: has joined #ruby
[01:44:48] AndBobsYourUncle: has joined #ruby
[01:46:15] gnufied: has joined #ruby
[01:46:17] bronson: has joined #ruby
[01:46:36] TinkerTyper: has joined #ruby
[01:48:34] canteen4: has joined #ruby
[01:49:25] ascarter: has joined #ruby
[01:52:03] goyox86_: has joined #ruby
[01:54:26] cdg: has joined #ruby
[01:56:50] aduabu: has joined #ruby
[01:57:38] TinkerTyper: has joined #ruby
[01:59:58] canteen4: has joined #ruby
[02:03:59] aduabu: has joined #ruby
[02:06:18] xuanrui: has joined #ruby
[02:07:08] canteen4: has joined #ruby
[02:09:38] canteen4: has joined #ruby
[02:11:13] aduabu: has joined #ruby
[02:14:35] canteen4: has joined #ruby
[02:15:28] alfiemax: has joined #ruby
[02:16:16] TinkerTyper: has joined #ruby
[02:18:20] alfiemax_: has joined #ruby
[02:23:13] aduabu: has joined #ruby
[02:23:45] Prgall: has joined #ruby
[02:26:16] canteen4: has joined #ruby
[02:27:17] xuanrui: has joined #ruby
[02:29:53] aduabu: has joined #ruby
[02:30:13] TinkerTyper: has joined #ruby
[02:33:30] canteen4: has joined #ruby
[02:34:58] slayman: has joined #ruby
[02:37:16] aduabu: has joined #ruby
[02:39:22] xuanrui: has joined #ruby
[02:40:13] canteen4: has joined #ruby
[02:41:13] TinkerTyper: has joined #ruby
[02:44:04] goyox86_: has joined #ruby
[02:46:34] DrCode: has joined #ruby
[02:48:28] aduabu: has joined #ruby
[02:50:21] mim1k: has joined #ruby
[02:51:12] pgal_pug: has joined #ruby
[02:52:13] TinkerTyper: has joined #ruby
[02:53:19] ShekharReddy: has joined #ruby
[02:55:10] canteen4: has joined #ruby
[02:57:39] aduabu: has joined #ruby
[02:59:42] pgal_pug: has joined #ruby
[03:00:04] canteen4: has joined #ruby
[03:00:08] cadillac_: has joined #ruby
[03:00:19] uZiel: has joined #ruby
[03:01:41] DrCode: has joined #ruby
[03:03:13] TinkerTyper: has joined #ruby
[03:04:48] guacamole: has joined #ruby
[03:04:52] sspreitz: has joined #ruby
[03:06:12] ledestin: has joined #ruby
[03:08:09] logicscience: has joined #ruby
[03:10:47] aduabu: has joined #ruby
[03:12:34] pgal_pug: has joined #ruby
[03:13:48] TinkerTyper: has joined #ruby
[03:14:02] canteen4: has joined #ruby
[03:15:03] nobitanobi: has joined #ruby
[03:17:43] aduabu: has joined #ruby
[03:21:02] canteen4: has joined #ruby
[03:24:48] TinkerTyper: has joined #ruby
[03:27:04] aduabu: has joined #ruby
[03:27:18] ascarter: has joined #ruby
[03:30:28] alfiemax: has joined #ruby
[03:30:41] canteen4: has joined #ruby
[03:34:22] aduabu: has joined #ruby
[03:35:48] TinkerTyper: has joined #ruby
[03:38:42] canteen4: has joined #ruby
[03:44:39] xuanrui: has joined #ruby
[03:46:06] emilford: has joined #ruby
[03:46:51] TinkerTyper: has joined #ruby
[03:46:51] gix: has joined #ruby
[03:47:37] bronson: has joined #ruby
[03:49:33] aduabu: has joined #ruby
[03:51:54] SqREL: has joined #ruby
[03:52:23] anisha: has joined #ruby
[03:52:53] canteen4: has joined #ruby
[03:55:18] aduabu: has joined #ruby
[03:56:34] ramfjord: has joined #ruby
[03:57:20] TinkerTyper: has joined #ruby
[03:57:43] nobitanobi: has joined #ruby
[03:59:16] canteen4: has joined #ruby
[04:02:32] aduabu: has joined #ruby
[04:03:06] SteenJobs: has joined #ruby
[04:04:47] xuanrui: has joined #ruby
[04:06:32] canteen4: has joined #ruby
[04:07:08] chouhoulis: has joined #ruby
[04:07:42] umaaji: has joined #ruby
[04:08:06] bkxd: has joined #ruby
[04:08:23] TinkerTyper: has joined #ruby
[04:08:23] mtkd: has joined #ruby
[04:15:27] aduabu: has joined #ruby
[04:18:08] kt: has joined #ruby
[04:18:56] jameydeorio: has joined #ruby
[04:19:23] TinkerTyper: has joined #ruby
[04:21:33] canteen4: has joined #ruby
[04:21:35] jameydeorio: I’ve got a class variable that stores all the objects it has created. I’m trying to write tests with minitest, but the class variable isn’t initialized between tests
[04:22:31] jameydeorio: So they end up failing in random orders when testing the length of that array, because the objects created between tests
[04:23:29] AnotherNick: has joined #ruby
[04:25:35] aduabu: has joined #ruby
[04:25:41] uZiel: has joined #ruby
[04:28:31] canteen4: has joined #ruby
[04:29:55] TinkerTyper: has joined #ruby
[04:30:10] jeremy: has joined #ruby
[04:34:03] jdrobertso: has joined #ruby
[04:35:36] aduabu: has joined #ruby
[04:35:58] unknownxunknown: has joined #ruby
[04:37:10] naprimer2: has joined #ruby
[04:40:55] TinkerTyper: has joined #ruby
[04:42:27] canteen4: has joined #ruby
[04:44:15] howdoi: has joined #ruby
[04:45:42] xuanrui: has joined #ruby
[04:48:28] aduabu: has joined #ruby
[04:50:51] mim1k: has joined #ruby
[04:51:30] canteen4: has joined #ruby
[04:51:58] TinkerTyper: has joined #ruby
[04:55:13] aduabu: has joined #ruby
[04:57:38] SqREL: has joined #ruby
[04:58:45] canteen4: has joined #ruby
[05:00:55] MoskitoHero: has joined #ruby
[05:02:58] TinkerTyper: has joined #ruby
[05:04:30] aduabu: has joined #ruby
[05:07:10] sleepee: has joined #ruby
[05:08:21] fullstack: has joined #ruby
[05:10:25] canteen4: has joined #ruby
[05:12:09] Bock: has joined #ruby
[05:12:52] waveprop: has joined #ruby
[05:13:48] aduabu: has joined #ruby
[05:13:57] waveprop: i need ruby to print ascii 1-127 in hex notation, here's what i have so far: (1..127).each { |i| h = i.chr; puts h }.to_a
[05:14:31] waveprop: i did this a while ago using pack or unpack, i know there's a better way to get this into an array
[05:16:05] kies: has joined #ruby
[05:17:50] Radar: waveprop: 1.upto(127).map(&:chr)
[05:17:54] Radar: >> 1.upto(127).map(&:chr)
[05:18:00] ruby[bot]: Radar: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[05:18:07] Radar: ruby[bot]: <3 u 2
[05:18:13] waveprop: Radar: thank you!
[05:18:23] SqREL: has joined #ruby
[05:19:13] dionysus69: has joined #ruby
[05:20:04] waveprop: is there a way to force each chr to be represented as it's hex code
[05:20:13] waveprop: rather than just the non-printable ones
[05:20:13] TinkerTyper: has joined #ruby
[05:22:33] canteen4: has joined #ruby
[05:23:13] havenwood: waveprop: You want hex strings from "1" to "7f"?
[05:23:57] waveprop: waveprop: woops nope, \x00 through \xff
[05:26:17] patrontechnosoft: has joined #ruby
[05:26:31] jdrobertso: has joined #ruby
[05:28:00] cagomez: has joined #ruby
[05:29:10] nofxxx: has joined #ruby
[05:30:44] jdrobertso: has joined #ruby
[05:32:16] brent__: has joined #ruby
[05:32:43] enterprisey: has joined #ruby
[05:33:29] paranoicsan: has joined #ruby
[05:34:00] anas: has joined #ruby
[05:35:30] TinkerTyper: has joined #ruby
[05:36:02] xaxisx: has joined #ruby
[05:36:19] Lyubo1: has joined #ruby
[05:36:50] xuanrui: has joined #ruby
[05:39:34] aduabu: has joined #ruby
[05:40:47] ayonkhan: has joined #ruby
[05:41:18] biberu: has joined #ruby
[05:41:19] hhhh: has joined #ruby
[05:44:49] cschneid_: has joined #ruby
[05:45:36] sarbs: has joined #ruby
[05:46:31] TinkerTyper: has joined #ruby
[05:48:27] bronson: has joined #ruby
[05:49:11] waveprop: this is nearly what i want. i just need to find a way to get the .to_s(16) to left-pad the first sixteen hex-strings with a leading 0
[05:49:14] waveprop: (0..255).to_a.each { |i| print '\x'; print i.to_s(16).upcase }
[05:49:33] waveprop: >> (0..255).to_a.each { |i| print '\x'; print i.to_s(16).upcase }
[05:49:35] ruby[bot]: waveprop: # => \x0\x1\x2\x3\x4\x5\x6\x7\x8\x9\xA\xB\xC\xD\xE\xF\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C ...check link for more (https://eval.in/849377)
[05:54:35] canteen4: has joined #ruby
[05:55:28] cschneid_: has joined #ruby
[05:56:51] bkxd: has joined #ruby
[05:58:25] aduabu: has joined #ruby
[06:00:15] roshanavand: has joined #ruby
[06:00:28] aupadhye: has joined #ruby
[06:01:46] canteen4: has joined #ruby
[06:04:19] aduabu: has joined #ruby
[06:04:53] SqREL: has joined #ruby
[06:06:16] Radar: >> (0..255).to_a.each { |i| v = i.to_s(16).upcase; print (v.length == 1 ? '\x' + "0#{v}" : '\x' + "#{v}") }
[06:06:18] ruby[bot]: Radar: # => \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18 ...check link for more (https://eval.in/849379)
[06:06:20] Radar: Cheeky way ^
[06:06:55] Radar: >> (0..255).to_a.each { |i| v = i.to_s(16).upcase; print '\x' + (v.length == 1 ? "0#{v}" : v) }
[06:07:01] ruby[bot]: Radar: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[06:07:03] Radar: >> (0..255).to_a.each { |i| v = i.to_s(16).upcase; print '\x' + (v.length == 1 ? "0#{v}" : v) }
[06:07:08] ruby[bot]: Radar: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[06:07:19] Radar: ruby[bot]: E_COME_ON_BRO
[06:08:26] alfiemax: has joined #ruby
[06:08:33] TinkerTyper: has joined #ruby
[06:10:46] cdg: has joined #ruby
[06:12:07] waveprop: Radar: nice
[06:15:03] canteen4: has joined #ruby
[06:16:30] Radar: It's shorter than doing ljust at least.
[06:18:01] baweaver: >> (0..255).map { |i| '\x' + "0#{i.to_s(16).upcase}"[-2..-1] }.join
[06:18:02] ruby[bot]: baweaver: # => "\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0A\\x0B\\x0C\\x0D\\x0E\\x0F\\x10\\x11\\x12\\x1 ...check link for more (https://eval.in/849381)
[06:18:32] xuanrui: has joined #ruby
[06:18:37] baweaver: >> (0..255).map { |i| '\x' + "0#{i.to_s(16).upcase}".last(2) }.join
[06:18:39] ruby[bot]: baweaver: # => undefined method `last' for "00":String (NoMethodError) ...check link for more (https://eval.in/849382)
[06:18:49] baweaver: hrm... Rails methods, dangit
[06:18:51] aduabu: has joined #ruby
[06:19:36] TinkerTyper: has joined #ruby
[06:20:26] reber: has joined #ruby
[06:20:39] baweaver: >>(0..255).each{|i|print'\x'+"0#{i.to_s(16).upcase}"[/..$/]}
[06:20:44] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[06:20:46] SqREL: has joined #ruby
[06:20:57] baweaver: Radar: 1 2 3 4
[06:21:03] baweaver: I declare a codegolf war
[06:21:31] alfiemax: has joined #ruby
[06:21:43] Radar: Pft. You've missed an obvious win already.
[06:22:08] Radar: >> 0.upto(255) {|i|print'\x'+"0#{i.to_s(16).upcase}"[/..$/]}
[06:22:14] ruby[bot]: Radar: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[06:22:18] jameydeorio: has joined #ruby
[06:24:02] beilabs: has joined #ruby
[06:25:54] baweaver: >>0.upto(255){|i|print'\x'+"%02X"%i}
[06:25:55] ruby[bot]: baweaver: # => \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18 ...check link for more (https://eval.in/849383)
[06:26:36] ur5us: has joined #ruby
[06:26:49] baweaver: Radar: en garde
[06:27:09] baweaver: sprintf always has a few dirty tricks.
[06:27:20] baweaver: eam: care to join the fun?
[06:29:14] canteen4: has joined #ruby
[06:30:07] TinkerTyper: has joined #ruby
[06:30:25] baweaver: >>"\\x%02x"*255%[*0..255]
[06:30:27] ruby[bot]: baweaver: # => "\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\x0f\\x10\\x11\\x12\\x1 ...check link for more (https://eval.in/849384)
[06:30:36] baweaver: though double backslack
[06:31:14] baweaver: single throws hex escape errors
[06:31:24] roshanavand: has joined #ruby
[06:31:42] baweaver: Ah, uppercase X on that last one.
[06:32:05] baweaver: >>"\\x%02X"*255%[*0..255]
[06:32:06] ruby[bot]: baweaver: # => "\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0A\\x0B\\x0C\\x0D\\x0E\\x0F\\x10\\x11\\x12\\x1 ...check link for more (https://eval.in/849385)
[06:33:39] aduabu: has joined #ruby
[06:35:56] canteen4: has joined #ruby
[06:37:03] ur5us: has joined #ruby
[06:39:02] waveprop: baweaver: noice
[06:39:36] Radar: baweaver: concede
[06:39:52] conta: has joined #ruby
[06:41:41] ayonkhan_: has joined #ruby
[06:41:44] aduabu: has joined #ruby
[06:42:38] jackjackdripper: has joined #ruby
[06:42:41] Radar: baweaver: bravo :D
[06:43:06] baweaver: Channeling my inner Ox0dea
[06:43:10] andikr: has joined #ruby
[06:43:50] rabajaj: has joined #ruby
[06:44:10] jackjackdripper: has joined #ruby
[06:46:07] canteen4: has joined #ruby
[06:47:12] eroux: has joined #ruby
[06:50:07] aduabu: has joined #ruby
[06:51:18] mim1k: has joined #ruby
[06:52:10] TinkerTyper: has joined #ruby
[06:54:36] canteen4: has joined #ruby
[06:54:38] f48ds2: has joined #ruby
[06:54:47] xuanrui: has joined #ruby
[06:57:15] djbkd: has joined #ruby
[06:57:26] waveprop: how did that magic even work
[06:57:40] waveprop: what that % do
[06:57:48] aduabu: has joined #ruby
[07:02:05] canteen4: has joined #ruby
[07:02:19] Radar: Something something perl ancestry
[07:02:24] Radar: something something HOMETIMEEEE
[07:03:00] tsia: has joined #ruby
[07:03:10] TinkerTyper: has joined #ruby
[07:03:55] aufi: has joined #ruby
[07:04:40] beilabs: has joined #ruby
[07:06:37] waveprop: ive successfully avoided learning perl, went straight to ruby from sh+sed+awk+core_utils
[07:08:08] aduabu: has joined #ruby
[07:08:40] juggler: has joined #ruby
[07:09:41] ejnahc: has joined #ruby
[07:12:39] Ishido: has joined #ruby
[07:14:35] canteen4: has joined #ruby
[07:14:39] harfangk: has joined #ruby
[07:15:27] alfiemax: has joined #ruby
[07:18:36] aduabu: has joined #ruby
[07:19:41] Tempesta: has joined #ruby
[07:19:47] jamesaxl: has joined #ruby
[07:20:49] Tempesta: has joined #ruby
[07:21:38] marr: has joined #ruby
[07:22:23] ShalokShalom: has joined #ruby
[07:22:24] waveprop: i'll admit though, i feel like i'm missing something
[07:23:21] AnotherNick: has joined #ruby
[07:23:45] Silthias: has joined #ruby
[07:25:17] canteen4: has joined #ruby
[07:25:18] beilabs: has joined #ruby
[07:26:01] mark_66: has joined #ruby
[07:26:56] beilabs_: has joined #ruby
[07:26:58] jaruga: has joined #ruby
[07:29:10] aduabu: has joined #ruby
[07:31:17] waveprop: ACTION buys a perl book
[07:32:20] TinkerTyper: has joined #ruby
[07:35:04] canteen4: has joined #ruby
[07:36:50] jackjackdripper: has joined #ruby
[07:38:23] reber_: has joined #ruby
[07:38:41] aduabu: has joined #ruby
[07:39:18] xuanrui: has joined #ruby
[07:39:42] DTZUZO: has joined #ruby
[07:44:12] uZiel: has joined #ruby
[07:45:45] canteen4: has joined #ruby
[07:46:45] TinkerTyper: has joined #ruby
[07:48:19] xuanrui: has joined #ruby
[07:49:08] bronson: has joined #ruby
[07:49:23] njichev: has joined #ruby
[07:51:29] ayonkhan: has joined #ruby
[07:55:02] ur5us: has joined #ruby
[07:55:04] Alina-malina: has joined #ruby
[07:56:52] aduabu: has joined #ruby
[07:57:46] TinkerTyper: has joined #ruby
[07:58:05] Xiti`: has joined #ruby
[07:59:45] ryandv: has joined #ruby
[08:00:09] MoskitoHero: has joined #ruby
[08:00:46] reber: has joined #ruby
[08:00:48] ur5us: has joined #ruby
[08:01:00] workmad3: has joined #ruby
[08:02:14] bruno-: has joined #ruby
[08:02:51] cabotto: has joined #ruby
[08:05:14] gixxer1k: has joined #ruby
[08:06:01] tvw: has joined #ruby
[08:08:04] mikecmpbll: has joined #ruby
[08:08:48] TinkerTyper: has joined #ruby
[08:08:57] charliesome: has joined #ruby
[08:09:23] cdg: has joined #ruby
[08:10:54] canteen4: has joined #ruby
[08:11:16] cdg: has joined #ruby
[08:12:10] vondruch: has joined #ruby
[08:12:41] cdg_: has joined #ruby
[08:12:49] burgestrand: has joined #ruby
[08:13:26] frozengeek: has joined #ruby
[08:13:31] zapata: has joined #ruby
[08:14:39] djbkd: has joined #ruby
[08:16:20] MoskitoHero: has joined #ruby
[08:18:15] MoskitoHero: has joined #ruby
[08:18:37] xuanrui: has joined #ruby
[08:19:19] TinkerTyper: has joined #ruby
[08:20:08] alfiemax: has joined #ruby
[08:21:10] juggler: has joined #ruby
[08:22:00] MoskitoHero: has joined #ruby
[08:22:14] sysvalve: has joined #ruby
[08:22:22] cdg: has joined #ruby
[08:23:54] aduabu: has joined #ruby
[08:24:07] danbishop: has joined #ruby
[08:25:31] pugc: has joined #ruby
[08:26:06] jdrobertso: has joined #ruby
[08:26:31] canteen4: has joined #ruby
[08:28:04] lxsameer: has joined #ruby
[08:29:46] Defenestrate: has joined #ruby
[08:29:46] Defenestrate: has joined #ruby
[08:30:21] TinkerTyper: has joined #ruby
[08:32:52] aduabu: has joined #ruby
[08:33:15] Guest92766: has joined #ruby
[08:36:32] alfiemax: has joined #ruby
[08:36:33] canteen4: has joined #ruby
[08:36:35] InfinityFye: has joined #ruby
[08:39:28] MoskitoHero: has joined #ruby
[08:40:27] mtkd: has joined #ruby
[08:41:23] TinkerTyper: has joined #ruby
[08:42:56] aduabu: has joined #ruby
[08:43:14] pugc: has left #ruby: ()
[08:43:28] frozengeek: has joined #ruby
[08:44:24] rahul_bajaj: has joined #ruby
[08:46:53] uZiel: has joined #ruby
[08:46:59] canteen4: has joined #ruby
[08:49:29] mim1k: has joined #ruby
[08:50:23] aduabu: has joined #ruby
[08:50:58] linduxed: has joined #ruby
[08:52:48] thnee: has joined #ruby
[08:52:51] canteen4: has joined #ruby
[08:55:00] dionysus69: has joined #ruby
[08:55:08] frozengeek: has joined #ruby
[08:55:09] aduabu: has joined #ruby
[08:58:23] Cope: has joined #ruby
[08:58:51] TomyWork: has joined #ruby
[08:59:01] bruno-: has joined #ruby
[08:59:03] TinkerTyper: has joined #ruby
[09:00:29] rahul_bajaj: has joined #ruby
[09:01:42] gr33n7007h: has joined #ruby
[09:03:13] tomphp: has joined #ruby
[09:04:44] canteen4: has joined #ruby
[09:06:40] Cope_: has joined #ruby
[09:07:16] aduabu: has joined #ruby
[09:08:09] Mgtuiw211: has joined #ruby
[09:09:15] mim1k: has joined #ruby
[09:10:28] frozengeek: has joined #ruby
[09:12:01] sundhell: has joined #ruby
[09:12:03] njichev: has joined #ruby
[09:13:27] cdg: has joined #ruby
[09:13:34] canteen4: has joined #ruby
[09:13:56] beilabs: has joined #ruby
[09:17:06] aduabu: has joined #ruby
[09:17:07] marr: has joined #ruby
[09:20:28] TinkerTyper: has joined #ruby
[09:23:12] canteen4: has joined #ruby
[09:24:48] Sylario: has joined #ruby
[09:26:12] aduabu: has joined #ruby
[09:30:00] canteen4: has joined #ruby
[09:32:36] cagomez: has joined #ruby
[09:32:42] brent__: has joined #ruby
[09:33:00] aduabu: has joined #ruby
[09:35:08] canteen4: has joined #ruby
[09:38:23] aduabu: has joined #ruby
[09:38:52] alfiemax: has joined #ruby
[09:41:58] canteen4: has joined #ruby
[09:42:31] TinkerTyper: has joined #ruby
[09:42:48] alfiemax_: has joined #ruby
[09:43:05] Serpent7776: has joined #ruby
[09:44:59] cantom: has joined #ruby
[09:45:14] cantom: is there a ruby IDE wijth a good autocompletion support and how does that work without type annotations?
[09:46:46] aduabu: has joined #ruby
[09:49:09] canteen4: has joined #ruby
[09:51:26] bronson: has joined #ruby
[09:51:33] aduabu: has joined #ruby
[09:51:54] patronte_: has joined #ruby
[09:54:21] canteen4: has joined #ruby
[09:55:43] Tempesta: has joined #ruby
[09:56:39] darix: cantom: your bigger problem is meta programming. (think rails' find_by_columnname)
[09:56:44] Tempesta: has joined #ruby
[09:57:01] aduabu: has joined #ruby
[09:57:59] TinkerTyper: has joined #ruby
[09:59:23] gregf_: has joined #ruby
[09:59:31] samiux: has joined #ruby
[09:59:54] samiux: Hello, I'm having trouble understanding this strange array. https://gist.github.com/samimb/f6be105b0368506fbb59a99c63b5b27d
[10:00:00] cantom: darix: I see
[10:00:30] samiux: How do I access the other items. I would have thought item[0]["active_checks_enabled"]
[10:00:55] elomatreb: What you have there isn't an Array, it's a Hash
[10:01:00] shiru: has joined #ruby
[10:01:18] jamesaxl: has joined #ruby
[10:02:33] patronte_: has joined #ruby
[10:02:52] SqREL: has joined #ruby
[10:03:14] samiux: elomatreb: Ok, I'm still not able to access it's items. Wouldn't that mean I would be able to access item with item[0].active_checks_enabled?
[10:04:09] elomatreb: If you iterate over a Hash and your block only takes a single argument, you get an array of the form [key, value] for each entry
[10:04:33] elomatreb: You can change your block to take two parameters to get key, value as arguments
[10:05:12] darix: cantom: ruby mine seems good
[10:05:18] darix: (from jetbrains)
[10:05:52] cantom: darix: thanks
[10:07:08] patronte_: has joined #ruby
[10:07:56] umaaji: has joined #ruby
[10:08:28] TinkerTyper: has joined #ruby
[10:08:52] mim1k: has joined #ruby
[10:11:43] canteen4: has joined #ruby
[10:13:28] pandaant: has joined #ruby
[10:14:29] pinksandles: nice song darix
[10:14:33] patronte_: has joined #ruby
[10:14:42] darix: pinksandles: huh?
[10:14:59] pinksandles: https://www.youtube.com/watch?v=AlwYJiqVpy8
[10:15:40] bruno-_: has joined #ruby
[10:15:47] pinksandles: your real name or w/e has the same lyric from the song
[10:17:52] aduabu: has joined #ruby
[10:18:44] mim1k: has joined #ruby
[10:19:33] TinkerTyper: has joined #ruby
[10:22:16] canteen4: has joined #ruby
[10:22:50] roshanavand: has joined #ruby
[10:23:54] mim1k: has joined #ruby
[10:24:34] cadillac_: has joined #ruby
[10:25:42] ShalokShalom_: has joined #ruby
[10:25:56] DrCode: has joined #ruby
[10:26:39] quattro_: has joined #ruby
[10:27:42] quattro_: I’m having a problem with json parser in ruby, it’s triggering on this unexpected token at '{"_id":"566f634565689ecb098b5555","type":"http","host":null,"retry_data":null,"timeout":20,"down_from":1,"monitor":{"$oid":"555575ca88109e15a27e9663"},"co'
[10:27:59] lxsameer: has joined #ruby
[10:28:40] elomatreb: quattro_: Did your message get cut off?
[10:28:58] GodFather: has joined #ruby
[10:29:04] tacoboy: has joined #ruby
[10:29:23] quattro_: I don’t think it is but to be sure I’ll try to output the whole json string
[10:30:02] elomatreb: Because if it wasn't cut off it's pretty obvious where the error is
[10:30:27] patronte_: has joined #ruby
[10:30:34] TinkerTyper: has joined #ruby
[10:32:54] aduabu: has joined #ruby
[10:33:37] bkxd: has joined #ruby
[10:36:00] canteen4: has joined #ruby
[10:36:24] charliesome: has joined #ruby
[10:39:50] paranoicsan: has joined #ruby
[10:40:48] pinksandles: use gist.github.com
[10:40:58] pinksandles: your client might be protecting you from flood
[10:41:34] TinkerTyper: has joined #ruby
[10:44:11] aduabu: has joined #ruby
[10:47:30] canteen4: has joined #ruby
[10:51:12] aduabu: has joined #ruby
[10:54:08] alfiemax: has joined #ruby
[10:54:32] burgestrand: has joined #ruby
[10:54:32] canteen4: has joined #ruby
[10:57:17] mim1k: has joined #ruby
[10:58:21] nadir: has joined #ruby
[10:58:31] patronte_: has joined #ruby
[10:58:34] TinkerTyper: has joined #ruby
[11:00:28] aduabu: has joined #ruby
[11:02:56] alfiemax: has joined #ruby
[11:03:38] canteen4: has joined #ruby
[11:06:07] aduabu: has joined #ruby
[11:07:33] sepp2k: has joined #ruby
[11:09:48] canteen4: has joined #ruby
[11:12:33] gr33n7007h: has joined #ruby
[11:13:16] aduabu: has joined #ruby
[11:14:06] TinkerTyper: has joined #ruby
[11:17:37] canteen4: has joined #ruby
[11:18:45] Defenestrate: has joined #ruby
[11:19:31] cabotto: has joined #ruby
[11:20:55] xuanrui: has joined #ruby
[11:21:46] paranoicsan: has joined #ruby
[11:25:06] TinkerTyper: has joined #ruby
[11:25:10] gixxer1k: has joined #ruby
[11:26:39] vondruch: has joined #ruby
[11:28:59] aduabu: has joined #ruby
[11:32:06] vondruch: has joined #ruby
[11:32:25] canteen4: has joined #ruby
[11:34:11] harai: has joined #ruby
[11:36:10] TinkerTyper: has joined #ruby
[11:36:56] cagomez: has joined #ruby
[11:38:34] aduabu: has joined #ruby
[11:40:30] charliesome: has joined #ruby
[11:41:46] patronte_: has joined #ruby
[11:41:58] jinie: has joined #ruby
[11:44:23] canteen4: has joined #ruby
[11:46:58] adlerdias: has joined #ruby
[11:47:07] TinkerTyper: has joined #ruby
[11:47:32] aduabu: has joined #ruby
[11:47:46] alfiemax: has joined #ruby
[11:48:00] zenit: has joined #ruby
[11:48:50] alfiemax: has joined #ruby
[11:51:21] canteen4: has joined #ruby
[11:51:36] GorillaApe: has joined #ruby
[11:52:19] bronson: has joined #ruby
[11:55:34] clemens3: has joined #ruby
[11:57:38] TinkerTyper: has joined #ruby
[11:59:39] aduabu: has joined #ruby
[12:00:37] runescape07rsps: has joined #ruby
[12:02:24] mikecmpb_: has joined #ruby
[12:03:38] skweek: has joined #ruby
[12:03:58] anisha_: has joined #ruby
[12:04:39] SqREL: has joined #ruby
[12:08:43] TinkerTyper: has joined #ruby
[12:09:53] ldnunes: has joined #ruby
[12:12:16] canteen4: has joined #ruby
[12:13:33] xuanrui: has joined #ruby
[12:15:58] tobiasvl: aren't we all
[12:16:03] Alina-malina: has joined #ruby
[12:18:29] aduabu: has joined #ruby
[12:19:18] _sfiguser: has joined #ruby
[12:19:43] TinkerTyper: has joined #ruby
[12:20:46] bmurt: has joined #ruby
[12:21:38] mson: has joined #ruby
[12:21:48] ineb: iam text.
[12:25:33] canteen4: has joined #ruby
[12:26:21] __Yiota: has joined #ruby
[12:27:09] kapil___: has joined #ruby
[12:29:10] MrBismuth: has joined #ruby
[12:30:43] TinkerTyper: has joined #ruby
[12:31:05] xdc: has joined #ruby
[12:31:40] xaxisx_: has joined #ruby
[12:31:45] bmurt: has joined #ruby
[12:32:11] pinksandles: if only it were that simple.
[12:32:32] brent__: has joined #ruby
[12:33:15] selim: has joined #ruby
[12:36:49] high_fiver: has joined #ruby
[12:38:20] aduabu: has joined #ruby
[12:39:03] runescape07rsps: has joined #ruby
[12:40:18] tlaxkit: has joined #ruby
[12:41:14] TinkerTyper: has joined #ruby
[12:42:45] __Yiota: has joined #ruby
[12:42:46] canteen4: has joined #ruby
[12:43:23] skweek: has joined #ruby
[12:45:13] f48ds2: has joined #ruby
[12:45:23] SqREL: has joined #ruby
[12:45:49] chouhoulis: has joined #ruby
[12:47:39] t-recx: has joined #ruby
[12:47:41] bmurt: has joined #ruby
[12:48:41] rwb: has joined #ruby
[12:50:27] Bish: wow, i think i annoyed the channel with this problem already
[12:50:35] Bish: how do i get a reliably list of month from now backwords
[12:50:37] aduabu: has joined #ruby
[12:50:38] Bish: backwards
[12:50:50] Bish: i struggly pretty hard to find a reliable way
[12:51:33] Bish: no matter what i try, there is always a stupid mistake
[12:51:53] leah2: backwards to?
[12:52:07] Bish: leah2: no rails
[12:52:13] TinkerTyper: has joined #ruby
[12:52:24] leah2: that was a question
[12:52:38] Bish: oh i thought u meant like .backwards_to
[12:52:46] leah2: no, i wanted to know the end of the month list
[12:52:58] Bish: like obj.last_months(3) should give me the last 3 months
[12:54:19] Bish: (including the current)
[12:55:15] leah2: >> require 'date'; d=Date.today; (0...3).reverse_each.map { |i| (d << i).to_time }
[12:55:16] ruby[bot]: leah2: # => [2017-06-24 00:00:00 +0000, 2017-07-24 00:00:00 +0000, 2017-08-24 00:00:00 +0000] (https://eval.in/849723)
[12:55:47] Bish: the << operator does months?!
[12:55:57] Bish: ohgawd.. maybe i shouldve just read the docs
[12:56:02] leah2: but on Date, not Time
[12:56:07] Bish: yeah thats fine
[12:56:13] Bish: fucking around with date for like an hour
[12:56:23] leah2: also has .next_month tho :)
[12:57:31] harai: has joined #ruby
[13:01:52] canteen4: has joined #ruby
[13:03:18] TinkerTyper: has joined #ruby
[13:03:46] cdg: has joined #ruby
[13:04:34] storer: has joined #ruby
[13:05:09] guille-moe: has joined #ruby
[13:05:27] quiqua: has joined #ruby
[13:08:01] WeiJunLi: has joined #ruby
[13:10:25] aduabu: has joined #ruby
[13:10:30] tera_: has joined #ruby
[13:11:28] nowhere_man: has joined #ruby
[13:11:37] im314ous: has joined #ruby
[13:12:00] cdg_: has joined #ruby
[13:13:13] Bish: good lord, that was easy for real
[13:14:17] TinkerTyper: has joined #ruby
[13:16:18] mim1k: has joined #ruby
[13:19:07] canteen4: has joined #ruby
[13:19:15] haylon: has joined #ruby
[13:21:17] GorillaApe: show a leak ?
[13:21:19] GorillaApe: http://imgur.com/a/MmB0r
[13:22:17] aduabu: has joined #ruby
[13:23:38] jamesaxl: has joined #ruby
[13:23:43] Bish: well u mean these repeating spikes?
[13:23:49] Bish: i'd say thats gc
[13:24:01] Bish: it's not getting worse
[13:24:35] GorillaApe: it is slowly increasing though
[13:24:57] yokel: has joined #ruby
[13:26:31] canteen4: has joined #ruby
[13:29:27] ams__: has joined #ruby
[13:29:54] aduabu: has joined #ruby
[13:31:22] TinkerTyper: has joined #ruby
[13:32:29] pugc: has joined #ruby
[13:33:28] haylon: has joined #ruby
[13:35:59] canteen4: has joined #ruby
[13:37:33] apparition47: has joined #ruby
[13:38:22] paranoicsan: has joined #ruby
[13:38:54] mim1k: has joined #ruby
[13:39:31] aduabu: has joined #ruby
[13:40:45] cabotto: has joined #ruby
[13:43:44] canteen4: has joined #ruby
[13:46:46] dminuoso: GorillaApe: This could normal behavior if the old generation becomes larger
[13:46:50] TinkerTyper: has joined #ruby
[13:47:02] dminuoso: GorillaApe: You could test this by forcing a major GC and see what happens
[13:48:13] cabotto: has joined #ruby
[13:49:47] leah2: or memory fragmentation
[13:49:53] aduabu: has joined #ruby
[13:51:17] GorillaApe: I am running ruby 2.3.0
[13:53:00] bronson: has joined #ruby
[13:54:03] ryandv: has joined #ruby
[13:54:59] dminuoso: GorillaApe: Please update to 2.3.4 at least.
[13:55:13] GorillaApe: I would but I can't
[13:56:27] GorillaApe: I am not allowed to.
[13:56:45] ryandevilla: has joined #ruby
[13:57:50] TinkerTyper: has joined #ruby
[14:00:32] canteen4: has joined #ruby
[14:02:51] aduabu: has joined #ruby
[14:07:37] canteen4: has joined #ruby
[14:08:51] TinkerTyper: has joined #ruby
[14:10:19] al2o3-cr: has joined #ruby
[14:11:53] aduabu: has joined #ruby
[14:13:15] Rapture: has joined #ruby
[14:15:01] teh0xqb: has joined #ruby
[14:15:43] ldnunes: has joined #ruby
[14:18:09] canteen4: has joined #ruby
[14:19:28] TinkerTyper: has joined #ruby
[14:20:25] bruno-: has joined #ruby
[14:20:59] ResidentBiscuit: has joined #ruby
[14:21:45] Denommus: has joined #ruby
[14:21:55] Denommus: can I ask rbenv-related questions here?
[14:22:59] Denommus: rbenv is always creating an executable ~/.rbenv/shims/yarn when I call eval "$(rbenv init -)"
[14:23:12] Denommus: I don't have the yarn gem installed, though
[14:23:33] Denommus: so it is getting in the way of the yarn package manager
[14:23:57] Denommus: is there any other way an executable is intalled in a rbenv environment
[14:24:39] dionysus69: has joined #ruby
[14:27:25] aduabu: has joined #ruby
[14:27:26] InfinityFye: has joined #ruby
[14:27:59] smithascari: has joined #ruby
[14:28:28] Denommus: ... found it
[14:29:04] dminuoso: Glad I could help you.
[14:29:13] laphoraig92: has joined #ruby
[14:30:09] oleo: has joined #ruby
[14:30:25] TinkerTyper: has joined #ruby
[14:33:24] guille-moe: has joined #ruby
[14:34:55] canteen4: has joined #ruby
[14:37:31] aduabu: has joined #ruby
[14:37:54] Sambsquanch: has joined #ruby
[14:39:22] bronson: has joined #ruby
[14:40:12] canteen4: has joined #ruby
[14:41:28] TinkerTyper: has joined #ruby
[14:41:56] orbyt_: has joined #ruby
[14:44:18] aduabu: has joined #ruby
[14:47:03] konsolebox: what exactly is the site directory for?
[14:47:05] rippa: has joined #ruby
[14:48:17] konsolebox: e.g. /usr/share/ri/2.4.0/site
[14:48:46] canteen4: has joined #ruby
[14:50:19] aduabu: has joined #ruby
[14:52:25] TinkerTyper: has joined #ruby
[14:54:13] polishdub: has joined #ruby
[14:55:17] Denommus: only to be clear for everyone: my problem was with the rbenv-binstubs plugin
[14:56:57] canteen4: has joined #ruby
[14:59:30] mim1k: has joined #ruby
[15:00:00] aduabu: has joined #ruby
[15:03:29] TinkerTyper: has joined #ruby
[15:03:32] mark_66: has left #ruby: ("PART #elixir-lang :PART #crystal-lang :QUIT :Leaving.")
[15:06:07] canteen4: has joined #ruby
[15:06:39] cr3: has joined #ruby
[15:07:53] dviola: has joined #ruby
[15:08:24] cr3: is there a way to get more output when running `bundle install`, especially the part about building native extensions?
[15:10:20] aduabu: has joined #ruby
[15:11:33] cschneid_: has joined #ruby
[15:14:00] TinkerTyper: has joined #ruby
[15:14:45] goyox86_: has joined #ruby
[15:16:17] canteen4: has joined #ruby
[15:18:05] jamiejackson: has joined #ruby
[15:19:08] aduabu: has joined #ruby
[15:19:46] sekmo: has joined #ruby
[15:22:40] matthewd: cr3: Not as far as I know; you have to open the log file after it fails
[15:23:16] cr3: matthewd: I couldn't find the log file either, where should I look?
[15:23:26] dminuoso: cr3: Which native extension failed to build?
[15:23:34] matthewd: It should tell you when it fails :/
[15:23:57] matthewd: Gist whatever output you are getting?
[15:24:02] dminuoso: matthewd: I've had cases where it didn't. Is it possible that bundler has no control over building native extensions?
[15:24:36] cr3: matthewd: it doesn't fail though, I'd just like to visually inspect what happened.
[15:25:00] TinkerTyper: has joined #ruby
[15:25:51] WeiJunLi: has joined #ruby
[15:25:58] matthewd: cr3: /Users/matthew/.rbenv/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/pg-0.20.0
[15:26:37] dminuoso: Now we know your first name!
[15:27:14] matthewd: dminuoso: Strictly speaking, yes: bundler just calls rubygems.. but rubygems does have some degree of control*
[15:27:21] cr3: matthewd: perfect, I found a gem_make.out which is exactly what I was looking for
[15:27:41] matthewd: * assuming the gem follows the "normal" build process.. it *could* do anything it likes
[15:28:54] cr3: matthewd: actually, gem_make.out and gem.build_complete are empty :(
[15:29:09] matthewd: dminuoso: Extensions is actually my middle name
[15:29:39] FrostCandy: has joined #ruby
[15:29:43] chaugiang: has joined #ruby
[15:29:50] chaugiang: has left #ruby: ()
[15:30:00] cagomez: has joined #ruby
[15:30:58] FrostCandy: Brand new to Ruby, thrown on a project. Is there an obvious start page for a ruby program? So I can start tracing some logic? Like a Main() function or soemthing?
[15:31:12] matthewd: cr3: In that case, you might be hitting the above asterisk. Check the gem's extconf.rb to see what it actually does to build itself.
[15:31:16] bougyman: not necessarily, FrostCandy
[15:31:21] bougyman: what does the tree look like?
[15:31:22] FrostCandy: bougyman: ok thanks
[15:31:25] bougyman: what kind of program is it?
[15:31:41] bougyman: rails or other?
[15:32:01] bougyman: routes.rb is where i'd look to see what methods are exposed to the public.
[15:32:11] FrostCandy: ok great thanks, that's a start
[15:32:12] bougyman: though that can be abstracted so much as to not be helpful sometimes.
[15:32:20] bougyman: app/models should contain the business logic.
[15:32:30] dminuoso: FrostCandy: ?rails
[15:32:33] dminuoso: ?rails FrostCandy
[15:32:33] ruby[bot]: FrostCandy: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[15:33:00] bougyman: and app/controllers are where routes are dispatched to. methods in the controllers/ classes are, that is.
[15:33:08] matthewd: There isn't really a single entry point (in the application) in Rails, by its nature: that pretty much is the framework's job description
[15:33:23] dminuoso: Well I guess you could see Rack as a sort of entry point
[15:33:36] matthewd: But yeah, routes -> controllers -> models and/or database -> models, are probably the best points of inquiry
[15:34:31] nobitanobi: has joined #ruby
[15:34:35] matthewd: dminuoso: Okay yes, strictly speaking, the entry point is config.ru... but it basically just does "run the application now", not exactly the first crumb on a followable trail ;)
[15:34:52] canteen4: has joined #ruby
[15:36:04] TinkerTyper: has joined #ruby
[15:39:10] aduabu: has joined #ruby
[15:40:21] alfiemax: has joined #ruby
[15:41:01] goyox86_: has joined #ruby
[15:41:51] mikeric: has joined #ruby
[15:42:03] nobitanobi: has joined #ruby
[15:43:28] ryandevilla: has joined #ruby
[15:43:35] canteen4: has joined #ruby
[15:43:36] brent__: has joined #ruby
[15:45:34] gusrub: has joined #ruby
[15:47:03] TinkerTyper: has joined #ruby
[15:47:25] aduabu: has joined #ruby
[15:50:34] dionysus69: has joined #ruby
[15:51:36] mim1k: has joined #ruby
[15:52:06] jaruga_________: has joined #ruby
[15:52:54] bmurt: has joined #ruby
[15:55:34] canteen4: has joined #ruby
[15:58:02] TinkerTyper: has joined #ruby
[16:00:26] _sfiguser: has joined #ruby
[16:01:59] aduabu: has joined #ruby
[16:04:18] canteen4: has joined #ruby
[16:05:41] ShalokShalom: has joined #ruby
[16:06:47] aduabu: has joined #ruby
[16:08:36] TinkerTyper: has joined #ruby
[16:10:11] tycoon177: has joined #ruby
[16:11:03] smithascari: has joined #ruby
[16:11:30] tycoon177: I hate the idea of monkey-patching a gem, but i need to because no compatible versions of the gem include this fix. How would I go about monkey patching a gem before db:test:prepare? I'd rather avoid doing so in any other case
[16:13:33] canteen4: has joined #ruby
[16:14:44] quattro_: has joined #ruby
[16:16:28] orbyt_: has joined #ruby
[16:17:23] havenwood: tycoon177: Could you use a refinement instead?
[16:17:29] tycoon177: refinement?
[16:17:49] havenwood: tycoon177: https://ruby-doc.org/core-2.4.1/doc/syntax/refinements_rdoc.html
[16:17:54] goyox86_: has joined #ruby
[16:19:01] goyox86_: has joined #ruby
[16:19:23] tycoon177: how would i use that in rake db:test:prepare? i figured out the monkey patch by putting it in my Rakefile (i still don't like it, but it works)
[16:19:38] TinkerTyper: has joined #ruby
[16:19:49] havenwood: You could use a refinement in your Rakefile.
[16:20:29] cdg: has joined #ruby
[16:21:43] tycoon177: would i have to then do "using X" in my rakefile? i don't see how that would cause any other issues since the monkeypatch should only be in effect within rake, no?
[16:22:49] havenwood: tycoon177: I don't know how complex your Rake tasks are, but yeah - if you're not worried about it leaking to other dependent tasks.
[16:23:08] tycoon177: havenwood: the problem is that it's a built in test, not a custom one
[16:23:20] havenwood: tycoon177: In general, if you're worried about the scope of monkey patches, refinements are a really nice way to limit them lexically to the file and class you're in.
[16:23:41] tycoon177: i'll keep that in mind, thanks havenwood!
[16:23:57] tycoon177: it's the first time i've ever done a monkey patch and i still don't feel good about it.
[16:24:16] havenwood: tycoon177: You shouldn't feel bad about it! Call it a "freedom patch" like DHH to feel better.
[16:24:56] deduped: has joined #ruby
[16:25:10] havenwood: tycoon177: And if there's really a worry about overbroad scope, refine.
[16:25:14] runescape07rsps: has joined #ruby
[16:25:25] alex``: has joined #ruby
[16:25:41] tycoon177: it shouldn't be an issue, i just added a data type for sql server so that spinning up a test environment won't fail
[16:27:58] bmurt: has joined #ruby
[16:30:38] TinkerTyper: has joined #ruby
[16:30:43] stormpack: has joined #ruby
[16:31:33] tycoon177: havenwood: i went back into the Rakefile and made it check if the method was defined before the monkey patch :) now it won't have issues of overwriting the built-in when it eventually gets patched :D
[16:31:35] tycoon177: thanks for your help
[16:32:21] antgel: has joined #ruby
[16:32:27] tycoon177: it sure is ugly, though https://gist.github.com/BenMcH/179f5758318743ef03a397a7c9c4664d
[16:32:52] frozengeek: has joined #ruby
[16:35:54] aduabu: has joined #ruby
[16:40:27] bronson: has joined #ruby
[16:40:36] canteen4: has joined #ruby
[16:41:26] bruno-_: has joined #ruby
[16:41:37] TinkerTyper: has joined #ruby
[16:44:35] aduabu: has joined #ruby
[16:44:45] nobitanobi: has joined #ruby
[16:48:08] canteen4: has joined #ruby
[16:48:41] skweek: has joined #ruby
[16:51:48] bmurt: has joined #ruby
[16:52:41] TinkerTyper: has joined #ruby
[16:53:46] bovis: has joined #ruby
[16:54:23] __Yiota: has joined #ruby
[16:54:58] FastJack: has joined #ruby
[16:56:55] kies: has joined #ruby
[16:58:59] aduabu: has joined #ruby
[17:00:51] bronson: has joined #ruby
[17:02:00] canteen4: has joined #ruby
[17:03:10] TinkerTyper: has joined #ruby
[17:03:24] ledestin: has joined #ruby
[17:05:00] pinksandles: monkey patching is cool, in isolated cases, not as the vehicle behind a whole library (eg ActiveSupport)
[17:05:21] phinxy: has joined #ruby
[17:06:43] pinksandles: people disagree obviously. but i think that's what the counter-argument against monkey patching is usually using as an example.
[17:08:15] aduabu: has joined #ruby
[17:10:24] smithascari: has joined #ruby
[17:10:46] ltem: has joined #ruby
[17:11:06] canteen4: has joined #ruby
[17:12:34] AndBobsYourUncle: has joined #ruby
[17:14:12] TinkerTyper: has joined #ruby
[17:15:04] mson: has joined #ruby
[17:17:03] ldnunes: has joined #ruby
[17:19:07] aduabu: has joined #ruby
[17:20:48] bmurt: has joined #ruby
[17:22:20] canteen4: has joined #ruby
[17:22:30] joast: has joined #ruby
[17:24:41] bmurt: has joined #ruby
[17:25:12] TinkerTyper: has joined #ruby
[17:26:21] weaksauce: has joined #ruby
[17:28:37] aduabu: has joined #ruby
[17:30:18] Ishido: has joined #ruby
[17:31:55] canteen4: has joined #ruby
[17:35:19] orbyt_: has joined #ruby
[17:35:50] bkxd: has joined #ruby
[17:36:15] TinkerTyper: has joined #ruby
[17:39:02] mikecmpbll: has joined #ruby
[17:39:03] gixxer1k: has joined #ruby
[17:41:38] emilford: has joined #ruby
[17:43:26] aduabu: has joined #ruby
[17:45:34] uZiel: has joined #ruby
[17:46:02] dviola: has joined #ruby
[17:47:17] TinkerTyper: has joined #ruby
[17:50:14] canteen4: has joined #ruby
[17:51:40] bmurt: has joined #ruby
[17:53:04] skweek: has joined #ruby
[17:54:18] orbyt_: has joined #ruby
[17:56:44] aduabu: has joined #ruby
[17:57:45] TinkerTyper: has joined #ruby
[18:00:05] ramfjord: has joined #ruby
[18:01:37] canteen4: has joined #ruby
[18:03:35] conta3: has joined #ruby
[18:04:21] FrostCandy: Shouldn't res = Net::HTTP.get('google.com','/') make res a string full of the content of google.com? When i do puts source i get nothing
[18:06:15] aduabu: has joined #ruby
[18:08:12] uZiel: has joined #ruby
[18:08:53] canteen4: has joined #ruby
[18:09:38] tomphp: has joined #ruby
[18:09:49] Zarthus: did you get any errors or require net/http?
[18:12:20] TomyLobo: has joined #ruby
[18:12:28] DrCode: has joined #ruby
[18:12:45] enterprisey: has joined #ruby
[18:13:07] FrostCandy: I found my problem, it needed the full address like index.html at the end.
[18:15:30] Zarthus: which ruby version?
[18:15:55] apeiros: you probably got a 302 redirect
[18:16:38] apeiros: that was actually directed at FrostCandy :D
[18:17:03] FrostCandy: apeiros: i did get 302 ya
[18:17:30] conta5: has joined #ruby
[18:17:37] apeiros: FrostCandy: well, redirects don't contain the contents of where they redirect you to. you have to follow that redirect.
[18:18:07] apeiros: i.e. you read the location header and do the next get request
[18:18:10] FrostCandy: apeiros: yup it worked correctly, I just didn't type the full url. I didn't know it wouldn't follow automatically
[18:19:46] TinkerTyper: has joined #ruby
[18:19:47] lxsameer: has joined #ruby
[18:20:43] Ishido: has joined #ruby
[18:21:22] jackjackdripper: has joined #ruby
[18:21:37] anime4christ: has joined #ruby
[18:22:12] laphoraig92: has joined #ruby
[18:23:44] aduabu: has joined #ruby
[18:24:17] eckhardt: has joined #ruby
[18:24:39] al2o3-cr: has joined #ruby
[18:27:08] ryandevilla: has joined #ruby
[18:28:02] laphoraig92: has joined #ruby
[18:28:06] jackjackdripper: has joined #ruby
[18:30:48] TinkerTyper: has joined #ruby
[18:32:02] tomphp: has joined #ruby
[18:33:34] canteen4: has joined #ruby
[18:33:59] beilabs: has joined #ruby
[18:37:22] aduabu: has joined #ruby
[18:37:24] cdg_: has joined #ruby
[18:38:34] orbyt_: has joined #ruby
[18:38:57] tomphp_: has joined #ruby
[18:41:19] TinkerTyper: has joined #ruby
[18:43:50] canteen4: has joined #ruby
[18:45:49] nowhereman: has joined #ruby
[18:47:00] aduabu: has joined #ruby
[18:48:29] storer: has joined #ruby
[18:50:09] WeiJunLi: has joined #ruby
[18:50:16] nowhereman: has joined #ruby
[18:52:23] TinkerTyper: has joined #ruby
[18:53:41] bmurt: has joined #ruby
[18:54:40] mtkd: has joined #ruby
[18:57:37] canteen4: has joined #ruby
[19:01:50] bronson: has joined #ruby
[19:01:50] dviola: has joined #ruby
[19:02:02] aduabu: has joined #ruby
[19:03:21] TinkerTyper: has joined #ruby
[19:03:33] bronson: has joined #ruby
[19:05:36] kapil___: has joined #ruby
[19:05:39] canteen4: has joined #ruby
[19:06:50] bmurt: has joined #ruby
[19:09:09] guille-moe: has joined #ruby
[19:10:11] pinksandles: has joined #ruby
[19:11:43] aduabu: has joined #ruby
[19:13:42] cagomez: has joined #ruby
[19:14:29] guacamole: has joined #ruby
[19:14:51] canteen4: has joined #ruby
[19:16:41] cagomez: has joined #ruby
[19:18:58] CrazyEddy: has joined #ruby
[19:22:32] smithasc: has joined #ruby
[19:22:49] FrostCandy: This fails but why: print [1,2,­3].map do |k| k; end print [1,2,3].map{|k| k} works and print [1,2,3] do |k| k end works. If I use a do block on a map, does that mean it's putting the entire map in |k| whereas using braces means put the contents into |k| ?
[19:23:31] matthewd: FrostCandy: The do is associated with the print call. Add parens to see the difference.
[19:24:03] matthewd: FrostCandy: `print([1,2,3].map) do .. end` (what's happening, which is not what you want), vs `print([1,2,3] map do .. end)`
[19:24:07] CrazyEddy: has joined #ruby
[19:24:53] RedNifre: has joined #ruby
[19:24:54] TinkerTyper: has joined #ruby
[19:26:44] FrostCandy: matthewd: you had me add parens just for readability right, the output is the same with or without them.
[19:27:07] matthewd: No, those parens I showed will cause different behaviour
[19:27:20] harai: has joined #ruby
[19:27:21] FrostCandy: print [1,2,3] do |k| k end works
[19:27:41] FrostCandy: pinksandles: yup {} woudl work , but i'm tring to understand why the other does not. :D
[19:28:19] pinksandles: the block in do; end form is passed to print, not map
[19:28:20] FrostCandy: pinksandles: yup i read some stuff on precdence, but it wasn't clear to me. Matt , i'll try again with the parens
[19:28:31] matthewd: FrostCandy: Given `foo bar do .. end`, the block is associated with the call to #foo; given `foo bar { .. }`, it's associated with #bar
[19:29:18] matthewd: `foo(bar do .. end)` also forces the latter interpretation, and `foo(bar) { .. }` forces the former -- i.e., suitably-placed parens override the default precedence
[19:29:28] FrostCandy: ok i think that's making sense
[19:30:08] elcontrastador: has joined #ruby
[19:30:50] RedNifre: Hi there. I'd like to learn ruby properly. So far I only used it for small scripts, but I'd like to learn how to use it more professionally (real project setup with a gem file, using rake(?), using gems etc.). The idea is to use it on my raspberry pi to fetch some information from somewhere on the web and "visualize" it by turning colored LEDs on and off. I'm already good at programming in various languages.
[19:30:53] RedNifre: What's the best way to learn it?
[19:31:08] matthewd: FrostCandy: {} hugs tightly, so it associates with the directly-adjacent method call; do/end feels more like a statement, so it associates with the outermost one on the line
[19:31:20] RedNifre: I also have an old "Programming Ruby 1.9" book here, is this still useful or is it outdated beyond all hope?
[19:31:41] guille-moe: has joined #ruby
[19:31:53] pinksandles: still good i think, but many new features since then
[19:32:07] havenwood: RedNifre: A Ruby 1.9 book would still be useful. Think of 1.9 as 2.0-beta.
[19:32:17] havenwood: 1.8, not so useful.
[19:32:18] matthewd: FrostCandy: As for the "why why".. it's handy to have both options without needing explicit parens sometimes -- though often wiser to avoid the ambiguity
[19:32:31] FrostCandy: matthewd: good way of thinking about it, but still it throws me that [1,2,3] array works fine but adding the .map doesn't even though both associate with the print call right?
[19:32:52] havenwood: RedNifre: Please feel free to ask us questions here if you run into Ruby issues!
[19:33:01] pinksandles: 1.9 useful, 2.0+ recommended, because 2.0 has worthwhile features that are worth learning from the start.
[19:33:04] matthewd: FrostCandy: You want the block to be sent to the map call, not the print
[19:33:13] havenwood: pinksandles: good point
[19:33:43] orbyt_: has joined #ruby
[19:33:57] matthewd: pinksandles: Syntactic features other than kwargs?
[19:35:28] jamesaxl: has joined #ruby
[19:35:36] matthewd: I wouldn't learn Enumerable's API from a 1.9-era book (because you'd miss a bunch of newer methods), but Enumerable-the-concept would be just fine
[19:35:43] pinksandles: well, language features too. there's refinements, 'prepend', ...
[19:35:55] TinkerTyper: has joined #ruby
[19:35:57] RedNifre: Okay, thanks. I guess I'll read the book then.
[19:37:19] RedNifre: I have one question regarding the depth of ruby: How hard is it to understand how the language works on a fundamental level?
[19:37:24] pinksandles: if those features existed at 1.8 then the ruby code we write today may be very different, so i think it's good to learn with the new methods available than thinking on the old way only.
[19:37:31] aduabu: has joined #ruby
[19:37:58] matthewd: Ah, yeah, I'll pay prepend. Refinements seem less important to me, just because they're under-adopted. Useful to know about, but it seems early to go refinements-first, if you want to read code from / work with other ruby developers.
[19:38:12] RedNifre: E.g. there is the Io language which is the most easy to fundamentally understand language I know of: Objects have "slots", slots can contain values and methods, there's a slot for the prototype object etc.
[19:38:20] nobitanobi: has joined #ruby
[19:38:21] craysiii: So I started reading learn ruby the hard way, but have seen criticisms on the way zed Shaw has written it, and that some parts are not very ruby-like. Are those criticisms valid, and is there a "universally" recommended book out there?
[19:38:38] RedNifre: If you do bla[x] it actually desugars to bla.squarebrackets(x) etc.
[19:39:42] bkxd: has joined #ruby
[19:39:56] RedNifre: Contrast that to, say, java where you have a lot of special cases like primitive types vs objects, static methods, volatile etc. How hard is it to explain how ruby works fundamentally?
[19:41:34] canteen4: has joined #ruby
[19:41:38] matthewd: RedNifre: I'd say Ruby is more at the "few, widely reused, concepts" end
[19:41:50] RedNifre: that sound good.
[19:41:57] matthewd: To use your example, bla[x] is actually bla.[](x)
[19:42:14] RedNifre: Also, what's up with lambda vs proc vs block? Isn't that all the same thing, basically?
[19:42:43] matthewd: A block is a syntactic construct; a lambda/proc is an object representing same
[19:43:19] RedNifre: Ah, so when a method has a "block parameter" like &b it's actually a proc/lambda parameter?
[19:43:23] laphoraig92: has joined #ruby
[19:43:29] pinksandles: @matthewd true. except i imagine if refinements were available years ago, then activesupport and how monkey patches in rails in general might be different..
[19:43:30] matthewd: The lambda vs proc distinction is very minor, around invocation and argument handling
[19:44:05] matthewd: pinksandles: If there were a way for the "app" to opt in without needing crap at the top of every file, maybe
[19:44:53] pinksandles: sounds meta-able.
[19:45:01] matthewd: RedNifre: Yes; `b` there will be [converted to] an instance of Proc
[19:45:47] matthewd: pinksandles: With a moderate amount of irony, one could monkey-patch #require to avoid monkey-patching things, I guess
[19:45:48] havenwood: An interesting trivia point is that lambdas don't *always* have strict arity.
[19:45:58] RedNifre: so the "block" is just a way to write a Proc, always?
[19:46:24] laphoraig92: has joined #ruby
[19:46:38] pinksandles: not in same way? i mean, refinements can give you contextual monkey patches. rails just doesn't seem to concerned about that being a feature.
[19:46:56] TinkerTyper: has joined #ruby
[19:47:09] havenwood: RedNifre: An object doesn't need to be allocated for a block like it does with a proc or lambda. You can always use an &proc in place of a block, but it's unnecessary work.
[19:47:44] havenwood: RedNifre: `&` is syntactic sugar that calls #to_proc then passes that result as a block.
[19:48:23] RedNifre: I don't understand. What do you do with a block if not convert it to be used with '&'? What else can be done with blocks?
[19:48:35] matthewd: pinksandles: ActiveSupport is intended to be stdlib/core for Rails applications, so we wouldn't want narrow-contextual, no. But if we could affect all app code without affecting other gems, there could be value to that.
[19:49:13] guille-moe: has joined #ruby
[19:49:19] roshanavand: has joined #ruby
[19:49:21] matthewd: RedNifre: `3.times { puts "x" }` has a block, and passes it to a method, but it never gets converted to an object, just because it's not needed
[19:49:28] dtzuzu: has joined #ruby
[19:50:08] matthewd: RedNifre: Whereas in `3.times(&b)`, b is an object (because it's in a variable), regardless of where it came from
[19:50:15] pinksandles: right yeah, makes sense. i guess there's an argument for `ActiveSupport::String.some_patch(str)` too. tbh i never noticed the monkey patches being a problem in practice.
[19:50:19] FrostCandy: matthewd: A better question, if I add a method to bar in foo bar.method do |k| k end, then k will operate on foo, but if no method is applied to bar, then k will operate on the variable. Is that correct?
[19:50:24] matthewd: RedNifre: Even though the #times method can't distinguish between those invocations
[19:50:26] RedNifre: but how is 'times' implemented then? I would have thought 'times' looks like def Number.times(&b) or something? Or does it just use 'yield' which doesn't need the block to be an object?
[19:50:57] pinksandles: iirc lotus takes that approach (Foo::String.some_patch).
[19:51:12] matthewd: FrostCandy: No; `foo bar.baz do .. end` and `foo bar do .. end` both pass the block to foo
[19:51:36] matthewd: RedNifre: Yes, it'll do one or the other
[19:52:10] matthewd: RedNifre: If it takes an explicit &b parameter, then that b will contain an object no matter what -- the block will get wrapped into a proc object if necessary
[19:52:38] pinksandles: times could just be: `def times(&b) 0.upto(self-1, &b); end`
[19:53:05] fyodorn: has joined #ruby
[19:53:10] fyodorn: has left #ruby: ()
[19:53:18] havenwood: RedNifre: but for those reasons a block and yield are faster than a proc and block call
[19:53:44] havenwood: RedNifre: blocks are less overhead than procs, yielding is less overhead than allocating and calling a block
[19:54:04] FrostCandy: matthewd: https://repl.it/KYf1/1 , on the second line I use puts [1,2,3] do |k| k end , that works but k must opperate on bar in that case because it prints correctly. foo bar do .. end works if bar is an array i guess. or something else is going on there
[19:54:07] havenwood: sorry for the "block" equivocation there
[19:54:18] pinksandles: but you can't capture them without a Proc. which is sometimes very useful.
[19:54:27] RedNifre: Okay, but I thought that in ruby was an object. When you call a block with yield, what is it that actually gets called? Or is that a runtime specific optimization that we shouldn't think about?
[19:54:34] havenwood: pinksandles: that always looks so hacky!
[19:54:45] havenwood: but yeah, can be handy
[19:54:55] pinksandles: i pass Proc's around like functions sometimes, a la JS.
[19:55:29] matthewd: FrostCandy: Use k+1 or something, so you can see better. The block is just not getting invoked.
[19:56:20] FrostCandy: matthewd: OOOOoooOoOOo Thanks !
[19:56:59] hahuang65: has joined #ruby
[19:57:20] skweek: has joined #ruby
[19:57:33] tvw: has joined #ruby
[19:57:47] guacamole: has joined #ruby
[19:57:58] TinkerTyper: has joined #ruby
[19:58:20] diego4: has joined #ruby
[19:58:42] diego4: has joined #ruby
[19:59:11] tomphp: has joined #ruby
[20:00:43] aduabu: has joined #ruby
[20:02:13] jinie: has joined #ruby
[20:03:43] zenspider: FrostCandy: did you figure out that second block problem?
[20:05:37] canteen4: has joined #ruby
[20:05:55] zenspider: it is pretty simple to explain...
[20:08:20] Karunamon: has joined #ruby
[20:08:58] TinkerTyper: has joined #ruby
[20:11:03] cloutz: has joined #ruby
[20:11:28] guille-moe: has joined #ruby
[20:14:04] aduabu: has joined #ruby
[20:14:23] charliesome: has joined #ruby
[20:15:37] jinie: has joined #ruby
[20:16:35] RedNifre: hm, ri seems to find nothing. do i have to initialize it?
[20:17:21] stu314: has joined #ruby
[20:17:35] relyks: has joined #ruby
[20:17:37] FrostCandy: zenspider: not sure which you mean - my problem was not realizeing why [] worked but [].map did not in print [1,2,3] do .. end but I think matt explained it pretty well - but if you want to toss in your tought i'd like to hear it anyway :)
[20:18:43] havenwood: RedNifre: how'd you install Ruby?
[20:18:51] selim: has joined #ruby
[20:20:00] RedNifre: sudo apt install ruby I think?
[20:20:14] RedNifre: I'm on Ubuntu 16.04 LTS
[20:20:30] RedNifre: ...which comes with ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
[20:20:59] havenwood: RedNifre: If you install ruby-full package it should include ri
[20:21:16] havenwood: RedNifre: sudo apt-get install ruby-full
[20:21:37] RedNifre: Way ahead of you :)
[20:23:15] postmodern: has joined #ruby
[20:23:53] SeepingN: has joined #ruby
[20:25:36] rkoller: has joined #ruby
[20:26:59] RedNifre: Ah, it worked, thanks :)
[20:27:08] canteen4: has joined #ruby
[20:28:16] havenwood: You're welcome
[20:28:20] RedNifre: What other things came with ruby-full? (I guess it's a "batteries included" bundle?)
[20:30:31] TinkerTyper: has joined #ruby
[20:31:51] zenspider: FrostCandy: cool. glad you got it sorted out.
[20:32:03] aduabu: has joined #ruby
[20:32:36] zenspider: ugh. is the damn thing dead again?
[20:32:52] cagomez: has joined #ruby
[20:32:53] zenspider: well... here's how I'd implement it:
[20:33:04] zenspider: class Integer; def mytimes; return to_enum(:mytimes) unless block_given?; (0..self).each do |n| yield n; end; end; end
[20:36:00] canteen4: has joined #ruby
[20:36:34] hahuang65: has joined #ruby
[20:38:50] RedNifre: When I define a method in irb, say def bla, it prints => :bla, as if it returned a symbol. Why is that?
[20:39:06] zenspider: that's what def does now
[20:39:10] aduabu: has joined #ruby
[20:39:16] RedNifre: woludn't it make more sense to return a proc?
[20:39:33] zenspider: how does that make "more" sense?
[20:39:46] zenspider: what should that proc do?
[20:39:48] zenspider: how would you use it?
[20:40:01] RedNifre: Well, a method is sort of like a proc that sits in a variable of the object?
[20:40:08] harfangk: has joined #ruby
[20:40:13] RedNifre: you know, like a method reference.
[20:40:17] zenspider: class X; myproc = def y; ...; end; ...what to do here?... end
[20:40:41] RedNifre: well, what can I do with the returned symbol?
[20:40:50] zenspider: what is self inside that proc?
[20:41:09] zenspider: assuming I store off myproc and then call it, where do instance variables come from?
[20:41:16] zenspider: obj.send method_name
[20:41:26] RedNifre: well, if I think in Javascript self in that proc would be undefined unless I bind the Proc to another object first.
[20:41:34] TinkerTyper: has joined #ruby
[20:41:52] alfiemax: has joined #ruby
[20:42:09] RedNifre: well, it could pick the instance variables of the place where it was defined, closure style.
[20:42:14] cdg: has joined #ruby
[20:42:24] zenspider: no... because where it is defined self is the class
[20:42:24] RedNifre: but I feel like I should continue reading before I ask questions like that :o)
[20:42:28] zenspider: not an instance of the class
[20:42:34] RedNifre: anyway, what do I do with the symbol that gets returned?
[20:42:37] zenspider: binding is one option, certainly
[20:42:46] zenspider: I said above... you can always use send on it.
[20:42:57] zenspider: but you can also do things like generate other methods from the name. wrappers and the like
[20:42:58] RedNifre: oh, sorry, I missed that one.
[20:43:21] havenwood: RedNifre: https://packages.ubuntu.com/xenial/ruby-full
[20:44:40] zenspider: so... I'm gonna ask again... where is this "more"? the result of def was nil for the longest time. The result of def seems pretty arbitrary to me
[20:44:56] zenspider: some people seem to like doing `private def blah ... end`
[20:45:15] zenspider: but there's no real benefit since you can just do `private\ndef blah ... end`
[20:45:42] zenspider: I think that style is gross, personally (both, really)
[20:46:59] RedNifre: what other styles are there to define a method as private?
[20:47:52] zenspider: you can do modal private (my second example) or `private :meth1, :meth2`...
[20:48:23] zenspider: but I find all of it to be a waste of time, personally
[20:48:37] brent__: has joined #ruby
[20:49:39] RedNifre: Yeah, private is too serious. If I need a serious language I just use Haskell.
[20:50:06] marr: has joined #ruby
[20:52:21] stu314: RedNifre: everything you don't need to use from outside just declare private
[20:52:34] TinkerTyper: has joined #ruby
[20:52:39] stu314: there is nothing serious about it
[20:52:48] swills: has joined #ruby
[20:52:48] swills: has joined #ruby
[20:53:30] ryandevilla: has joined #ruby
[20:54:50] RedNifre: Well, I see ruby as a "Just let me quickly implement this without hassle"-language; Why overcomplicate it if I know what I'm doing? (That's hypothetical by the way, so far my ruby scripts were very small, I guess when I'll write a larger project I'll use more and more of these "serious" features ;)
[20:56:12] RedNifre: Is there a performance difference between @BLA and @@BLA? Or should I write @@BLA anyway because it sort of makes more sense maybe?
[20:56:47] RedNifre: @@BLA is still a variable, huh?
[20:56:49] zenspider: 1) questions of performance should be answered ONLY with benchmarks... which is really easy using the built in benchmark or (better) benchmark-ips gem
[20:56:51] stu314: i never use @@bla. i don't like class variables. i use class instance variables instead.
[20:56:52] emilford: has joined #ruby
[20:57:34] zenspider: 2) probably not enough performance difference to matter for you (going on what you just said above)
[20:57:38] RedNifre: Yeah, I meant constants that are only visible inside of a class, but I guess you just write BLA in the class.
[20:57:44] stu314: well ... inheritance matters, but ... i've never needed class variables
[20:57:45] zenspider: 3) use what makes the most sense for your design
[20:58:02] conta1: has joined #ruby
[20:59:57] Trynemjoel: has joined #ruby
[21:02:08] ryandevilla: has joined #ruby
[21:03:33] TinkerTyper: has joined #ruby
[21:04:07] bronson: has joined #ruby
[21:04:29] quattro_: has joined #ruby
[21:05:46] ur5us: has joined #ruby
[21:06:29] quattro_: has joined #ruby
[21:06:58] milardovich: has joined #ruby
[21:07:13] ldnunes: has joined #ruby
[21:08:50] dmtd: has joined #ruby
[21:09:53] guille-moe: has joined #ruby
[21:14:08] TinkerTyper: has joined #ruby
[21:14:11] canteen4: has joined #ruby
[21:18:55] BTRE: has joined #ruby
[21:20:38] aduabu: has joined #ruby
[21:22:06] GodFather: has joined #ruby
[21:23:18] jackjackdripper: has joined #ruby
[21:23:40] canteen4: has joined #ruby
[21:24:08] jackjackdripper: has joined #ruby
[21:25:08] TinkerTyper: has joined #ruby
[21:25:35] nadir: has joined #ruby
[21:25:47] FrostCandy: Where can I find info on what all the parts of a class opening are? Class MyObject is easy enough but then there are < moreStuff < moreStuff < MoreStuff sometimes. Are they child classes read left to right who knows. Can't find a good resource on it
[21:26:20] xelkarin: has joined #ruby
[21:27:10] FrostCandy: ah maybe looking up ruby class inheritance will do the trick
[21:27:19] orbyt_: has joined #ruby
[21:28:50] xelkarin: Is there a way to determine if a ruby app is being called by the stand-alone interpreter (ruby -I gem_libdir /path/to/executable) or as an installed gem?
[21:29:14] mikecmpbll: https://pine.fm/LearnToProgram/
[21:29:14] mikecmpbll: http://www.rubyist.net/~slagell/ruby/
[21:29:16] mikecmpbll: http://poignant.guide/
[21:29:16] mikecmpbll: FrostCandy ^
[21:30:08] hahuang65: has joined #ruby
[21:30:18] FrostCandy: mikecmpbll: ty
[21:31:48] tomphp: has joined #ruby
[21:32:37] Puffball: has joined #ruby
[21:34:26] aduabu: has joined #ruby
[21:36:08] TinkerTyper: has joined #ruby
[21:36:21] mim1k: has joined #ruby
[21:37:50] mson: has joined #ruby
[21:39:22] canteen4: has joined #ruby
[21:39:33] phinxy: has joined #ruby
[21:40:15] chrisarcand: has joined #ruby
[21:41:05] nowhereman: has joined #ruby
[21:41:11] chrisarcand: has joined #ruby
[21:45:22] postmodern: has joined #ruby
[21:46:59] mostlybadfly: has joined #ruby
[21:47:11] TinkerTyper: has joined #ruby
[21:47:23] hahuang65: has joined #ruby
[21:48:08] pinksandles: in JS i think it's nicer/different to pass around closure's/functions than Proc's. mostly cuz, `foo()` vs `foo.()` or `foo.call()`.. maybe just different, but something to appreciate about JS.
[21:49:41] pinksandles: JS approach feels more functional where as ruby it feels like a functional approach applied to an OO language
[21:49:46] aduabu: has joined #ruby
[21:53:25] opekktar: has joined #ruby
[21:53:58] hahuang65: has joined #ruby
[21:55:39] canteen4: has joined #ruby
[21:56:03] mikecmpbll: pinksandles : probably because ruby isn't a "functional" language in that sense? :)
[21:56:09] SeepingN: FrostCandy: also in pdf https://github.com/allcentury/Assorted/raw/master/Learn%20to%20Program%2C%202nd%20Edition.pdf
[21:57:13] pinksandles: mikecmpbll: yea. i think there was a Q&A where matz said the grammar/syntax of ruby made `foo()` on a Proc impossible too
[21:57:39] TinkerTyper: has joined #ruby
[21:57:55] pinksandles: so, .() was added
[21:58:03] pinksandles: as a compromise
[21:58:17] mikecmpbll: i hardly ever see .() in ruby code though
[21:59:25] mtkd: has joined #ruby
[21:59:27] FrostCandy: Following a tutorial but missing this concept. In a class you can do def password=(password) or def password(password) - aren't those saying the same thing? Were just going to pass password to the method right? Does the = sign do something special?
[21:59:51] matthewd: FrostCandy: One is a method called "password", one is a method called "password="
[22:00:17] FrostCandy: matthewd: lol oh
[22:00:21] apeiros: FrostCandy: mostly they are the same. the main difference is in what it communicates to the user
[22:00:38] apeiros: there is a small difference in how the two work, though
[22:00:39] xco: has joined #ruby
[22:01:00] FrostCandy: apeiros: like what?
[22:01:08] nowhereman: has joined #ruby
[22:01:13] goyox86_: has joined #ruby
[22:01:15] apeiros: >> def foo=(val); return 1; end; def foo(val); return 1; end; [self.foo = 2, foo 2]
[22:01:16] ruby[bot]: apeiros: # => /tmp/execpad-f37b4c66dad3/source-f37b4c66dad3:2: syntax error, unexpected tINTEGER, expecting keywor ...check link for more (https://eval.in/850021)
[22:01:25] BTRE: has joined #ruby
[22:01:34] apeiros: >> def foo=(val); return 1; end; def foo(val); return 1; end; [self.foo = 2, foo(2)]
[22:01:36] ruby[bot]: apeiros: # => [2, 1] (https://eval.in/850023)
[22:02:12] WeiJunLi: has joined #ruby
[22:02:17] apeiros: foo= methods always return the right-hand side (rhs), regardless of an explicit return or implicit last value.
[22:02:36] pinksandles: also too diffilcult/inconvient to get a callable reference to a method in ruby. which i think contributes
[22:04:18] gusrub: has joined #ruby
[22:05:43] milardovich: has joined #ruby
[22:07:01] guille-moe: has joined #ruby
[22:07:25] pinksandles: syntax for `foo.method(:bar).to_proc` in form of `blah = ^foo.bar`
[22:07:50] pinksandles: then passing around methods would be easy in function calls etc
[22:08:15] apeiros: why'd you call to_proc on Method? o0
[22:08:43] TinkerTyper: has joined #ruby
[22:09:17] apeiros: also usually you'll just pass :bar. IME it's rare that you need an actual Method object
[22:09:23] milardovich: has joined #ruby
[22:09:28] pinksandles: to get a lambda :) closest thing to an anonymous function, or same thing in JS.
[22:09:44] apeiros: again, why?
[22:09:50] apeiros: Method has #call
[22:10:06] apeiros: I see literally no point in converting it to a Proc
[22:10:21] pinksandles: correct. Method could work too, but my gut would go with a lambda for closest semantics with JS.
[22:10:41] apeiros: oh, good old "lets keep writing fortran in other languages"
[22:11:04] orbyt_: has joined #ruby
[22:11:15] cr3: how can I get the source location of a class? Foo.source_location returns undefined method
[22:11:40] apeiros: cr3: you can't. there's workarounds, but they're quirky.
[22:12:12] apeiros: cr3: use pry with pry-doc, it comes with commands which use those workarounds
[22:13:06] apeiros: e.g. $ and ?. there's probably also one to just tell you all lines where the class is opened
[22:14:41] rwb: has joined #ruby
[22:17:17] aduabu: has joined #ruby
[22:18:38] ShalokShalom: has joined #ruby
[22:19:42] TinkerTyper: has joined #ruby
[22:20:29] pinksandles: cr3: starting point, to do via code: Pry::WrappedModule.new(String).source
[22:21:16] MoskitoHero: has joined #ruby
[22:21:32] cr3: apeiros and pinksandles: thanks for the tips, that worked nicely!
[22:21:35] pinksandles: there's Pry::WrappedModule.new(String).source_location too
[22:23:07] beilabs: has joined #ruby
[22:23:55] pugc: has joined #ruby
[22:26:42] cadillac_: has joined #ruby
[22:29:32] milardovich: has joined #ruby
[22:29:44] MoskitoHero: has joined #ruby
[22:30:29] bkxd: has joined #ruby
[22:32:07] canteen4: has joined #ruby
[22:35:23] aduabu: has joined #ruby
[22:35:54] __Yiota: has joined #ruby
[22:38:36] konsolebox: is it common practice to have `Rake::TestTask.new do(:test => :compile)`?
[22:39:04] konsolebox: i.e, to have :compile a dependency of :test
[22:39:31] konsolebox: i'm thinking about possible issues with package managers that emulate installation of gems. because they have test phases which are separate.
[22:39:33] MoskitoHero: has joined #ruby
[22:40:01] konsolebox: but having :test dependent on :compile somehow adds assurance that the binary/library that would be tested is updated.
[22:40:05] pinksandles: less common than not having it.
[22:40:07] p0p0pr37: has joined #ruby
[22:40:39] konsolebox: pinksandles: but what do you think about having it?
[22:40:45] p0p0pr37: has joined #ruby
[22:40:56] pinksandles: seems fine, if the tests have C exts to build
[22:41:41] konsolebox: yes. it also looks fine even with Gentoo's ebuilds. the compilation doesn't happen twice, but i'm not sure about other package managers.
[22:42:40] pinksandles: package maintainer problem ;)
[22:42:55] matthewd: If :compile will only do things if it needs to, then it seems fine
[22:43:21] matthewd: If compile will always do a from-scratch compilation, that seems less pleasant both for a developer and a packager
[22:43:59] konsolebox: matthewd: if there's already a compiled library, it won't unless it has to
[22:44:33] konsolebox: the thing i worry about is if package managers decide to isolate compilation from testing
[22:45:03] aclark: has joined #ruby
[22:45:08] pinksandles: well. can't account for every crazy idea linux tries out. `rake test` dependencies have to be satisified to run tests.
[22:45:09] konsolebox: so, in test phase, another binary/library would be compiled and tested
[22:45:17] chouhoulis: has joined #ruby
[22:45:20] matthewd: Yeah, I'd call that a future problem
[22:46:12] bmurt: has joined #ruby
[22:46:18] matthewd: If it comes up, then you make a new task that actually runs the tests, and have 'test' be just compile+really_test
[22:46:33] nowhereman: has joined #ruby
[22:47:07] matthewd: But even if they do the compile elsewhere, they'd surely need to move the lib into the right place for the tests to use it ¯\_(ツ)_/¯
[22:48:20] TinkerTyper: has joined #ruby
[22:49:47] pinksandles: yea. it sounds like an issue of packager having to integrate than vice versa
[22:51:57] storer42: has joined #ruby
[22:52:01] gbgdev: has joined #ruby
[22:52:02] milardovich: has joined #ruby
[22:53:17] gwilkes: has joined #ruby
[22:56:00] canteen4: has joined #ruby
[22:56:03] milardovich: has joined #ruby
[22:57:18] TinkerTyper: has joined #ruby
[23:00:09] aduabu: has joined #ruby
[23:03:18] canteen4: has joined #ruby
[23:03:19] harai: has joined #ruby
[23:06:12] bronson: has joined #ruby
[23:06:54] TinkerTyper: has joined #ruby
[23:08:53] __Yiota: has joined #ruby
[23:11:28] TinkerTyper: has joined #ruby
[23:13:56] aduabu: has joined #ruby
[23:18:44] storer42: has joined #ruby
[23:20:23] milardovich: has joined #ruby
[23:20:32] canteen4: has joined #ruby
[23:24:50] aduabu: has joined #ruby
[23:25:17] TinkerTyper: has joined #ruby
[23:27:57] Mon_Ouie: has joined #ruby
[23:30:34] canteen4: has joined #ruby
[23:34:52] aduabu: has joined #ruby
[23:34:53] milardovich: has joined #ruby
[23:35:23] __Yiota: has joined #ruby
[23:36:48] mim1k: has joined #ruby
[23:37:14] ltd: has joined #ruby
[23:37:53] canteen4: has joined #ruby
[23:39:25] p0p0pr37_: has joined #ruby
[23:39:25] p0p0pr37_: has joined #ruby
[23:39:40] ramfjord: has joined #ruby
[23:42:32] brent__: has joined #ruby
[23:44:20] aduabu: has joined #ruby
[23:44:47] cschneid_: has joined #ruby
[23:46:13] minimalism: has joined #ruby
[23:47:54] canteen4: has joined #ruby
[23:51:32] aduabu: has joined #ruby
[23:54:37] gusrub: has joined #ruby
[23:54:55] canteen4: has joined #ruby
[23:56:28] ShalokShalom: has joined #ruby
[23:59:13] aduabu: has joined #ruby
[23:59:41] Ropeney: has joined #ruby