« Back to channel list

#ruby - 14 April 2018

« Back 1 day Forward 1 day »
[00:00:58] duderono_: has joined #ruby
[00:01:13] cagomez: has joined #ruby
[00:01:16] jdawgaz: has joined #ruby
[00:02:48] hammer: has joined #ruby
[00:04:29] schneider: has joined #ruby
[00:04:43] workmad3: has joined #ruby
[00:05:50] shinnya: has joined #ruby
[00:06:45] n0m4d1c: has joined #ruby
[00:11:00] duderonomy: has joined #ruby
[00:12:28] hammer: has joined #ruby
[00:13:39] schneider: has joined #ruby
[00:15:23] duderono_: has joined #ruby
[00:19:46] apparition: has joined #ruby
[00:23:04] schneider: has joined #ruby
[00:23:11] beremenushka: has joined #ruby
[00:23:47] Fridtjof: i'm having a problem with TCPSocket - i'm opening one with this line:
[00:23:53] Fridtjof: server_socket = TCPSocket.open(server_host, server_port.to_i) # server_port is a string
[00:24:09] Fridtjof: and a puts statement right after it gets executed
[00:24:46] Fridtjof: but after that, I create a new object of one of my classes using that socket and it never continues after that
[00:25:16] alfiemax: has joined #ruby
[00:25:20] Fridtjof: the constructor of that class is very simple, it only takes the socket as a parameter and stores it in a class variable
[00:25:26] Fridtjof: *attribute, sorry
[00:25:42] Fridtjof: so I put a puts statement after that, and it does not get executed
[00:25:46] mr-robert: Fridtjof: share your code on gist.github.com
[00:27:00] Fridtjof: here you go:
[00:27:00] Fridtjof: https://gist.github.com/fridtjof/1f37db61211b33935507039d08523749
[00:28:39] Fridtjof: https://gist.github.com/fridtjof/c405b65d946739b58bda7d7f05583936
[00:28:48] Fridtjof: here you go, had to redact a hostname
[00:30:31] amar: has joined #ruby
[00:30:34] Fridtjof: so, the port is open and i just verified that the server running on that port works
[00:31:02] mr-robert: your script just hangs? did you try .new instead of .open?
[00:31:10] schneider: has joined #ruby
[00:31:31] Fridtjof: let me test that
[00:31:55] Fridtjof: nope, still hangs
[00:33:59] hammer: has joined #ruby
[00:34:25] mr-robert: https://gist.github.com/r-obert/dc86c062922ef10f056a364a2d648e60
[00:34:28] mr-robert: does that hangtoo?
[00:35:57] Fridtjof: interestingly enough, it doesnt
[00:36:29] Fridtjof: actually, one small detail
[00:36:39] Fridtjof: that code is simplified
[00:36:52] Fridtjof: the connection actually happens inside a Thread.fork
[00:36:59] Fridtjof: don't know if that makes a difference
[00:38:09] mr-robert: can you paste the real code you're working with
[00:38:56] drona6: has joined #ruby
[00:39:55] mr-robert: or something closer to the real code.
[00:40:15] schneider: has joined #ruby
[00:43:46] hammer: has joined #ruby
[00:45:15] kurko__: has joined #ruby
[00:46:45] mr-robert: Fridtjof: are you sure it hangs and not exits before you expect? you might be missing a Thread#join but for best results please share what you're working with. describing your problem with words and from your understanding usually doesn't get the answer you want.
[00:47:13] Fridtjof: one second then
[00:47:32] Fridtjof: hold on a minute
[00:47:36] Fridtjof: thats a valid point youre making
[00:48:07] Fridtjof: my fork happens on a new connection (im writing kind of a proxy)
[00:48:49] Fridtjof: but i only have one client to test with, so my program basically acts like a single threaded program except it doesn't
[00:48:51] mr-robert: is the main thread in a loop? otherwise it'll exit, and the threads you've spawned will die with it.
[00:49:10] Fridtjof: it is in a loop
[00:49:11] Fridtjof: thats why I did not notice it exiting
[00:49:23] schneider: has joined #ruby
[00:49:33] Fridtjof: now why *does* it exit though
[00:49:41] Fridtjof: i'll look into it some more
[00:52:04] Fridtjof: i'm an idiot
[00:52:19] Fridtjof: although threads make it hard to spot something like this
[00:52:38] Fridtjof: (if youre working with them for the first time like me)
[00:53:09] Fridtjof: i did not include the file the class i'm using was in
[00:53:12] Fridtjof: Uncaught exception: uninitialized constant ServerHandler
[00:53:47] mr-robert: ah i see. and the exception didn't bubble?
[00:54:10] Fridtjof: apparently not
[00:54:21] Fridtjof: do you know why that could be?
[00:54:41] Fridtjof: i don't know much about ruby threads yet
[00:55:23] mr-robert: you can set `Thread.abort_on_exception = true`, so that exceptions in spawned threads abort the main thread with a stacktrace.
[00:55:45] mr-robert: otherwise just implement exception handling in the thread itself
[00:56:54] mr-robert: you're welcome
[00:58:29] schneider: has joined #ruby
[01:02:06] amar: has joined #ruby
[01:02:23] hammer: has joined #ruby
[01:07:32] schneider: has joined #ruby
[01:12:29] hammer: has joined #ruby
[01:15:20] erlend: has joined #ruby
[01:16:39] schneider: has joined #ruby
[01:17:34] hammer: has joined #ruby
[01:19:46] clemens3_: has joined #ruby
[01:20:43] DTZUZO: has joined #ruby
[01:23:10] Puffball: has joined #ruby
[01:23:36] kriskropd: has joined #ruby
[01:23:41] schneider: has joined #ruby
[01:23:48] gizmore|2: has joined #ruby
[01:27:04] netherwolfe: has joined #ruby
[01:28:07] quuxman: how do I set up a test in rspec so that one method "do_stuff" on a global object is called once or the test fails? I have `allow(Foo::Bar).to receive(:do_stuff) { puts 'test' } ...test code... expect(Foo::Bar).to receive(:do_stuff)` but I get an error that .do_stuff() was received 0 times, though I'm certain it's being called because I see the side effects
[01:31:48] dviola: has joined #ruby
[01:32:00] dviola: has joined #ruby
[01:32:51] schneider: has joined #ruby
[01:34:41] n0m4d1c: has joined #ruby
[01:34:49] mr-robert: quuxman: share your code
[01:35:07] quuxman: ok I changed the expect to ... `.to have_received(` ... and it wo rks
[01:37:48] karapetyan: has joined #ruby
[01:41:58] schneider: has joined #ruby
[01:43:09] quuxman: what would an argument spec look like using `using receive(:foo).with(...)` for the first arg as string and the second two as dicts?
[01:43:32] quuxman: I mean the second two as named arguments containing dicts
[01:46:08] quuxman: I've tried `with('foo', arg1:kind_of(Hash), arg2:kind_of(Hash)` and various other things...
[01:49:28] n0m4d1c: has joined #ruby
[01:49:57] ramfjord: has joined #ruby
[01:50:33] imode: has joined #ruby
[01:50:58] schneider: has joined #ruby
[01:51:55] dinfuehr_: has joined #ruby
[01:52:13] hammer: has joined #ruby
[01:56:20] ramfjord: has joined #ruby
[01:56:45] RLNKWZM3mphiZ: has joined #ruby
[01:59:56] quuxman: oh god I misspelled foo (*hides*)
[02:00:05] schneider: has joined #ruby
[02:03:27] leitz: has joined #ruby
[02:03:34] jdawgaz: has joined #ruby
[02:04:02] workmad3: has joined #ruby
[02:07:11] tdy: has joined #ruby
[02:08:52] shoogz: has joined #ruby
[02:09:13] schneider: has joined #ruby
[02:15:43] hammer: has joined #ruby
[02:18:19] schneider: has joined #ruby
[02:25:31] orbyt_: has joined #ruby
[02:25:51] hammer: has joined #ruby
[02:27:25] schneider: has joined #ruby
[02:32:16] sanscoeur: has joined #ruby
[02:35:40] mroutis: has joined #ruby
[02:36:30] schneider: has joined #ruby
[02:40:14] hammer: has joined #ruby
[02:45:36] schneider: has joined #ruby
[02:49:04] hammer: has joined #ruby
[02:49:24] nadir: has joined #ruby
[02:53:28] harrycs: has joined #ruby
[02:54:42] schneider: has joined #ruby
[02:58:55] hammer: has joined #ruby
[03:00:13] harrycs: has joined #ruby
[03:02:15] harrycs: has joined #ruby
[03:03:46] schneider: has joined #ruby
[03:06:18] harrycs: has joined #ruby
[03:08:15] harrycs: has joined #ruby
[03:08:32] hammer: has joined #ruby
[03:12:56] schneider: has joined #ruby
[03:14:08] Dimik: has joined #ruby
[03:15:23] hammer: has joined #ruby
[03:16:14] harrycs: has joined #ruby
[03:18:15] harrycs: has joined #ruby
[03:19:17] michael_mbpL5YBW: has joined #ruby
[03:19:45] imode: has joined #ruby
[03:20:14] harrycs: has joined #ruby
[03:22:01] schneider: has joined #ruby
[03:22:14] harrycs: has joined #ruby
[03:23:33] erlend: has joined #ruby
[03:26:46] karapetyan: has joined #ruby
[03:26:58] DTZUZO: has joined #ruby
[03:29:33] hammer: has joined #ruby
[03:31:05] schneider: has joined #ruby
[03:37:41] poloych: has joined #ruby
[03:38:54] hammer: has joined #ruby
[03:40:10] schneider: has joined #ruby
[03:42:13] r3kz: has joined #ruby
[03:46:40] govg: has joined #ruby
[03:47:39] orbyt_: has joined #ruby
[03:49:19] schneider: has joined #ruby
[03:49:30] cagomez: has joined #ruby
[03:50:22] mlkkk: has joined #ruby
[03:50:28] lelliott: has joined #ruby
[03:50:42] DTZUZO: has joined #ruby
[03:53:19] hammer: has joined #ruby
[03:57:11] nicht: has joined #ruby
[03:58:24] schneider: has joined #ruby
[04:00:00] hph^: has joined #ruby
[04:01:58] segy: has joined #ruby
[04:03:15] hammer: has joined #ruby
[04:03:22] workmad3: has joined #ruby
[04:04:00] nicht: has joined #ruby
[04:05:27] nicht: has joined #ruby
[04:07:32] schneider: has joined #ruby
[04:09:43] Ryzokuken: has joined #ruby
[04:13:07] hammer: has joined #ruby
[04:16:21] mlkkk_: has joined #ruby
[04:16:36] schneider: has joined #ruby
[04:17:14] mtkd: has joined #ruby
[04:21:07] nicht: has joined #ruby
[04:25:43] schneider: has joined #ruby
[04:34:49] schneider: has joined #ruby
[04:35:02] mlkkk: has joined #ruby
[04:35:45] raynold: has joined #ruby
[04:40:25] eckhardt: has joined #ruby
[04:43:55] schneider: has joined #ruby
[04:45:52] alfiemax: has joined #ruby
[04:46:05] poloych: has joined #ruby
[04:52:51] poloych: has joined #ruby
[04:52:53] ramfjord: has joined #ruby
[04:53:01] schneider: has joined #ruby
[04:55:00] Omnilord: has joined #ruby
[04:55:13] donofrio: has joined #ruby
[05:01:18] ciscam: has joined #ruby
[05:02:11] schneider: has joined #ruby
[05:11:16] schneider: has joined #ruby
[05:14:32] karapetyan: has joined #ruby
[05:15:30] sauvin: has joined #ruby
[05:16:33] Azure|dc: has joined #ruby
[05:19:02] hammer: has joined #ruby
[05:20:22] schneider: has joined #ruby
[05:21:17] imode: has joined #ruby
[05:25:20] hammer: has joined #ruby
[05:25:27] cagomez: has joined #ruby
[05:27:45] cagomez: has joined #ruby
[05:29:27] schneider: has joined #ruby
[05:32:17] erlend: has joined #ruby
[05:33:39] hammer: has joined #ruby
[05:38:32] schneider: has joined #ruby
[05:39:04] raggi: has joined #ruby
[05:44:41] hammer: has joined #ruby
[05:47:41] schneider: has joined #ruby
[05:48:52] lelliott: has joined #ruby
[05:50:59] lelliott: has joined #ruby
[05:54:23] apparition: has joined #ruby
[05:55:24] lelliott: has joined #ruby
[05:56:56] schneider: has joined #ruby
[06:01:26] psychicist__: has joined #ruby
[06:02:38] workmad3: has joined #ruby
[06:04:46] KeyJoo: has joined #ruby
[06:05:00] reber: has joined #ruby
[06:05:36] KeyJoo: has joined #ruby
[06:06:53] alex``: has joined #ruby
[06:09:50] govg: has joined #ruby
[06:11:13] schneider: has joined #ruby
[06:11:33] hammer: has joined #ruby
[06:15:51] phaul: has joined #ruby
[06:20:19] schneider: has joined #ruby
[06:23:18] duderonomy: has joined #ruby
[06:24:24] shinnya: has joined #ruby
[06:29:28] schneider: has joined #ruby
[06:34:27] hammer: has joined #ruby
[06:38:35] schneider: has joined #ruby
[06:42:26] jamesaxl: has joined #ruby
[06:43:01] suukim: has joined #ruby
[06:44:30] hammer: has joined #ruby
[06:47:41] mtkd: has joined #ruby
[06:47:44] schneider: has joined #ruby
[06:53:02] ramfjord: has joined #ruby
[06:53:40] hammer: has joined #ruby
[06:56:44] schneider: has joined #ruby
[07:00:26] Asher: has joined #ruby
[07:04:19] ianfleeton: has joined #ruby
[07:05:51] schneider: has joined #ruby
[07:08:04] hammer: has joined #ruby
[07:10:42] zapata_: has joined #ruby
[07:13:01] darkhanb: has joined #ruby
[07:14:56] schneider: has joined #ruby
[07:16:11] mjolnird: has joined #ruby
[07:16:45] mjolnird: has joined #ruby
[07:17:54] hammer: has joined #ruby
[07:21:06] zapata_: has joined #ruby
[07:24:01] schneider: has joined #ruby
[07:26:41] hkais: has joined #ruby
[07:27:10] hammer: has joined #ruby
[07:29:16] BH23: has joined #ruby
[07:30:54] zapata: has joined #ruby
[07:33:32] schneider: has joined #ruby
[07:35:13] mikecmpbll: has joined #ruby
[07:36:28] hammer: has joined #ruby
[07:41:03] erlend: has joined #ruby
[07:42:41] schneider: has joined #ruby
[07:50:40] BH23: has joined #ruby
[07:51:47] schneider: has joined #ruby
[07:53:15] mtkd: has joined #ruby
[07:58:56] ciscam: has joined #ruby
[07:59:52] hammer: has joined #ruby
[08:00:51] schneider: has joined #ruby
[08:02:00] workmad3: has joined #ruby
[08:03:21] karapetyan: has joined #ruby
[08:08:14] n008f4g_: has joined #ruby
[08:10:06] schneider: has joined #ruby
[08:11:31] biberu: has joined #ruby
[08:13:17] hammer: has joined #ruby
[08:15:56] danguita: has joined #ruby
[08:19:04] schneider: has joined #ruby
[08:23:26] hammer: has joined #ruby
[08:24:34] sidx64: has joined #ruby
[08:28:38] schneider: has joined #ruby
[08:37:41] schneider: has joined #ruby
[08:42:38] hammer: has joined #ruby
[08:46:50] schneider: has joined #ruby
[08:47:16] Mia: has joined #ruby
[08:47:17] Mia: has joined #ruby
[08:51:02] amar: has joined #ruby
[08:53:52] hammer: has joined #ruby
[08:55:55] schneider: has joined #ruby
[09:01:52] ur5us: has joined #ruby
[09:03:40] dionysus69: has joined #ruby
[09:04:20] kapil___: has joined #ruby
[09:05:08] schneider: has joined #ruby
[09:14:11] schneider: has joined #ruby
[09:14:43] mikecmpbll: has joined #ruby
[09:17:28] ianfleeton: has joined #ruby
[09:17:33] hammer: has joined #ruby
[09:23:21] schneider: has joined #ruby
[09:24:56] nadir: has joined #ruby
[09:25:59] hammer: has joined #ruby
[09:26:21] sameerynho: has joined #ruby
[09:32:20] dionysus69: has joined #ruby
[09:32:30] schneider: has joined #ruby
[09:35:18] hammer: has joined #ruby
[09:36:54] sidx64: has joined #ruby
[09:39:48] n008f4g_: has joined #ruby
[09:41:39] schneider: has joined #ruby
[09:46:41] madgen: has joined #ruby
[09:49:17] erlend: has joined #ruby
[09:50:50] schneider: has joined #ruby
[09:51:29] ur5us: has joined #ruby
[09:54:05] hammer: has joined #ruby
[09:54:31] ur5us: has joined #ruby
[09:57:21] \void: has joined #ruby
[09:59:50] schneider: has joined #ruby
[10:01:15] workmad3: has joined #ruby
[10:03:17] ianfleeton: has joined #ruby
[10:08:33] hammer: has joined #ruby
[10:09:03] schneider: has joined #ruby
[10:13:27] hammer: has joined #ruby
[10:14:53] leitz: has joined #ruby
[10:15:14] oleo: has joined #ruby
[10:18:10] schneider: has joined #ruby
[10:20:33] alfiemax: has joined #ruby
[10:21:03] ianfleeton: has joined #ruby
[10:23:19] hammer: has joined #ruby
[10:27:15] schneider: has joined #ruby
[10:38:03] hammer: has joined #ruby
[10:38:21] schneider: has joined #ruby
[10:47:37] schneider: has joined #ruby
[10:50:01] zapata: has joined #ruby
[10:53:39] zmo: has joined #ruby
[10:56:44] schneider: has joined #ruby
[10:58:54] sidx64: has joined #ruby
[11:00:16] alfiemax: has joined #ruby
[11:01:04] hammer: has joined #ruby
[11:05:53] schneider: has joined #ruby
[11:11:31] hammer: has joined #ruby
[11:13:36] leitz: has joined #ruby
[11:15:16] alex``: has joined #ruby
[11:15:51] mtkd: has joined #ruby
[11:16:53] schneider: has joined #ruby
[11:17:51] CoolerY: has joined #ruby
[11:18:10] CoolerY: can someone help me port this ruby code to python? https://paste.pound-python.org/show/cFJLJV4c0HWiVF5H82vp/
[11:18:24] CoolerY: i don't know ruby
[11:18:46] mostlybadfly: has joined #ruby
[11:21:16] hammer: has joined #ruby
[11:21:19] apeiros: CoolerY: if you have a concrete question, I'll try to answer it
[11:22:08] CoolerY: apeiros, well i got stuck here
[11:22:09] CoolerY: return Array.new(minmax.size) do |i|
[11:22:29] CoolerY: apparently do |i| is some sort of lambda function syntax?
[11:23:03] tvw: has joined #ruby
[11:23:12] alfiemax: has joined #ruby
[11:23:53] tvw: has joined #ruby
[11:24:02] \void: has joined #ruby
[11:24:03] CoolerY: i got the gist of what the function is doing
[11:24:35] atchoum: has joined #ruby
[11:26:01] schneider: has joined #ruby
[11:26:35] hammer: has joined #ruby
[11:35:10] schneider: has joined #ruby
[11:42:58] apeiros: I probably should have said that I'm frequently afk, sorry CoolerY
[11:43:07] AJA4350: has joined #ruby
[11:43:10] apeiros: Array.nwe(minmax.size) creates a new array of length minmax.size
[11:43:28] apeiros: and yes, `do |i| … end` is like a lambda
[11:43:36] apeiros: i will go from 0 to minmax.size-1
[11:44:05] apeiros: it's invoked minmax.size time, i.e. once for every element in the new array
[11:44:13] apeiros: >> Array.new(5) { |i| i**2 }
[11:44:14] ruby[bot]: apeiros: # => [0, 1, 4, 9, 16] (https://eval.in/988155)
[11:44:19] schneider: has joined #ruby
[11:44:23] apeiros: &ri Array.new CoolerY
[11:44:23] `derpy: CoolerY: http://ruby-doc.org/core-2.4.1/Array.html#method-c-new
[11:44:55] houhoulis: has joined #ruby
[11:49:21] hammer: has joined #ruby
[11:50:38] CoolerY: apeiros, what does this line do? child[:strategy] << s_old + random_gaussian() * s_old.abs**0.5
[11:50:49] CoolerY: is it assigning to child.strategy?
[11:51:42] CoolerY: can you explain the mutate function?
[11:51:43] CoolerY: https://paste.pound-python.org/show/cFJLJV4c0HWiVF5H82vp/
[11:51:58] despai: has joined #ruby
[11:52:00] CoolerY: i understand the idea but line 30 is confusing
[11:52:23] CoolerY: does << append to the list?
[11:52:36] CoolerY: actually that makes sense
[11:53:26] schneider: has joined #ruby
[11:57:32] erlend: has joined #ruby
[11:58:00] unreal: has joined #ruby
[11:58:48] hammer: has joined #ruby
[12:00:26] jdawgaz: has joined #ruby
[12:00:38] workmad3: has joined #ruby
[12:01:07] roshanavand: has joined #ruby
[12:02:32] schneider: has joined #ruby
[12:05:56] klaas: has joined #ruby
[12:06:55] apeiros: CoolerY: << is a method and depends on the receiver (the object you call it on)
[12:07:14] apeiros: but one of the most common cases is Array#<< which is push (just limited to a single element)
[12:07:17] apeiros: &ri Array#<<
[12:07:17] `derpy: http://ruby-doc.org/core-2.4.1/Array.html#method-i-3C-3C
[12:07:28] hammer: has joined #ruby
[12:07:29] apeiros: ** is exponentiation
[12:08:07] apeiros: child is a Hash (I believe you call it dict in python)
[12:08:51] apeiros: :strategy is a symbol (a mix between a number and a string, you can mostly treat it like a string, just that it's of a different class)
[12:11:39] jeffreylevesque: has joined #ruby
[12:11:43] schneider: has joined #ruby
[12:12:50] dr3wo: has joined #ruby
[12:13:32] phaul: it's also not the cleanest ruby code which make it a bit more difficult to understand
[12:14:09] phaul: they are overusing hashes...
[12:16:33] phaul: I wouldn't go for a "straight" rewrite, once the algorithm is understood, I think you should ditch this code :)
[12:17:59] apeiros: phaul: they're porting it to python
[12:19:51] alfiemax: has joined #ruby
[12:20:24] Psybur: has joined #ruby
[12:21:08] schneider: has joined #ruby
[12:21:19] sidx64_: has joined #ruby
[12:26:22] roshanavand: has joined #ruby
[12:26:22] hammer: has joined #ruby
[12:27:25] ur5us: has joined #ruby
[12:28:13] John_Ivan: has joined #ruby
[12:28:14] John_Ivan: has joined #ruby
[12:30:12] schneider: has joined #ruby
[12:36:39] hammer: has joined #ruby
[12:39:20] schneider: has joined #ruby
[12:39:35] warbaque: has left #ruby: ()
[12:48:27] schneider: has joined #ruby
[12:49:22] suukim: has joined #ruby
[12:51:15] hammer: has joined #ruby
[12:59:30] schneider: has joined #ruby
[13:00:14] unreal_: has joined #ruby
[13:00:22] Asher: has joined #ruby
[13:01:20] hammer: has joined #ruby
[13:08:38] schneider: has joined #ruby
[13:15:23] hammer: has joined #ruby
[13:17:48] schneider: has joined #ruby
[13:20:04] burgestrand: has joined #ruby
[13:20:33] dr3wo: has joined #ruby
[13:22:11] dionysus69: has joined #ruby
[13:23:21] psychicist__: has joined #ruby
[13:24:21] hammer: has joined #ruby
[13:26:55] schneider: has joined #ruby
[13:27:11] karapetyan: has joined #ruby
[13:27:50] duderonomy: has joined #ruby
[13:32:26] hammer: has joined #ruby
[13:32:47] alfiemax: has joined #ruby
[13:33:08] sameerynho: has joined #ruby
[13:34:15] alfiemax_: has joined #ruby
[13:34:38] dr3wo: has joined #ruby
[13:35:53] dionysus69: has joined #ruby
[13:36:00] schneider: has joined #ruby
[13:39:42] alfiemax: has joined #ruby
[13:41:46] hammer: has joined #ruby
[13:44:29] schneider: has joined #ruby
[13:44:31] alfiemax_: has joined #ruby
[13:44:50] Asher: has joined #ruby
[13:45:43] amar: has joined #ruby
[13:47:11] konsolebox_: has joined #ruby
[13:50:20] kurko_: has joined #ruby
[13:50:48] herbmillerjr: has joined #ruby
[13:53:36] schneider: has joined #ruby
[13:56:33] hammer: has joined #ruby
[13:59:32] govg: has joined #ruby
[13:59:56] workmad3: has joined #ruby
[14:00:19] Asher: has joined #ruby
[14:00:41] amar: has joined #ruby
[14:01:39] basic: has joined #ruby
[14:01:59] tomphp: has joined #ruby
[14:02:03] basic: how can i do: x=3;eval "puts x"
[14:02:21] basic: OH THAT ALREADY WORKS
[14:06:02] kurko_: has joined #ruby
[14:06:16] erlend: has joined #ruby
[14:08:38] alfiemax: has joined #ruby
[14:08:45] basic: but what if i want to have that local inside a block, i give to a class method of a class
[14:09:09] basic: to avoid xy: i try to have something like rakefiles that only contain stuff like "config { |x| x.a = 3 }"
[14:09:28] basic: and my approach to use them is to class_eval the content of the file
[14:09:31] schneider: has joined #ruby
[14:09:44] basic: which works fine, until i try to put data from outside into it
[14:10:41] basic: if i was about to: "Object.class_eval { y = 3; eval "config { |x| x.a = y}" }
[14:10:48] basic: it doesn't work anymore, can anyone help with that?
[14:11:10] oleo: has joined #ruby
[14:11:56] basic: and is class_eval { eval "" } the same as class_eval("")
[14:16:49] hammer: has joined #ruby
[14:17:02] ard3553: has joined #ruby
[14:17:47] chihhsin: has joined #ruby
[14:18:44] schneider: has joined #ruby
[14:20:19] ard3553: If I want to dispatch a method by string using `send`, that may have 0 or 1 arguments, is there a clean way to do that without defining all of these methods with a potentially unused argument (defaulting to nil, for example)?
[14:20:42] dr3wo: has joined #ruby
[14:22:49] apeiros: ard3553: you should use public_send, not send
[14:23:14] ard3553: Does that solve the problem?
[14:23:20] apeiros: and I'm not sure what you're asking
[14:23:30] apeiros: no, public_send just avoids that you accidentally invoke private methods
[14:23:49] apeiros: re your question - are you asking how to define a method or how to invoke a method?
[14:27:12] chihhsin: has joined #ruby
[14:27:52] schneider: has joined #ruby
[14:28:14] ur5us: has joined #ruby
[14:31:13] ianfleeton: has joined #ruby
[14:31:19] chouhoulis: has joined #ruby
[14:32:26] coderphive: has joined #ruby
[14:35:35] macduck: has joined #ruby
[14:37:00] schneider: has joined #ruby
[14:38:31] Ryzokuken: has joined #ruby
[14:41:18] chouhoulis: has joined #ruby
[14:43:49] chihhsin: has joined #ruby
[14:44:37] inerthia: has joined #ruby
[14:45:38] hammer: has joined #ruby
[14:45:57] havenwood: seems they left
[14:46:24] havenwood: I guess ard was asking how to check method arity?
[14:46:28] tomphp: has joined #ruby
[14:47:00] mtkd: has joined #ruby
[14:48:00] schneider: has joined #ruby
[14:51:01] konsolebox_: basic: how does it not work?
[14:56:29] beremenushka: has joined #ruby
[14:57:11] schneider: has joined #ruby
[15:01:05] Mike11: has joined #ruby
[15:05:00] karapetyan: has joined #ruby
[15:06:16] schneider: has joined #ruby
[15:07:45] apparition: has joined #ruby
[15:11:38] karapetyan: has joined #ruby
[15:14:51] Azure: has joined #ruby
[15:15:14] herbmillerjr: has joined #ruby
[15:15:26] schneider: has joined #ruby
[15:17:45] basic: konsolebox_: well, try it exactly how i descirbed it, the class method does not see the local variables outside of it
[15:18:01] basic: guessing.. that's how it ise.. i ended up adding the data into the constructor
[15:18:21] basic: guess my design was just wrong
[15:18:45] basic: can i call a method with predefined locals? because thats kinda what i want(ed)
[15:20:45] nadir: has joined #ruby
[15:21:00] orbyt_: has joined #ruby
[15:22:01] alfiemax: has joined #ruby
[15:22:43] dr3wo: has joined #ruby
[15:23:49] marr: has joined #ruby
[15:24:36] schneider: has joined #ruby
[15:29:27] Asher: has joined #ruby
[15:32:16] tomphp: has joined #ruby
[15:33:43] schneider: has joined #ruby
[15:35:19] chihhsin: has joined #ruby
[15:38:53] konsolebox_: basic: this prints 1: https://bpaste.net/show/279a6283d5fc
[15:42:48] schneider: has joined #ruby
[15:47:30] darkhanb: has joined #ruby
[15:51:56] schneider: has joined #ruby
[15:56:24] govg: has joined #ruby
[15:59:11] workmad3: has joined #ruby
[16:00:39] c0ncealed1: has joined #ruby
[16:01:04] schneider: has joined #ruby
[16:07:54] DeathRay1977: has joined #ruby
[16:11:11] noobineer: has joined #ruby
[16:11:42] jdawgaz: has joined #ruby
[16:15:02] erlend: has joined #ruby
[16:16:40] poloych: has joined #ruby
[16:19:43] kurko_: has joined #ruby
[16:21:29] alex``: has joined #ruby
[16:24:18] mroutis: has joined #ruby
[16:26:31] AndBobsYourUncle: has joined #ruby
[16:28:52] ur5us: has joined #ruby
[16:37:08] workmad3: has joined #ruby
[16:37:59] BTRE: has joined #ruby
[16:42:07] sidx64: has joined #ruby
[16:46:50] Mike111: has joined #ruby
[16:49:36] icarus: has joined #ruby
[16:51:05] mtkd: has joined #ruby
[16:54:52] unreal: has joined #ruby
[16:56:08] cagomez: has joined #ruby
[16:56:11] jdawgaz: has joined #ruby
[16:57:57] imode: has joined #ruby
[17:02:57] Mike11: has joined #ruby
[17:06:01] nicosmaris: has joined #ruby
[17:06:36] Strepsils: has joined #ruby
[17:14:05] tomphp: has joined #ruby
[17:14:58] tomphp: has joined #ruby
[17:22:58] sidx64: has joined #ruby
[17:25:14] alfiemax: has joined #ruby
[17:36:55] KeyJoo: has joined #ruby
[17:37:19] bmurt: has joined #ruby
[17:38:22] KeyJoo: has joined #ruby
[17:39:30] houhoulis: has joined #ruby
[17:40:19] banisterfiend: has joined #ruby
[17:41:03] banisterfiend: does anyone know an official freenode chan for vscode?
[17:41:08] gokhan1: has joined #ruby
[17:47:09] Yzguy: has joined #ruby
[17:48:26] woodruffw: has joined #ruby
[17:48:27] woodruffw: has joined #ruby
[17:49:57] oleo: has joined #ruby
[17:57:26] jdawgaz: has joined #ruby
[17:58:39] jdawgaz: has joined #ruby
[18:05:06] zautomata: has joined #ruby
[18:06:27] basic: has joined #ruby
[18:07:10] despai: has joined #ruby
[18:08:58] \void: has joined #ruby
[18:09:36] alfiemax: has joined #ruby
[18:17:51] Mike11: has joined #ruby
[18:17:54] mgraf: has joined #ruby
[18:18:42] venmx: has joined #ruby
[18:23:48] erlend: has joined #ruby
[18:27:35] ur5us: has joined #ruby
[18:29:27] ged_: has joined #ruby
[18:29:58] mahlon_: has joined #ruby
[18:30:03] DenSchub: has joined #ruby
[18:33:41] banisterfiend: has joined #ruby
[18:33:59] cagomez_: has joined #ruby
[18:36:31] karapetyan: has joined #ruby
[18:36:35] alfiemax: has joined #ruby
[18:37:48] jdawgaz: has joined #ruby
[18:41:15] mgraf: has joined #ruby
[18:50:29] schneider: has joined #ruby
[18:55:40] imode: has joined #ruby
[18:59:17] mgraf: has joined #ruby
[18:59:37] schneider: has joined #ruby
[19:00:50] banisterfiend: has joined #ruby
[19:04:45] alfiemax: has joined #ruby
[19:06:46] cagomez: has joined #ruby
[19:07:08] despai: has joined #ruby
[19:07:30] ciscam: has joined #ruby
[19:08:49] schneider: has joined #ruby
[19:16:36] cagomez: has joined #ruby
[19:16:36] mtkd: has joined #ruby
[19:17:56] schneider: has joined #ruby
[19:21:19] lelliott: has joined #ruby
[19:27:01] schneider: has joined #ruby
[19:30:18] kaawaa: has joined #ruby
[19:31:52] dstrunk: has joined #ruby
[19:35:19] Toasttifyy2: has joined #ruby
[19:36:12] schneider: has joined #ruby
[19:36:43] anisha: has joined #ruby
[19:39:44] yxhuvud: has joined #ruby
[19:41:47] kaawaa: has joined #ruby
[19:43:06] ciscam: has joined #ruby
[19:45:14] lelliott: has joined #ruby
[19:45:18] schneider: has joined #ruby
[19:48:41] crankharder: has joined #ruby
[19:49:30] tAn: has joined #ruby
[19:50:38] despai: has joined #ruby
[19:53:59] GeekOnCoffee: has joined #ruby
[19:54:26] schneider: has joined #ruby
[20:03:33] schneider: has joined #ruby
[20:05:22] basic: has joined #ruby
[20:10:08] nowhereman_: has joined #ruby
[20:12:43] schneider: has joined #ruby
[20:14:46] nowhereman_: has joined #ruby
[20:16:52] Cleverson: has joined #ruby
[20:18:07] ur5us: has joined #ruby
[20:20:45] sidx64_: has joined #ruby
[20:21:50] schneider: has joined #ruby
[20:25:35] amar: has joined #ruby
[20:25:41] bonhoeffer: has joined #ruby
[20:26:12] nowhereman_: has joined #ruby
[20:30:34] char_var[buffer]: has joined #ruby
[20:31:00] schneider: has joined #ruby
[20:31:50] nowhere_man: has joined #ruby
[20:32:27] erlend: has joined #ruby
[20:35:27] alfiemax: has joined #ruby
[20:36:20] cagomez: has joined #ruby
[20:40:06] schneider: has joined #ruby
[20:45:48] armyriad: has joined #ruby
[20:49:15] schneider: has joined #ruby
[20:52:58] ltem: has joined #ruby
[20:53:15] karapetyan: has joined #ruby
[20:53:29] zzxc: has joined #ruby
[20:58:22] schneider: has joined #ruby
[21:01:37] tAn: has joined #ruby
[21:02:40] ellcs: has joined #ruby
[21:07:32] schneider: has joined #ruby
[21:09:31] venmx: has joined #ruby
[21:13:29] amar: has joined #ruby
[21:16:29] amar: has joined #ruby
[21:16:37] schneider: has joined #ruby
[21:20:52] nicesignal: has joined #ruby
[21:24:03] zautomata: has joined #ruby
[21:25:53] schneider: has joined #ruby
[21:32:35] dviola: has joined #ruby
[21:34:57] kent\n: has joined #ruby
[21:36:48] schneider: has joined #ruby
[21:38:17] VladGh: has joined #ruby
[21:38:21] Dimik: has joined #ruby
[21:39:25] jamesaxl: has joined #ruby
[21:40:23] Puffball: has joined #ruby
[21:45:59] schneider: has joined #ruby
[21:49:00] noobineer: has joined #ruby
[21:49:04] m27frogy: has joined #ruby
[21:51:14] sameerynho: has joined #ruby
[21:53:35] orbyt_: has joined #ruby
[21:55:05] schneider: has joined #ruby
[21:57:56] alfiemax: has joined #ruby
[22:00:59] Antiarc: has joined #ruby
[22:03:37] Antiarc: has joined #ruby
[22:04:12] schneider: has joined #ruby
[22:05:04] coderphive: has joined #ruby
[22:07:44] tAn: has joined #ruby
[22:13:22] schneider: has joined #ruby
[22:15:53] bmurt: has joined #ruby
[22:18:46] pskosinski: has joined #ruby
[22:22:31] schneider: has joined #ruby
[22:23:22] jdawgaz: has joined #ruby
[22:29:59] burgestrand: has joined #ruby
[22:31:35] schneider: has joined #ruby
[22:32:16] karapetyan: has joined #ruby
[22:37:20] amar: has joined #ruby
[22:40:54] schneider: has joined #ruby
[22:41:11] erlend: has joined #ruby
[22:47:06] bmurt: has joined #ruby
[22:47:42] Yzguy: has joined #ruby
[22:49:58] schneider: has joined #ruby
[22:52:24] stairmast0r: has joined #ruby
[22:52:58] tAn: has joined #ruby
[22:53:03] DenSchub_: has joined #ruby
[22:59:23] schneider: has joined #ruby
[23:05:37] darkhanb: has joined #ruby
[23:06:13] mgraf: has joined #ruby
[23:08:14] schneider: has joined #ruby
[23:08:20] darkhanb: has joined #ruby
[23:09:29] AJA4350: has joined #ruby
[23:10:20] amar: has joined #ruby
[23:17:04] imode: has joined #ruby
[23:17:23] schneider: has joined #ruby
[23:25:23] yuuji: has joined #ruby
[23:25:45] kies: has joined #ruby
[23:26:48] schneider: has joined #ruby
[23:27:24] mroutis: has joined #ruby
[23:27:36] amar: has joined #ruby
[23:34:21] tAn: has joined #ruby
[23:35:55] schneider: has joined #ruby
[23:36:34] raynold: has joined #ruby
[23:39:10] Puffball: has joined #ruby
[23:42:43] |ifei5g00d: has joined #ruby
[23:44:36] schneider: has joined #ruby
[23:53:47] schneider: has joined #ruby
[23:54:23] DTZUZO: has joined #ruby
[23:55:57] burgestrand: has joined #ruby