« Back to channel list

#ruby - 03 January 2018

« Back 1 day Forward 1 day »
[00:04:55] jtdoncas_: has joined #ruby
[00:05:27] bmurt: has joined #ruby
[00:10:08] guardianx: has joined #ruby
[00:10:38] moei: has joined #ruby
[00:10:48] pastorinni: has joined #ruby
[00:11:27] sent-hil: has joined #ruby
[00:16:01] mikecmpb_: has joined #ruby
[00:16:27] nit3rid3: has joined #ruby
[00:17:00] jeffreylevesque: has joined #ruby
[00:19:37] tdy: has joined #ruby
[00:27:37] mikecmpbll: has joined #ruby
[00:32:15] [Butch]: has joined #ruby
[00:32:41] mikecmpb_: has joined #ruby
[00:34:10] conta: has joined #ruby
[00:36:26] pastorinni: has joined #ruby
[00:36:38] jtdoncas_: has joined #ruby
[00:36:51] Xiti`: has joined #ruby
[00:38:32] weaksauce: has joined #ruby
[00:40:05] cremes: has joined #ruby
[00:40:45] Xiti: has joined #ruby
[00:44:37] whippythellama: has joined #ruby
[00:49:42] RickHull: has joined #ruby
[00:51:24] cdg: has joined #ruby
[01:01:11] jtdoncas_: has joined #ruby
[01:02:39] RickHull1: has joined #ruby
[01:04:33] mikeiniowa: has joined #ruby
[01:05:12] oetjenj: has joined #ruby
[01:10:18] agent_white: has joined #ruby
[01:14:42] eightlimbed: has joined #ruby
[01:16:05] cagomez: has joined #ruby
[01:17:08] mtkd: has joined #ruby
[01:20:03] eljojo: has joined #ruby
[01:27:09] bruce_lee: has joined #ruby
[01:27:09] bruce_lee: has joined #ruby
[01:28:12] cdg: has joined #ruby
[01:30:47] pastorinni: has joined #ruby
[01:35:25] orbyt_: has joined #ruby
[01:36:54] RovingWriter: has joined #ruby
[01:37:05] webguynow: has joined #ruby
[01:39:17] BTRE: has joined #ruby
[01:43:55] alex```: has joined #ruby
[01:51:12] cschneid_: has joined #ruby
[01:51:33] anjen: has joined #ruby
[01:51:59] bmurt: has joined #ruby
[01:52:57] icarus: has joined #ruby
[02:00:45] nowhere_man: has joined #ruby
[02:01:00] rubycoder37: has joined #ruby
[02:03:55] gizmore: has joined #ruby
[02:08:43] mistergibson: has joined #ruby
[02:10:59] drbrain: has joined #ruby
[02:10:59] drbrain: has joined #ruby
[02:15:11] nowhere_man: has joined #ruby
[02:16:06] eightlimbed: has joined #ruby
[02:19:19] chocoelho: has joined #ruby
[02:21:51] tAn: has joined #ruby
[02:33:40] nofxx1: has joined #ruby
[02:53:15] tAn: has joined #ruby
[02:55:41] garyserj: has joined #ruby
[02:57:25] ahrs: has joined #ruby
[03:03:52] sspreitz: has joined #ruby
[03:16:14] cschneid_: has joined #ruby
[03:21:28] mtkd: has joined #ruby
[03:28:15] tAn: has joined #ruby
[03:28:20] darkhanb: has joined #ruby
[03:28:40] drbrain: has joined #ruby
[03:28:40] drbrain: has joined #ruby
[03:31:18] jtdoncas_: has joined #ruby
[03:32:47] mjolnird: has joined #ruby
[03:36:55] uZiel: has joined #ruby
[03:41:25] jtdoncas_: has joined #ruby
[03:42:59] guardianx: has joined #ruby
[03:44:42] bmurt: has joined #ruby
[03:45:14] dtzuzu: has joined #ruby
[03:49:14] pastorinni: has joined #ruby
[03:51:37] jtdoncas_: has joined #ruby
[03:57:04] pastorinni: has joined #ruby
[03:58:04] tAn: has joined #ruby
[03:58:10] howdoi: has joined #ruby
[03:59:06] alfiemax: has joined #ruby
[04:01:52] jtdoncas_: has joined #ruby
[04:11:59] jtdoncas_: has joined #ruby
[04:14:26] therealGent: has joined #ruby
[04:15:52] aupadhye: has joined #ruby
[04:19:00] jtdoncas_: has joined #ruby
[04:23:59] r3kz: has joined #ruby
[04:27:04] roger_rabbit: has joined #ruby
[04:32:49] cdg: has joined #ruby
[04:34:11] alfiemax_: has joined #ruby
[04:37:53] ur5us: has joined #ruby
[04:49:37] minimalism: has joined #ruby
[04:50:57] iamarun: has joined #ruby
[04:51:51] alfiemax: has joined #ruby
[04:52:11] dinfuehr: has joined #ruby
[04:54:24] tAn: has joined #ruby
[04:54:42] meesles: has joined #ruby
[04:55:07] cdg: has joined #ruby
[04:58:22] cdg_: has joined #ruby
[04:59:04] za1b1tsu: has joined #ruby
[04:59:20] za1b1tsu: Hello and Happy New Year
[04:59:36] za1b1tsu: Im trying to convert [[1, 2], [7, 8], [9, 10]] into {1=>{:z=>2}, 7=>{:z=>8}, 9=>{:z=>10}}, but I can't seem to get the desired result: z = y.map { |x,y| x => {z:y} } give me an error, while other combinations just creates an array of hashes
[04:59:37] gix-: has joined #ruby
[04:59:59] za1b1tsu: Can someone give me a tip?
[05:02:24] alfiemax: has joined #ruby
[05:04:15] tdy: has joined #ruby
[05:06:29] mozzarella: zalipuha[m]: a.map {|x, y| [x, {z: y}]}.to_h
[05:08:02] alfiemax_: has joined #ruby
[05:08:56] mozzarella: you know what, looks even better that way:
[05:09:03] mozzarella: a.map {|x, y| [x, z: y] }.to_h
[05:09:05] cdg: has joined #ruby
[05:11:12] jrm: has left #ruby: ()
[05:11:50] icarus: has joined #ruby
[05:12:02] tdy: has joined #ruby
[05:13:00] za1b1tsu: mozzarella: if I have more members like [1, 2, 3, 4] I have to use [x, {k:y, w:z, q:a}]
[05:14:41] mozzarella: it only needs to be at the end of the array
[05:15:01] mozzarella: > [1, 2, x: 1, y: 2]
[05:15:11] mozzarella: >> [1, 2, x: 1, y: 2]
[05:15:12] ruby[bot]: mozzarella: # => [1, 2, {:x=>1, :y=>2}] (https://eval.in/929739)
[05:15:19] mozzarella: >> [1, 2, x: 1, y: 2, 3]
[05:15:25] ruby[bot]: mozzarella: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[05:16:21] mozzarella: anyway, use whatever looks better/clearer, doesn't make much a difference
[05:36:10] tAn: has joined #ruby
[05:45:45] a549: has joined #ruby
[05:47:42] elphe: has joined #ruby
[05:48:59] a549: has joined #ruby
[05:52:09] xorgnak_: has joined #ruby
[06:02:20] a549: has joined #ruby
[06:05:21] a549: has anybody tired arcadia ide if so what did you think of it?
[06:05:52] jnyw: has joined #ruby
[06:05:58] dminuoso: Yes and I don't know because I did not.
[06:07:12] dminuoso: Or are you asking about what people think about those who tried arcadia ide?
[06:07:18] dminuoso: I think they are very brave.
[06:09:26] a549: I have installed and works fine. just wanted some input from other people
[06:10:20] baweaver: Never heard of it honestly
[06:10:46] a549: it's a gem
[06:11:02] baweaver: mozzarella: ooooo, more places where I can abuse kwarg ordering <3
[06:12:01] baweaver: >> [{a: 1}, {b: 2}].map { |a: 3, b: 4| a + b }
[06:12:02] ruby[bot]: baweaver: # => [5, 5] (https://eval.in/929746)
[06:18:29] LocaMocha: has joined #ruby
[06:23:54] naprimer3: has joined #ruby
[06:24:00] tAn: has joined #ruby
[06:24:43] alfiemax: has joined #ruby
[06:29:25] abraham_: has joined #ruby
[06:33:10] alfiemax_: has joined #ruby
[06:33:17] rabajaj: has joined #ruby
[06:39:36] anisha: has joined #ruby
[06:44:35] tAn: has joined #ruby
[06:46:18] dn`: has joined #ruby
[06:52:13] alex``: has joined #ruby
[06:52:30] aufi: has joined #ruby
[06:53:02] kies: has joined #ruby
[06:54:26] KeyJoo: has joined #ruby
[06:56:40] nwm: has joined #ruby
[07:00:44] romankapitonov: has joined #ruby
[07:04:33] jtdoncas: has joined #ruby
[07:16:42] alfiemax: has joined #ruby
[07:22:55] conta: has joined #ruby
[07:24:17] alfiemax_: has joined #ruby
[07:29:02] cdg: has joined #ruby
[07:29:34] dionysus69: has joined #ruby
[07:31:39] deafscribe: has joined #ruby
[07:36:15] DmitryBochkarev: has joined #ruby
[07:37:50] InfinityFye: has joined #ruby
[07:38:14] tAn: has joined #ruby
[07:41:34] rippa: has joined #ruby
[07:44:51] jaruga: has joined #ruby
[07:44:57] InfinityFye: has joined #ruby
[07:47:11] yeticry: has joined #ruby
[07:47:45] darkhanb: has joined #ruby
[07:50:25] hyperreal: has joined #ruby
[08:01:01] alfiemax: has joined #ruby
[08:03:47] mark_66: has joined #ruby
[08:07:52] InfinityFye: has left #ruby: ("Leaving")
[08:08:10] nofxx__: has joined #ruby
[08:13:06] dogweather: has joined #ruby
[08:14:51] cschneid_: has joined #ruby
[08:16:07] Dimik: has joined #ruby
[08:16:24] TomyWork: has joined #ruby
[08:17:56] mikhael_k33hl: has joined #ruby
[08:18:19] mikhael_k33hl: Anyone using beaneater? how do I include configuration when calling Beaneater::Pool.new?
[08:23:39] alfiemax: has joined #ruby
[08:24:07] ech042: has joined #ruby
[08:24:13] amatas: has joined #ruby
[08:32:40] alfiemax_: has joined #ruby
[08:32:52] claudiuinberlin: has joined #ruby
[08:35:05] BTRE: has joined #ruby
[08:41:23] milardovich: has joined #ruby
[08:43:31] BTRE: has joined #ruby
[08:46:13] alfiemax: has joined #ruby
[08:55:04] alfiemax_: has joined #ruby
[08:56:05] no-dashes: has joined #ruby
[08:58:58] alfiemax: has joined #ruby
[09:02:04] marr: has joined #ruby
[09:06:20] alfiemax_: has joined #ruby
[09:07:38] mikecmpbll: has joined #ruby
[09:09:30] Liothen: has joined #ruby
[09:11:21] elphe: has joined #ruby
[09:11:50] biberu: has joined #ruby
[09:19:46] alfiemax: has joined #ruby
[09:25:13] tAn: has joined #ruby
[09:34:18] linduxed: has joined #ruby
[09:36:34] ltem: has joined #ruby
[09:39:58] blackmesa: has joined #ruby
[09:40:33] Veejay: Hello everyone, when using queues, is there a better way to "initialize" them than something to the tune of queue = Queue.new; items.each {|item| queue.push(item)}
[09:40:47] Veejay: Ruby being Ruby, there's gotta be some more elegant way to achieve that
[09:42:56] blackmesa: has joined #ruby
[09:53:30] guille-moe: has joined #ruby
[09:55:02] deadnull: has joined #ruby
[09:55:16] deadnull: has joined #ruby
[09:56:34] Pierreb|home: im having issues, im fetching data from a website and trying to do some calculations, using regular numbers works fine but when i try to use the saved vars i get typeerror. code and all in here https://gist.github.com/anonymous/504b2aa127020db94c8290ac4ad184c0
[09:58:11] Beams: has joined #ruby
[10:01:50] Veejay: Pierreb|home: Try to add .to_f on your numbers
[10:01:57] cdg: has joined #ruby
[10:02:29] Pierreb|home: Veejay i had done it to the second one
[10:02:33] conta: has joined #ruby
[10:03:19] cdg_: has joined #ruby
[10:03:24] Pierreb|home: thanks for the help, ive spent 2-3 hours on this not been able to get it working.
[10:03:34] Veejay: Also, check the gem called "pry", it allows you to stop the execution flow at any point in your program
[10:03:40] Veejay: And try things on the fly
[10:03:49] Veejay: It makes it much easier to debug issues
[10:03:53] Pierreb|home: nice, ill do that thanks
[10:04:57] Veejay: Basically you add "binding.pry" to your code and during execution it will stop there and allow you to execute statements in the exact context of your program at that point
[10:05:01] Veejay: No worries
[10:05:30] drewmcmillan: has joined #ruby
[10:11:50] Riddell: has joined #ruby
[10:17:26] Riddell: has joined #ruby
[10:17:37] despai: has joined #ruby
[10:19:57] mikhael_k33hl: has joined #ruby
[10:20:17] mikhael_k33hl: I have a ruby program that creates threads and run rsync process from beanstalkd jobs, what the best way of testing it though?
[10:21:51] Riddell: has joined #ruby
[10:22:43] t0adst00l: has joined #ruby
[10:25:40] TheBrayn: has joined #ruby
[10:28:33] thinkpad: has joined #ruby
[10:29:48] tomphp: has joined #ruby
[10:32:09] blackmesa: has joined #ruby
[10:32:54] nerium: has joined #ruby
[10:43:26] Prutheus: has joined #ruby
[10:44:13] Prutheus: Hello! I am working with GTK. want to create a dialog window (https://ruby-gnome2.osdn.jp/hiki.cgi?Gtk%3A%3ADialog) The style Dialog.new('title', parent, ...) is deprecated, so I want to use Dialog.new(title: 'title
[10:44:26] Prutheus: ', parent: parent, ...
[10:44:36] Prutheus: But with the buttons I dont know how to do it
[10:44:36] tvw: has joined #ruby
[10:44:46] Prutheus: dialog = Gtk::Dialog.new(title: 'Message', parent: @gui_elements['wnd'], flags: Gtk::DialogFlags::DESTROY_WITH_PARENT, buttons: [Gtk::Stock::OK, Gtk::ResponseType::NONE])
[10:45:30] Prutheus: This results in:
[10:45:43] Prutheus: https://bpaste.net/show/7ed29b6c2167
[10:47:44] Cavallari: has joined #ruby
[10:58:24] selim: has joined #ruby
[10:59:55] luna_x: has joined #ruby
[11:01:02] ferr: has joined #ruby
[11:02:10] tomphp: has joined #ruby
[11:02:49] ferr: has left #ruby: ()
[11:05:20] tomphp_: has joined #ruby
[11:10:41] tomphp: has joined #ruby
[11:13:44] DmitryBochkarev: has joined #ruby
[11:14:40] ctp_: has joined #ruby
[11:17:58] cschneid_: has joined #ruby
[11:19:39] tvw: has joined #ruby
[11:21:05] tomphp: has joined #ruby
[11:23:21] tomphp: has joined #ruby
[11:25:17] alex``: has joined #ruby
[11:25:28] prometheus_falli: has joined #ruby
[11:25:49] elphe: has joined #ruby
[11:30:13] dinfuehr: has joined #ruby
[11:35:03] Liothen: has joined #ruby
[11:35:03] Liothen: has joined #ruby
[11:36:43] bkxd: has joined #ruby
[11:37:30] bkxd: has joined #ruby
[11:42:27] Prutheus: Hello! I am working with GTK. want to create a dialog window (https://ruby-gnome2.osdn.jp/hiki.cgi?Gtk%3A%3ADialog) The style Dialog.new('title', parent, ...) is deprecated, so I want to use Dialog.new(title: 'title
[11:42:29] Prutheus: ', parent: parent, ...
[11:42:31] Prutheus: But with the buttons I dont know how to do it
[11:42:33] Prutheus: dialog = Gtk::Dialog.new(title: 'Message', parent: @gui_elements['wnd'], flags: Gtk::DialogFlags::DESTROY_WITH_PARENT, buttons: [Gtk::Stock::OK, Gtk::ResponseType::NONE])
[11:42:35] Prutheus: This results in:
[11:42:37] Prutheus: https://bpaste.net/show/7ed29b6c2167
[11:43:14] mikecmpbll: has joined #ruby
[11:44:15] bkxd: has joined #ruby
[11:45:05] bkxd: has joined #ruby
[11:46:04] drewmcmillan: has joined #ruby
[11:48:24] Mortomes|Work: has joined #ruby
[11:49:11] tAn: has joined #ruby
[11:53:39] blackmesa: has joined #ruby
[11:58:59] despai: has joined #ruby
[12:00:36] guardianx: has joined #ruby
[12:02:45] dinfuehr: has joined #ruby
[12:06:43] dviola: has joined #ruby
[12:06:47] cdg_: has joined #ruby
[12:08:00] Prutheus: Hello! I am working with GTK. want to create a dialog window (https://ruby-gnome2.osdn.jp/hiki.cgi?Gtk%3A%3ADialog) The style Dialog.new('title', parent, ...) is deprecated, so I want to use Dialog.new(title: 'title
[12:08:02] Prutheus: ', parent: parent, ...
[12:08:03] Prutheus: But with the buttons I dont know how to do it
[12:08:05] Prutheus: dialog = Gtk::Dialog.new(title: 'Message', parent: @gui_elements['wnd'], flags: Gtk::DialogFlags::DESTROY_WITH_PARENT, buttons: [Gtk::Stock::OK, Gtk::ResponseType::NONE])
[12:08:08] Prutheus: This results in:
[12:08:10] Prutheus: https://bpaste.net/show/7ed29b6c2167
[12:09:07] plexigras: has joined #ruby
[12:11:42] cdg: has joined #ruby
[12:12:04] clemens3: has joined #ruby
[12:12:43] uZiel: has joined #ruby
[12:13:53] za1b1tsu: I'm making a complex raw sql and even though the code will be ugly I want some nice structure when attaching values to it, anyone has an example or seen some nice doe where they us a complex raw sql?
[12:14:25] cdg_: has joined #ruby
[12:17:34] bkxd_: has joined #ruby
[12:18:11] dcluna: has joined #ruby
[12:21:22] tomphp: has joined #ruby
[12:22:05] DmitryBochkarev: has joined #ruby
[12:22:38] za1b1tsu: I find this syntax a lot <<-SQL .... SQL, can't find it in the documentation? Anybody knows that it is?
[12:23:11] alfiemax: has joined #ruby
[12:24:55] tbuehlmann: za1b1tsu: search for "heredoc"
[12:25:36] BTRE: has joined #ruby
[12:26:59] za1b1tsu: tbuehlmann: oh I see, thank you. So the SQL tags simply mean to_sql>
[12:28:02] IsoLinCHiP: has joined #ruby
[12:28:39] tbuehlmann: no, that's just a way to write multiline strings
[12:28:51] tomphp: has joined #ruby
[12:29:55] za1b1tsu: I understand, thanks
[12:30:24] reber: has joined #ruby
[12:30:31] IsoLinCHiP: Hi, I am trying to use the builtin PrettyPrint to create some readable output of nested hashes, which I then would like to prepend with email like quoting ("> "). I tryed passing a block to the PrettyPrint.new() {|w| "> #{' ' * w}"} but it didnt have the desired effect. Did I interpret the docs wrong, or does someone have an alternativ suggestion?
[12:36:39] jrafanie: has joined #ruby
[12:41:29] Prutheus: Hello! I am working with GTK. want to create a dialog window (https://ruby-gnome2.osdn.jp/hiki.cgi?Gtk%3A%3ADialog) The style Dialog.new('title', parent, ...) is deprecated, so I want to use Dialog.new(title: 'title
[12:41:30] Prutheus: ', parent: parent, ...
[12:41:32] Prutheus: But with the buttons I dont know how to do it
[12:41:34] Prutheus: dialog = Gtk::Dialog.new(title: 'Message', parent: @gui_elements['wnd'], flags: Gtk::DialogFlags::DESTROY_WITH_PARENT, buttons: [Gtk::Stock::OK, Gtk::ResponseType::NONE])
[12:41:35] Prutheus: This results in:
[12:41:38] Prutheus: https://bpaste.net/show/7ed29b6c2167
[12:42:02] Prutheus: How to parse arguments like buttons* correctly via :buttons syntax?
[12:42:57] tomphp: has joined #ruby
[12:45:22] InfinityFye: has joined #ruby
[12:45:42] InfinityFye: has left #ruby: ()
[12:51:32] Prutheus: Please guys, someone of you must know the solution!
[12:52:05] InfinityFye: has joined #ruby
[12:54:11] sleetdrop: has joined #ruby
[12:56:51] vondruch: has joined #ruby
[12:57:39] cremes: has joined #ruby
[12:58:47] AJA4350: has joined #ruby
[12:59:22] naprimer2: has joined #ruby
[13:00:46] vondruch: has joined #ruby
[13:05:37] InfinityFye: has left #ruby: ("Leaving")
[13:06:44] tomphp: has joined #ruby
[13:06:51] elphe: has joined #ruby
[13:08:07] Prutheus: please .... need to continue working ...
[13:09:06] Prutheus: hey, u can help me tbuehlmann ?
[13:09:29] tbuehlmann: no, sorry, need to continue working
[13:10:19] Prutheus: are you trolling me? :D
[13:10:59] Prutheus: I just said that because I asked 3 hours ago already and can only continue my work when i can fix that
[13:13:41] ctp_: has joined #ruby
[13:17:36] szulak: has joined #ruby
[13:18:22] mtkd: has joined #ruby
[13:19:43] guille-moe: has joined #ruby
[13:22:46] canton7: prutheus, try and debug the issue yourself. Remove things. What do you have to remove to make the problem go away? Can you find a similar example which works? If so, change it piece-by-piece into what you pasted, and see which step causes it to fail. Have you tried googling? Has anyone else had the same issue?
[13:25:08] Prutheus: canton7: when i do the deprecated method by giving all arguments after each other without a key it works
[13:25:09] Sylario: has joined #ruby
[13:25:18] Prutheus: i just have the problem with the keys arguments
[13:25:50] Psybur: has joined #ruby
[13:26:18] canton7: prutheus, OK, so you need to give an argument which you aren't, giving, presumably
[13:26:28] canton7: like I said, start with something that works, then change it bit-by-bit until it stops working
[13:26:31] bmurt: has joined #ruby
[13:26:41] canton7: so start by giving all arguments, and remove them one-by-one until your problem appears
[13:27:58] Prutheus: but the problem is the argument buttons*
[13:28:09] Prutheus: i think i cant give it as buttons: [...]
[13:28:26] canton7: do you have a working example of using buttons?
[13:32:22] Prutheus: yes, without the style of keyword argument list
[13:32:37] Prutheus: you did not understand my problem, right?
[13:34:44] canton7: I've never used ruby+gtk, I'm trying to give you some general debugging tips, since your toolkit seems to consist solely of posting the same question with insufficient information multiple times over :)
[13:35:30] canton7: my understanding of what you've said is that it works fine if you specify all parameters, but fails to work if you use keyword args to specify only some parameters
[13:35:37] canton7: now, did you understand my suggestion?
[13:36:46] Prutheus: canton7: it has nothing to do with gtk i think. listen again please:
[13:36:55] jeffreylevesque: has joined #ruby
[13:37:30] Prutheus: when i fill the arguments of Gtk::Dialog.new(title = nil, parent = nil, flags = nil, [button_face1, response_id1], [button_face2, response_id2], .....) like .new('title', parent, flags, [btn, response]) it works
[13:38:00] Prutheus: if I do .new(title: 'title', parent: parent, flags: flags, buttons: [btn, response]) it fails
[13:38:54] canton7: are you actually passing *all* parameters when you use the keyword args? Or just some?
[13:40:18] canton7: can you pastebin the full working version and the full non-working version?
[13:45:28] mozzarella: prutheus: paste some actual code, dude
[13:45:54] cdg: has joined #ruby
[13:49:23] cdg: has joined #ruby
[13:53:08] qba73: has joined #ruby
[13:53:10] ewaters: has joined #ruby
[13:53:48] Prutheus: works: https://bpaste.net/show/322ad8224357
[13:53:54] Prutheus: works not: https://bpaste.net/show/d0876b41a3ba
[13:55:20] jeffreylevesque_: has joined #ruby
[13:59:06] tcopeland: has joined #ruby
[14:00:44] tbuehlmann: those are different things. take the one that works?
[14:03:05] canton7: prutheus, does 'buttons' need to be an array of arrays?
[14:03:42] rfoust: has joined #ruby
[14:04:46] mikecmpbll: canton7 : yep.
[14:05:21] luna_x: has joined #ruby
[14:05:54] Flonk: has joined #ruby
[14:06:57] graft: has joined #ruby
[14:08:56] chocoelho: has joined #ruby
[14:10:01] heliumk: has joined #ruby
[14:12:46] elphe: has joined #ruby
[14:13:28] canton7: prutheus, did you see my suggestion?
[14:14:10] heliumk: has joined #ruby
[14:15:37] Ishido: has joined #ruby
[14:17:09] alex``: has joined #ruby
[14:18:19] alfiemax: has joined #ruby
[14:19:02] reber__: has joined #ruby
[14:23:02] Frem: has joined #ruby
[14:23:09] despai: has joined #ruby
[14:27:19] cdolan: has joined #ruby
[14:28:35] luna_x: has joined #ruby
[14:30:50] aScottishBoat: has joined #ruby
[14:30:52] krawchyk: has joined #ruby
[14:34:06] vondruch: has joined #ruby
[14:34:55] reber: has joined #ruby
[14:39:57] chocoelho: has joined #ruby
[14:40:15] pastorinni: has joined #ruby
[14:40:21] BTRE: has joined #ruby
[14:41:44] ewaters: has joined #ruby
[14:42:27] elphe: has joined #ruby
[14:44:12] reber__: has joined #ruby
[14:45:50] jrafanie: has joined #ruby
[14:46:59] reber: has joined #ruby
[14:53:25] jobewan: has joined #ruby
[14:56:46] jrafanie: has joined #ruby
[14:58:58] skawa: is it normal to use use a take task to define an always-running service ?
[14:59:23] skawa: s/take/rake
[14:59:28] ldepandis: has joined #ruby
[15:01:12] Prutheus: canton7: tbuehlmann so what must i do now to get it working?
[15:01:28] canton7: prutheus, try 'buttons: [[thing, thing]]' instead of 'buttons: [thing, thing]'
[15:01:28] tbuehlmann: you wrote you had it working, use that version
[15:02:19] workmad3: has joined #ruby
[15:02:30] Prutheus: tbuehlmann: not possible with rubocop
[15:02:58] Prutheus: canton7: thanks!
[15:03:28] dminuoso: skawa: I wouldnt say its normal.
[15:04:30] canton7: prutheus, I figured that out by reading the gtk docs, and looking at the links to the source
[15:04:58] qba73: has joined #ruby
[15:05:03] Rapture: has joined #ruby
[15:05:21] InfinityFye: has joined #ruby
[15:05:59] Psybur_: has joined #ruby
[15:06:37] despai: has joined #ruby
[15:07:07] oleo: has joined #ruby
[15:07:13] Psybur: has joined #ruby
[15:08:01] nit3rid3: has joined #ruby
[15:10:01] polishdub: has joined #ruby
[15:10:28] polishdub: has left #ruby: ()
[15:12:21] chocoelho: has joined #ruby
[15:12:26] jnollette: has joined #ruby
[15:15:10] despai: has joined #ruby
[15:16:57] uZiel: has joined #ruby
[15:18:07] conta5: has joined #ruby
[15:19:40] nadir: has joined #ruby
[15:20:03] InfinityFye: has left #ruby: ("Leaving")
[15:22:41] sleetdrop: has joined #ruby
[15:24:45] alex``: has joined #ruby
[15:24:46] despai: has joined #ruby
[15:25:40] Prutheus: has joined #ruby
[15:25:52] Prutheus: Hi. I have following code: https://bpaste.net/show/d1cbdf553751
[15:26:24] Prutheus: I want to merge all csv files and apply a header to my new file. But for some reasons, the header sting is inserted 2 times, at the beginning of my new file and in the middle somewhere
[15:26:40] marr: has joined #ruby
[15:30:26] krawchyk: has joined #ruby
[15:30:35] headius: has joined #ruby
[15:31:12] jrafanie: has joined #ruby
[15:31:21] nwm: has joined #ruby
[15:34:46] despai: has joined #ruby
[15:35:01] ldepandis: has joined #ruby
[15:35:15] blackmesa: has joined #ruby
[15:42:53] krawchyk: has joined #ruby
[15:43:58] alex``: has joined #ruby
[15:44:59] jrafanie: has joined #ruby
[15:47:29] kculpis: has joined #ruby
[15:55:09] despai: has joined #ruby
[15:55:56] gix: has joined #ruby
[15:56:55] dionysus69: has joined #ruby
[15:59:56] cschneid_: has joined #ruby
[16:01:14] [Butch]: has joined #ruby
[16:01:48] banisterfiend: has joined #ruby
[16:02:10] sonOfRa: has joined #ruby
[16:03:06] c785127: has joined #ruby
[16:15:38] dtzuzu: has joined #ruby
[16:15:53] workmad3: has joined #ruby
[16:16:12] rwb: has joined #ruby
[16:16:12] konsolebox: has joined #ruby
[16:16:54] alfiemax: has joined #ruby
[16:17:16] chocoelho: has joined #ruby
[16:18:52] alfiemax: has joined #ruby
[16:20:01] ltem: has joined #ruby
[16:20:34] jamesaxl: has joined #ruby
[16:22:54] vipaca: has joined #ruby
[16:23:26] deafscribe: has joined #ruby
[16:23:28] mtkd: has joined #ruby
[16:26:11] conta: has joined #ruby
[16:26:15] heliumk: has joined #ruby
[16:27:23] jrafanie: has joined #ruby
[16:31:14] tomphp: has joined #ruby
[16:34:00] cschneid_: Is there a built-in way to have a proc that runs only once? my_proc.call #=> runs, my_proc.call #=> nil, since it ran already
[16:35:38] dminuoso: cschneid_: class SingletonProc < Proc; def call ...
[16:38:52] cschneid_: dminuoso: sure, I know I can write it myself, I was wondering if it existed before I did :)
[16:39:01] cschneid_: it's a built-in in some other languages
[16:39:17] dminuoso: Oh good.. I really wasnt sure whether you were drunk or something.
[16:40:00] IsoLinCHiP: has joined #ruby
[16:40:01] dminuoso: cschneid_: The closest trick I can think of is using a trick based on Ox0dea's magic var hack.
[16:40:16] dminuoso: He did a really minor monkey patch to tap into $
[16:40:31] cschneid_: too early to be drunk :) That seems way too fancy, I'll just do a @foo ||= begin/end block instead
[16:40:37] dminuoso: Think you could do some ||= memoization trick with that
[16:41:04] cschneid_: its been interesting using rust recently, which has some of these kinds of tools in its syncronization library
[16:42:03] dminuoso: cschneid_: Im not sure whether such a proc is good style.
[16:43:00] eightlimbed: has joined #ruby
[16:43:08] cagomez: has joined #ruby
[16:43:38] cagomez: has joined #ruby
[16:43:50] cschneid_: the underlying goal is: "Log this message the first time through this path, but don't log afterwards"
[16:44:06] cschneid_: which is such a simple goal that it doesn't matter how I do it :)
[16:48:05] armyriad: has joined #ruby
[16:51:50] _aeris_: hello here !
[16:51:51] _aeris_: https://github.com/ruby/ruby/commit/678e4ea5b495893e2e9a7a6cf0045085623622f8
[16:52:06] _aeris_: does anybody know the reason of this commit ?
[16:52:49] _aeris_: I lost 2h to find http_proxy is not taken into account if you try to connect to a 127.0.0.1 or ::1 host…
[16:53:47] dminuoso: _aeris_: I'd say you have a better chance at asking on the mailing list.
[16:54:43] dminuoso: _aeris_: otoh.. how would it use a proxy with 127.0.0.1 ?
[16:54:57] dminuoso: _aeris_: I mean if you think about it, lets say you have a remote proxy configured.
[16:55:17] dminuoso: How would that play out?
[16:55:23] dminuoso: 127.0.0.1 is not "your computer"
[16:55:25] dminuoso: its the loopback interface.
[16:55:32] _aeris_: i use mitmproxy to look my request
[16:55:55] dminuoso: _aeris_: you have to use wireshark/tcpdump in this case.
[16:56:12] dminuoso: _aeris_: once it goes out, its not exactly loopback anymore, and it becomes impossible to route.
[16:56:18] _aeris_: so accessing to 127.0.0.1:3000 (rails) is forwarded to 127.0.0.1:8080 (mitmproxy) then forwarded to 127.0.0.1:3030
[16:56:31] dminuoso: _aeris_: Imagine the proxy is on another computer in your network.
[16:56:40] dminuoso: Just for the sake of argument.
[16:57:09] dminuoso: Im not sure this would work. the proxy should be ignored for loopback
[16:57:28] dminuoso: and since the relevant RFC suggests localhost points at loopback (and it grants the freedom to treat localhost specially) this seems fine
[16:57:57] _aeris_: even if you use a remote computer, it works too
[16:58:02] dminuoso: How would it?
[16:58:14] _aeris_: no problem at all
[16:58:18] dminuoso: _aeris_: Where would the proxy route it to?
[16:58:33] _aeris_: remote computer access it own localhost, and forward the request to the client :)
[16:58:35] dminuoso: You request 127.0.0.1, which means "give me the loopback device", now the proxy has your HTTP request in the hand.
[16:58:37] dminuoso: Where does it go?
[16:58:43] pastorinni: has joined #ruby
[16:58:48] dminuoso: _aeris_: Yeah no..
[16:58:58] dminuoso: _aeris_: So proxies by nature expose their loopback device?
[16:59:16] _aeris_: this is a proxy, the real request is done on the remote server
[16:59:29] dminuoso: _aeris_: Except the requested server is your own loopback.
[16:59:33] dminuoso: The proxy cant handle this.
[16:59:48] _aeris_: it perfectly can handle this
[17:00:02] drewmcmillan: has joined #ruby
[17:00:09] _aeris_: you just connect to remote:xxx instead of localhost:yyy
[17:00:25] _aeris_: you send a GET / HTTP/1.1\nHost: localhost
[17:00:43] dminuoso: _aeris_: except..
[17:00:47] dminuoso: What IP address does this get sent to?
[17:00:51] dminuoso: Remember, you requested localhost.
[17:01:05] dminuoso: which implies loopback device. your client requests to access its own loopback device.
[17:01:08] _aeris_: i request localhost or 127.0.0.1, no problem
[17:01:25] DmitryBochkarev: has joined #ruby
[17:01:27] dminuoso: The remote proxy cant serve this because it may not have your loopback device.
[17:01:47] dminuoso: "A datagram sent by a higher-level protocol to an address anywhere within this block loops back inside the host."
[17:02:05] _aeris_: i don't request loopback
[17:02:12] dminuoso: localhost is usually mapped to 127.0.0.1
[17:02:17] _aeris_: i request accessing http://localhost:3000/ with HTTP
[17:02:25] dminuoso: _aeris_: check your /etc/hosts
[17:02:41] _aeris_: so normal process is "TCP connecting to localhost:3000, send GET / HTTP/1.1\nHost: localhost"
[17:03:04] _aeris_: proxy process is "TCP connecting to remote:8080, send GET / HTTP/1.1\nHost: localhost"
[17:03:43] eightlimbed: has joined #ruby
[17:03:44] _aeris_: proxy will itself connect to TCP localhost:3000
[17:04:05] _aeris_: grab the response, send it to the TCP connection with the client
[17:04:17] _aeris_: no problem of routing at all
[17:04:31] john__: has joined #ruby
[17:06:32] TomyLobo: has joined #ruby
[17:06:36] _aeris_: with proxy, you even be able to ask for resource not routable for you, but routable from the proxy
[17:07:12] alex``: has joined #ruby
[17:08:36] eckhardt: has joined #ruby
[17:09:06] ewaters: has joined #ruby
[17:09:17] leitz: has joined #ruby
[17:12:10] dminuoso: _aeris_: And the proxy really cant send it to its own localhost. Proxies should be transparent.
[17:12:28] _aeris_: no, proxy is not transparent
[17:12:41] _aeris_: and proxy can really sent it to its own localhost
[17:12:51] _aeris_: i have no problem at all with this setting
[17:13:03] _aeris_: you mix TCP and HTTP OSI level here
[17:13:06] vipaca: has joined #ruby
[17:13:28] _aeris_: there is no DNS resolution nor IP access from the client side when a http proxy is used
[17:13:47] _aeris_: the only DNS/IP thing is related to proxy IP resolution
[17:14:04] _aeris_: HTTP content will be fully resolve only on the remote part
[17:14:38] dminuoso: _aeris_: A proxy is a forwarding agent, [...] forwarding the reformatted request toward the server identified by the URI.
[17:15:02] _aeris_: yep, it forward the *HTTP* request
[17:15:07] _aeris_: not the DNS or IP one
[17:15:11] dminuoso: _aeris_: Since from the perspective localhost identifies itself, it would be required to forward it back.
[17:15:35] _aeris_: "localhost" has no more meaning here than "google.fr"
[17:15:47] _aeris_: or "foo.onion"
[17:16:02] dminuoso: _aeris_: Yes it does.
[17:16:04] _aeris_: or "300.4.800.3"
[17:16:06] jokke: has joined #ruby
[17:16:07] dminuoso: _aeris_: RFC 6761.
[17:16:27] havenwood: https://tools.ietf.org/html/rfc6761
[17:16:27] dminuoso: Users are free to use localhost names as they would any other domain names. Users may assume that IPv4 and IPv6 address queries for localhost names will always resolve to the respective IP loopback address.
[17:16:36] dminuoso: Application software MAY recognize localhost names as special, or MAY pass them to name resolution APIs as they would for other domain names.
[17:16:42] dminuoso: These two paragraphs are relevant.
[17:16:44] _aeris_: .onion is a pretty good example because it *MUST NOT* be resolve client side !
[17:17:06] dminuoso: _aeris_: Please check the RFC and the cited paragraphs.
[17:17:09] _aeris_: dminuoso > you speak IP and DNS here, not TCP
[17:17:31] _aeris_: you don't have to apply 6761 for http proxying
[17:17:31] dminuoso: _aeris_: How do you think HTTP is transmitted..
[17:17:41] Vapez: has joined #ruby
[17:17:45] _aeris_: HTTP is transmitted on TCP link
[17:17:53] _aeris_: but on remote proxy TCP link
[17:17:54] dminuoso: And how do you think TCP is transmitted.
[17:18:13] dminuoso: And strictly speaking HTTP doesnt care whatsoever.
[17:18:14] _aeris_: no relation between the "localhost" in the *HTTP* part and the TCP/IP part
[17:18:29] dminuoso: _aeris_: And the RFC is not about TCP or IP, its about DNS and nothing else.
[17:18:34] _aeris_: if you use TLS, you don't even know the name inside the HTTP socket
[17:18:45] dminuoso: _aeris_: localhost is just a domain name, but its a special oine.
[17:18:58] _aeris_: yep, and with HTTP proxying, there is NO DNS nor IP resolution for the HTTP part
[17:19:09] dminuoso: 18:16 dminuoso | Application software MAY recognize localhost names as special, or MAY pass them to name resolution APIs as they would for other domain names.
[17:19:11] dminuoso: 18:16 dminuoso | Application software MAY recognize localhost names as special, or MAY pass them to name resolution APIs as they would for other domain names.
[17:19:18] dminuoso: "Application software MAY [..."
[17:19:32] _aeris_: yep but you *DONT* see the localhost part when you proxying !
[17:19:38] dminuoso: So essentially any software that sees "localhost" in a spot where it suspects a domain name is free to do magic.
[17:19:43] dminuoso: _aeris_: Ruby does.
[17:19:45] dminuoso: Ruby sees it.
[17:19:48] _aeris_: you just forward a bunch of HTTP packets
[17:19:51] dminuoso: And ruby uses the freedom given by RFC 6761.
[17:19:53] _aeris_: no, ruby don't see
[17:20:02] _aeris_: https://mamot.fr/@devnull/99286994232681495
[17:20:08] _aeris_: https://mamot.fr/@Dam_ned/99286979108210224
[17:20:12] _aeris_: https://mastodon.social/@kanor/99286949437988387
[17:20:33] _aeris_: any sane network people see this patch as a horrible thing
[17:20:41] _aeris_: breaking Tor for example
[17:21:23] dminuoso: _aeris_: My point is: Its reasonable for Ruby to assume that if it sees its intended for localhost that the proxy couldnt possibly satisfy the request, it might do the "nice thing"
[17:21:57] _aeris_: you can't guess if the proxy could or couldn't satisfy the request
[17:22:08] _aeris_: perhaps it can, perhaps it can't
[17:22:11] dminuoso: _aeris_: The HTTP RFC forces proxies to respect the URI and forward it to the system the client wants. And since the client wants localhost, it couldnt possibly satisfy that request in all likelihood
[17:22:38] dminuoso: You can in reality because localhost is almost always mapped to the loopback device
[17:23:02] dminuoso: Besides the RFC 6761 gives Ruby the freedom to behave specially.
[17:23:03] _aeris_: A proxy is a
[17:23:03] ewaters: has joined #ruby
[17:23:04] _aeris_: forwarding agent, receiving requests for a URI in its absolute form,
[17:23:05] _aeris_: rewriting all or part of the message, and forwarding the reformatted
[17:23:07] _aeris_: request toward the server identified by the URI.
[17:23:08] _aeris_: https://tools.ietf.org/html/rfc2068
[17:23:16] dminuoso: _aeris_: "toward the server identified by the URI"
[17:23:23] darkhanb: has joined #ruby
[17:23:24] _aeris_: URI in *absolute form*
[17:23:52] _aeris_: server indentified by url is "localhost" from the remote part
[17:23:54] _aeris_: not the local part
[17:24:30] workmad3: has joined #ruby
[17:24:31] dminuoso: _aeris_: Absolute uri does not mean a perspective.
[17:24:42] dminuoso: _aeris_: It just means following 4.3 as per RFC 3986
[17:24:53] dminuoso: Which basically means absolute-URI = scheme ":" hier-part [ "?" query ]
[17:24:59] _aeris_: yep, so just forward the uri and don't try to guess what the server could do
[17:25:28] dminuoso: _aeris_: Except that tiny bit about RFC 6761.
[17:25:37] _aeris_: not at all
[17:25:39] dminuoso: _aeris_: HTTP does not prevent application software from looking at the request before sending it into its HTTP stack
[17:25:50] blackmesa: has joined #ruby
[17:25:50] _aeris_: you don't have to mitm every connection to fight localhost inside
[17:26:05] _aeris_: i could ask domain name resolving to localhost too
[17:26:07] _aeris_: not a problem
[17:26:16] _aeris_: i could ask not resolvable domain from my part
[17:26:28] dminuoso: _aeris_: language barrier is hitting here I think
[17:26:34] dminuoso: _aeris_: Can you rephrase your point?
[17:27:02] _aeris_: 6761 is *ONLY* application when *YOU* have to handle an *IP* or *DNS* job
[17:27:31] _aeris_: you don't have to apply 6761 if you are on HTTP or more generally application level
[17:27:48] _aeris_: I could pass localhost on a TLS session
[17:27:56] dminuoso: _aeris_: From the perspective of the Ruby program, Ruby is the application program.
[17:27:58] dminuoso: Forget HTTP for a moment.
[17:28:00] _aeris_: or "foo.bar" resolving to "127.0.0.1"
[17:28:08] dminuoso: What happens is that there's a program trying to interact with a server using DNS.
[17:28:11] _aeris_: no, ruby is not the application program
[17:28:20] dminuoso: It is from a different perspective
[17:28:38] _aeris_: if you try to resolve special domain, 6761 apply
[17:28:47] dminuoso: According to what?
[17:29:12] dminuoso: _aeris_: Application software is not involved in name resolution
[17:29:15] _aeris_: your resolver (the application program) would
[17:29:23] dminuoso: _aeris_: So explain to me this:
[17:29:33] _aeris_: application software is the part of software handle the IP or DNS
[17:29:36] _aeris_: not any upper level…
[17:29:50] dminuoso: 2. Application software MAY recognize localhost names as special, or MAY pass them to name resolution APIs as they would for other domain names.
[17:29:51] _aeris_: here application software is request or faraday
[17:29:53] dminuoso: This is straight from 6761
[17:30:07] dminuoso: It talks about software that somehow knows theres a domain name involved
[17:30:09] dminuoso: when you do
[17:30:12] _aeris_: and in this case, it doen't do IP or DNS, so 6761 not applicable
[17:30:19] dminuoso: print Net::HTTP.get(URI('http://www.example.com/index.html'))
[17:30:26] aScottishBoat: has joined #ruby
[17:30:33] dminuoso: That is application software that can reasonably be expected to know about domain names.
[17:30:39] _aeris_: you don't known if the domain will be resolv or not at this point
[17:30:42] dminuoso: The fact that theres HTTP is irrelevant.
[17:30:44] wolfshappen: has joined #ruby
[17:31:08] _aeris_: you just say "hey, i have a HTTP request for GET http://www.example.com/index.html"
[17:31:18] dminuoso: _aeris_: Its not about HTTP, its about Ruby being application software.
[17:31:29] dminuoso: 6761 does not apply to just name resolvers, which is why it talks about application software.
[17:31:39] dminuoso: 2. Application software MAY recognize localhost names as special, or MAY pass them to name resolution APIs as they would for other domain names.
[17:31:50] _aeris_: 6761 apply only to software doing IP or DNS
[17:31:55] dminuoso: _aeris_: ^--
[17:31:57] dminuoso: read that cited paragraph
[17:31:59] dminuoso: until the end.
[17:32:06] dminuoso: [...] or MAY pass them to name resolution APIs as they would for other domain names.
[17:32:28] dminuoso: Its just application software.
[17:32:50] _aeris_: I work with the tor project and rfc-writer about 6761
[17:33:02] _aeris_: I perfectly understand what the 6761 say
[17:33:16] dminuoso: _aeris_: Is that person on freenode?
[17:33:21] alex``: has joined #ruby
[17:33:36] _aeris_: I call him :)
[17:34:20] reber__: has joined #ruby
[17:34:26] guille-moe: has joined #ruby
[17:36:37] cloaked1: has joined #ruby
[17:37:00] ongolaBoy: has joined #ruby
[17:38:23] alfiemax: has joined #ruby
[17:39:44] darkhanb: has joined #ruby
[17:39:51] bortzmeyer: has joined #ruby
[17:40:42] _aeris_: dminuoso > a good example is with the .onion address
[17:41:05] _aeris_: from the ruby point of view, the only moment you have to apply 6761 is if you have to *RESOLV* such domain
[17:41:27] _aeris_: as far the domain stay inside the content or anything else, you have nothing to do
[17:41:54] _aeris_: only when you have to resolve it, you apply 6761 and reply with a NXDOMAIN without accessing the system resolver
[17:42:19] _aeris_: you can have it inside http request, no problem, nothing to do
[17:43:04] _aeris_: in this case, you will certainly have a HTTP proxy (HTTP or SOCKS proxy of tor) and have to forward it "as is" inside
[17:43:16] dminuoso: _aeris_: Okay so the part about HTTP I revise my standpoint and accept that at least the proxy should do this bizarre thing of forwarding it to its own loopback as strange as it sounds.
[17:43:46] dminuoso: _aeris_: Ive went through the RFC and there really does not seem to be even the subtlest point that the proxy must be transparent in the "clients expectations" of the URI
[17:44:09] _aeris_: this is the same for every parts : you only apply 6761 when you have to handle directly the domain or IP
[17:44:17] _aeris_: http://www.bortzmeyer.org/6761.html
[17:44:21] dminuoso: _aeris_: But the thing I cant agree on, is that 6761 is limited to just resolvers. The reason is that it makes a few statements about application software itself.
[17:44:23] _aeris_: (RFC reviewer)
[17:44:36] dminuoso: I dont speak French. :|
[17:44:41] dminuoso: But I guess I could google translate.
[17:44:54] _aeris_: example he quote : application manipulating dns, recursive dns, caching dns
[17:45:04] _aeris_: oh, bortzmeyer is here :)
[17:45:12] dminuoso: bortzmeyer: o/
[17:45:37] _aeris_: bortzmeyer > https://github.com/ruby/ruby/commit/678e4ea5b495893e2e9a7a6cf0045085623622f8
[17:45:43] _aeris_: starting point is here :)
[17:46:00] dminuoso: _aeris_: Note in all fairness, Im not arguing that the change is sane.
[17:46:07] dminuoso: _aeris_: Im just arguing that I think it's valid.
[17:46:19] dminuoso: Just so there's no misconception.
[17:46:32] _aeris_: during an HTTP request, if you define a proxy, ruby decide to bypass the http proxy if requested URL resolve to localhost
[17:47:13] _aeris_: from the dminuoso PoV, it's valid because 6761, and localhost is a special domain, and must not be forwarded through the proxy
[17:47:23] dminuoso: In particular
[17:47:57] dminuoso: I consider it as allowed under the paragraph 6.3p2 (in conjunction with 6.3p1) of that RFC.
[17:47:59] _aeris_: from my PoV, 6761 doesn't apply here because at this part, this is just HTTP/OSI-7, 6761 only apply for "application software" related to IP or DNS
[17:48:01] dminuoso: I consider Ruby to be application software.
[17:48:03] bortzmeyer: _aeris_: the patch does not handle localhost, it tests the IP address, that's quite different
[17:48:34] dminuoso: bortzmeyer makes a very valid point there..
[17:48:43] _aeris_: yep, it's worse here
[17:48:56] dminuoso: Okay I may have just lost that argument there.
[17:49:01] _aeris_: but imagine it test only for "localhost" or "*.onion"
[17:49:14] bortzmeyer: _aeris_: then, I have to think harder
[17:49:36] totolo: has joined #ruby
[17:50:00] _aeris_: and localhost/onion must be treated differently here as 6761/7686 :P
[17:50:10] _aeris_: (not exactly here, but not too far)
[17:50:19] bortzmeyer: _aeris_: no, localhost and onion are very different
[17:50:40] dminuoso: bortzmeyer: I think treating onion specially would be invalid, but the main point of contention is localhost.
[17:50:41] tomphp: has joined #ruby
[17:50:42] bortzmeyer: _aeris_: MAY for localhost MUST for onion
[17:50:44] _aeris_: if no proxy configure, "*.onion" will certainly be resolved here, and so must be NXDOMAIN immedialty
[17:51:14] bortzmeyer: _aeris_: we should go back to the goals. The goal of .onion is security/privacy/etc. Leaking .onion names is bad
[17:51:18] hahuang65: has joined #ruby
[17:51:23] bortzmeyer: _aeris_: localhost has different goals
[17:51:34] dminuoso: bortzmeyer: If Ruby did treat localhost in the URI specially to bypass proxies, would this be legitimate from the perspective of all relevant RFCs?
[17:52:05] bortzmeyer: dminuoso: may be "legal" but I fail to see WHY this special case.
[17:52:46] orbyt_: has joined #ruby
[17:52:58] dminuoso: bortzmeyer: Well I think the idea being that a proxy couldnt sensibly forward it to loopback since its reasonable to expect that the client wanted to connect to its own loopback interface.
[17:53:26] _aeris_: for me, 6761 will be applied here only if you have to manage a DNS resolution or IP routing
[17:53:50] _aeris_: if not, you are not the "application software" (not well) defined in 6761
[17:54:13] dminuoso: _aeris_: I think this point is really important. Its not very clearly defined what constitutes as "application software"
[17:54:33] _aeris_: until you have no other choice than doing IP/DNS, 6761 is not applicable
[17:55:23] _aeris_: or saying differently, as far you can handle the URI "as is", no 6761
[17:56:03] dminuoso: _aeris_: I understand what you are trying to convey, and I do see how you could interpret 6761 in that manner.
[17:56:27] dminuoso: _aeris_: There's enough to imply that its about software that somehow needs to figure out the IP address in order to work, and that would be free to behave differently if it had to resolve localhost.
[17:56:39] dminuoso: _aeris_: But otoh its not well defined, and there's this bit at the topc:
[17:56:43] dminuoso: Application Software: Are writers of application software expected to make their software recognize these names as special and treat them differently? [...]
[17:56:50] blackmesa: has joined #ruby
[17:57:11] dminuoso: One could easily interpret this as "well if the application happens to see that domainname it does [magic]"
[17:57:25] _aeris_: this is not a real definition, because this is a question :P
[17:57:31] dminuoso: (in conjunction with the previously mentioned paragraphs)
[17:57:39] dminuoso: _aeris_: But there's no real definition for your point either.
[17:58:37] _sfiguser: has joined #ruby
[17:59:36] dminuoso: _aeris_: I mean the real nasty counter example for my original point
[17:59:45] dminuoso: Is if you defined some custom entry: magick 127.0.0.1
[17:59:48] dminuoso: in your /etc/hosts
[17:59:50] dminuoso: which would still trigger this.
[18:00:32] theo__: has joined #ruby
[18:01:29] vipaca: has joined #ruby
[18:01:45] dminuoso: _aeris_: If it actually acted on localhost I think it'd be fine. Perhaps even desirable to a certain extend.
[18:02:04] dminuoso: (Which is my personal opinion)
[18:02:10] Emmanuel_Chanel: has joined #ruby
[18:02:23] sanscoeur: has joined #ruby
[18:02:50] _aeris_: I use a lot proxying to "resolve" resources available only on localhost on the remote proxy :D
[18:03:16] dminuoso: Mind my asking, what for?
[18:03:23] dminuoso: This sounds a bit unusual
[18:03:37] _aeris_: not at all
[18:03:57] _aeris_: for example, running imaps or http admin system only on localhost
[18:04:16] _aeris_: and available only through a bastion proxy
[18:04:26] mikecmpbll: has joined #ruby
[18:04:59] _aeris_: can also be not only localhost but any private IP or domain
[18:05:13] dminuoso: _aeris_: Yeah but why use an actual proxy? You could just set up an nginx reverse proxy.
[18:05:44] _aeris_: will have the same trouble with the nginx
[18:05:53] _aeris_: can't be publicly available because of security
[18:06:06] dminuoso: _aeris_: but your proxy is publicly available.
[18:06:12] dminuoso: _aeris_: If this is about authentication, nginx can handle this too.
[18:06:18] _aeris_: yep, but hardly securized
[18:06:33] _aeris_: with only SSH available for example
[18:06:34] dminuoso: _aeris_: okay so you are presuming some special proxy software.
[18:06:45] _aeris_: not at all :D
[18:06:54] _aeris_: just plain ssh proxy feature
[18:07:01] _aeris_: ssh -L or ssh -D
[18:07:38] _aeris_: in this case, it's SOCKS proxy, but i have a HTTP to SOCKS proxy for application not able to talk SOCKS
[18:07:38] dminuoso: _aeris_: but thats just forwarding and not HTTP proxying.
[18:07:54] dminuoso: Well what is the socks proxy for then?
[18:08:00] dminuoso: I mean if you have an SSH tunnel you're already on the other machine.
[18:08:29] _aeris_: i'm already on the other machine, but application run on my desktop :P
[18:09:10] _aeris_: for example if I run a ruby from my desktop consuming remote http resource
[18:10:25] _aeris_: very usefull too to debug not accessible resources behind DMZ or firewall
[18:10:42] _aeris_: hitting internal API from your IDE <3
[18:10:47] alex``: has joined #ruby
[18:11:07] dminuoso: _aeris_: I gotta run, but Im not sure I fully understand.
[18:11:16] dminuoso: Needs pretty pictures I think.
[18:11:46] _aeris_: i'm able to ssh to a machine running a private api
[18:11:57] _aeris_: but those private api not exposed publicly
[18:12:19] _aeris_: with proxying, i can troubleshoot from my desktop
[18:12:43] _aeris_: accessing "localhost" through the proxy :D
[18:15:50] nwm: has joined #ruby
[18:20:04] blindMoe: has joined #ruby
[18:20:46] blindMoe: Since the newer version of rubocop wants methods to be implicitly defined in controllers if they are used in an action filter, should I basically just be adding lines like: def show; super; end to appease rubocop?
[18:21:53] blindMoe: my controllers for my API all inherit from a main api_controller.rb which inherits from ActionController::Base so when I create a resource in the routes.rb I am not implicitly defining those methods.. yet rubocop wants me to
[18:22:20] reber: has joined #ruby
[18:28:04] conta2: has joined #ruby
[18:28:29] mtkd: has joined #ruby
[18:28:57] jrafanie: has joined #ruby
[18:31:50] troys: has joined #ruby
[18:37:16] claudiuinberlin: has joined #ruby
[18:38:37] alfiemax_: has joined #ruby
[18:43:10] SeepingN: has joined #ruby
[18:45:06] blindMoe: Could really use some help on this? Also, I meant to say explicitly not implicitly
[18:46:28] c-c: Railsisms? Whats the rails chan, #rubyonrails perhaps
[18:46:46] tobiasvl: 't even understand that it was rails
[18:47:03] alfiemax: has joined #ruby
[18:47:13] c-c: blindmoe: also note that inheritance pattern is kind of masochistic way
[18:47:14] tobiasvl: maybe I should learn enough about rails one day to recognize it when people ask about it here so I can direct them to #RubyOnRails
[18:48:29] blindMoe: c-c: yeah I don't like it.. I am actually just thinking of disabling that rubocop rails. Didn't realize this was a rails specific issue but I can see it not since it is inherting from ActionController::base and using its resource magic
[18:48:45] blindMoe: s/rubocop rails/rubocop rule/
[18:49:01] c-c: tobiasvl: see ActionController module name there?
[18:49:27] troulouliou_div2: has joined #ruby
[18:49:47] c-c: blindmoe: I was taught to use modules instead of inheritance where possible
[18:49:56] Statler_: has joined #ruby
[18:50:42] oetjenj: has joined #ruby
[18:50:55] blindMoe: c-c: yeah unfortunately this is a new company I am working with and it isn't my choice... right now I am just updating rubocop from 0.42 to 0.52.1 and there are a ton of new rules
[18:51:47] eightlimbed: has joined #ruby
[18:53:53] anisha: has joined #ruby
[18:58:45] guille-moe: has joined #ruby
[19:05:12] krawchyk_: has joined #ruby
[19:06:31] alfiemax: has joined #ruby
[19:09:00] sameerynho: has joined #ruby
[19:11:13] nchambers: has joined #ruby
[19:11:20] dinfuehr: has joined #ruby
[19:13:06] lola1212: has joined #ruby
[19:14:23] cdg: has joined #ruby
[19:16:04] mikecmpbll: has joined #ruby
[19:17:29] dionysus69: has joined #ruby
[19:19:03] randomstrangerb: has joined #ruby
[19:19:50] DLSteve: has joined #ruby
[19:20:48] alfiemax: has joined #ruby
[19:23:21] dinfuehr: has joined #ruby
[19:24:48] Hanmac: has joined #ruby
[19:24:53] alfiemax_: has joined #ruby
[19:28:10] raynold: has joined #ruby
[19:30:48] guille-moe: has joined #ruby
[19:31:54] dinfuehr: has joined #ruby
[19:33:04] krawchyk: has joined #ruby
[19:33:31] oetjenj: has joined #ruby
[19:33:39] alfiemax: has joined #ruby
[19:34:11] oetjenj: has joined #ruby
[19:35:03] oetjenj: has joined #ruby
[19:35:48] oetjenj: has joined #ruby
[19:36:32] oetjenj: has joined #ruby
[19:38:12] pilne: has joined #ruby
[19:38:18] eckhardt: has joined #ruby
[19:41:33] elphe: has joined #ruby
[19:42:54] krawchyk: has joined #ruby
[19:44:54] aScottishBoat: has joined #ruby
[19:48:13] lytol_: has joined #ruby
[19:48:45] krawchyk: has joined #ruby
[19:53:55] jrafanie_: has joined #ruby
[19:57:27] DmitryBochkarev: has joined #ruby
[19:59:46] jeffreylevesque: has joined #ruby
[20:09:35] marr: has joined #ruby
[20:10:59] c785127: has joined #ruby
[20:16:34] jeffreylevesque_: has joined #ruby
[20:18:14] blackmesa: has joined #ruby
[20:19:04] cagomez: has joined #ruby
[20:19:14] ltem: has joined #ruby
[20:26:27] conta1: has joined #ruby
[20:28:09] c-c: I'm considering leaving freenode. People on freenode take harassment and censorship against others granted, and as a "right" and I cannot accept that. Which other forums do you recoomend for ruby talk & support?
[20:28:24] c-c: *reccomned
[20:28:32] c-c: lol typoitis today
[20:29:07] jenrzzz: has joined #ruby
[20:29:07] jenrzzz: has joined #ruby
[20:29:45] elphe: has joined #ruby
[20:29:46] havenwood: c-c: This is the official channel. There isn't an equivalent Slack channel like for Ruby on Rails.
[20:30:09] eckhardt: has joined #ruby
[20:31:07] havenwood: c-c: Please bring it to the channel op's attention if you see harassment or unwarranted censorship here!
[20:31:34] havenwood: c-c: They do discuss a little Ruby in the Rails Slack channel.
[20:32:11] havenwood: c-c: There are various Gitter channels around the Ruby ecosystem, but again, not an official Ruby lang one.
[20:33:06] havenwood: c-c: The mailing lists are a good bet, but not realtime.
[20:33:07] Dimik: has joined #ruby
[20:34:05] c-c: I actually had a talk with freenode staffers. Most popular response was the xkcd comic where "they are showing you the door" because "people" "think you're an asshole", and accepting that as a response to someone who has been harassed or censored because of their opinion is imo insane. Rotten. Morally bankrupt.
[20:34:56] dinfuehr: has joined #ruby
[20:34:57] nixy: Is your issue in this channel or somewhere else? It seems like if it's in this channel you should talk to this channel's op. If it isn't in this channel then I see no reason to leave
[20:35:08] c-c: (As if the priviledge of speech or position made it OK to harass or censor people, based on their opinion)
[20:35:09] havenwood: c-c: We try very hard to responsibly moderate this channel.
[20:35:23] c-c: nixy: another channel. This is a mellow channel.
[20:37:38] Guest45: has joined #ruby
[20:41:12] despai: has joined #ruby
[20:45:41] ur5us: has joined #ruby
[20:47:59] alfiemax_: has joined #ruby
[20:48:14] despai: has joined #ruby
[20:48:20] DrCode: has joined #ruby
[20:49:09] Eiam: just leave the channel?
[20:49:14] Eiam: #ruby is pretty great...
[20:49:21] Revan007: has joined #ruby
[20:54:11] alfiemax: has joined #ruby
[20:54:44] ewaters: has joined #ruby
[20:59:53] jtdoncas: has joined #ruby
[21:09:02] warreng_: has joined #ruby
[21:09:09] jnyw: has joined #ruby
[21:10:03] pastorinni: has joined #ruby
[21:12:25] warreng_: given that Net::HTTP supports returning chunks of a response at a time via response.read_body { |chunk| ... } and given that Zlib::GzipReader.new takes an IOStream and has a each_line method, how can i combine the two so that i can process one line of a gzip'd response at a time?
[21:12:44] guille-moe: has joined #ruby
[21:13:29] warreng_: can i create an enumerator out of the response.read_body { |block| ... } somehow and pass that to Zlib::GzipReader ?
[21:15:28] DrCode: has joined #ruby
[21:20:22] rwb: has joined #ruby
[21:22:24] chocoelho: has joined #ruby
[21:23:23] Vapez: has joined #ruby
[21:31:17] cagomez: has joined #ruby
[21:31:39] nofxx1: has joined #ruby
[21:32:19] safetypin: has joined #ruby
[21:35:07] alfiemax_: has joined #ruby
[21:35:17] blindMoe: has joined #ruby
[21:35:17] blindMoe: has joined #ruby
[21:35:51] pb122: has joined #ruby
[21:38:11] tomphp: has joined #ruby
[21:39:57] bronson: has joined #ruby
[21:42:39] alfiemax: has joined #ruby
[21:45:29] brent__: has joined #ruby
[21:45:45] alex``: has joined #ruby
[21:51:32] despai: has joined #ruby
[21:52:02] Axsuul: has joined #ruby
[21:52:04] jokke: i'm having some trouble with Array#|
[21:52:56] jokke: i have an array with some objects. i've implemented hash and eql? in the class for this object
[21:53:30] jokke: if i now try to make a union of two arrays i always get duplicates
[21:53:44] jokke: even though the hashes are equal
[21:53:56] Axsuul: What is the recommended ruby documentation standard these days. RDoc?
[21:54:13] jokke: for some reason #eql? returns false
[21:54:20] jokke: axsuul: i use yard
[21:54:26] jokke: i think most do
[21:55:00] jokke: https://gist.github.com/d79d46018632ab8b931f1e8e0925dd70
[21:55:12] jokke: these are the methods
[21:55:42] Axsuul: jokke: thanks
[21:56:26] insi: has joined #ruby
[21:56:36] insi: what does subclasses << base do in ruby?
[21:56:48] Axsuul: jokke: what's a sample input to your code?
[21:57:15] c-c: insi: its probably a method
[21:57:36] c-c: insi perhaps easiest to read this https://stackoverflow.com/questions/6852072/what-does-mean-in-ruby
[21:59:32] jokke: https://gist.github.com/0ea9f402f7daa028660c8812b57eb774
[21:59:42] jokke: why the hell is it not overridden?
[21:59:50] jokke: the hash method is
[21:59:55] jokke: but not eql?
[22:00:31] c-c: insi: so perhaps you had a case where an existing class was modified?
[22:00:37] yokel: has joined #ruby
[22:01:21] insi: yeah, i think it's pulling all subclasses into the parent class
[22:01:33] insi: which would make sense in the context of the program i am workign on
[22:02:08] insi: or keeping a list of those sublcasses
[22:03:28] c-c: insi: ok should have read more carefully https://stackoverflow.com/questions/2505067/class-self-idiom-in-ruby
[22:03:31] alfiemax: has joined #ruby
[22:04:41] banisterfiend: has joined #ruby
[22:04:57] jenrzzz_: has joined #ruby
[22:05:31] Xiti: has joined #ruby
[22:05:39] mistergibson: has joined #ruby
[22:06:22] alfiemax_: has joined #ruby
[22:10:40] blackmesa1: has joined #ruby
[22:11:15] TvL2386_: has joined #ruby
[22:15:34] bmurt: has joined #ruby
[22:15:37] rrutkowski: has joined #ruby
[22:17:02] pastorinni: has joined #ruby
[22:17:21] bmurt: has joined #ruby
[22:19:38] alex``: What is the equivalent of test -t file-descriptor from sh?
[22:21:00] alex``: I use it to detect stdin (0) or if there is no terminal (stdout redirected (1))
[22:22:42] c-c: You're looking for the equivalent in base ruby?
[22:23:28] c-c: Or, you want to see if stdin?
[22:24:36] c-c: >> STDIN
[22:24:37] ruby[bot]: c-c: # => #<IO:<STDIN>> (https://eval.in/930162)
[22:26:54] pastorinni: has joined #ruby
[22:27:11] pb122-two: has joined #ruby
[22:27:24] Psybur: has joined #ruby
[22:28:05] griffindy: has joined #ruby
[22:28:06] conta: has joined #ruby
[22:29:10] c-c: alex``: also perhaps under title "Is a tty?" you will find interesting code snippet https://www.jstorimer.com/blogs/workingwithcode/7766125-writing-ruby-scripts-that-respect-pipelines
[22:30:06] tcopeland: has joined #ruby
[22:30:41] rrutkowski: has joined #ruby
[22:31:11] alfiemax: has joined #ruby
[22:31:24] despai: has joined #ruby
[22:34:50] alfiemax_: has joined #ruby
[22:35:04] mistergibson: has joined #ruby
[22:35:40] rrutkowski: has joined #ruby
[22:41:58] cdg: has joined #ruby
[22:42:37] bronson: has joined #ruby
[22:46:28] alex``: c-c: Thanks !
[22:47:02] alex``: It’s exactly what I was looking for
[22:48:18] beanish: has joined #ruby
[22:52:23] cdg: has joined #ruby
[22:53:25] alfiemax: has joined #ruby
[22:53:39] deafscribe: has joined #ruby
[22:53:43] chocoelho: has joined #ruby
[22:58:15] jenrzzz: has joined #ruby
[22:58:15] jenrzzz: has joined #ruby
[23:01:00] alfiemax: has joined #ruby
[23:03:04] eightlimbed: has joined #ruby
[23:04:17] superscott: has joined #ruby
[23:07:07] iszak: has joined #ruby
[23:07:07] iszak: has joined #ruby
[23:09:47] jeffreylevesque: has joined #ruby
[23:12:59] cremes: has joined #ruby
[23:14:07] paddy_: has joined #ruby
[23:16:59] rfoust: has joined #ruby
[23:24:36] rrutkowski: has joined #ruby
[23:26:09] elphe: has joined #ruby
[23:28:08] alfiemax: has joined #ruby
[23:30:17] jrabe: has joined #ruby
[23:40:54] neo95: has joined #ruby
[23:41:12] tcopeland: has joined #ruby
[23:44:22] nit3rid3: has joined #ruby
[23:45:05] bronson: has joined #ruby
[23:46:51] kernelPaniq: has joined #ruby
[23:49:50] elphe: has joined #ruby
[23:53:14] d^sh: has joined #ruby
[23:57:05] nicesignal: has joined #ruby
[23:58:30] sanscoeur: has joined #ruby