« Back to channel list

#ruby - 11 January 2018

« Back 1 day Forward 1 day »
[00:01:54] Troy2: has joined #ruby
[00:09:00] conceivably: has joined #ruby
[00:09:17] chocoelho: has joined #ruby
[00:10:20] tAn: has joined #ruby
[00:11:42] jenrzzz: has joined #ruby
[00:11:43] jenrzzz: has joined #ruby
[00:12:37] l_tonz: has joined #ruby
[00:12:43] bronson: has joined #ruby
[00:15:24] guacamole: has joined #ruby
[00:15:40] shinnya: has joined #ruby
[00:16:07] PaulCapestany: has joined #ruby
[00:16:39] jenrzzz: has joined #ruby
[00:17:19] johno84: has joined #ruby
[00:22:03] Azure: has joined #ruby
[00:22:39] bmurt: has joined #ruby
[00:23:58] ramfjord: has joined #ruby
[00:25:34] MaksimPinigin: has joined #ruby
[00:27:19] mtkd: has joined #ruby
[00:27:45] AxelAlex: has joined #ruby
[00:28:29] alfiemax: has joined #ruby
[00:38:12] Immune: has joined #ruby
[00:40:35] brianpWins: has joined #ruby
[00:45:08] goatish: has joined #ruby
[00:46:35] rprimus: has joined #ruby
[00:47:03] nowhereman_: has joined #ruby
[00:48:12] guacamole: has joined #ruby
[00:53:26] maum: has joined #ruby
[00:54:55] z4phod: has joined #ruby
[00:56:40] l_tonz: has joined #ruby
[00:57:33] Troy2: has joined #ruby
[00:57:46] tAn: has joined #ruby
[01:06:42] alfiemax: has joined #ruby
[01:10:03] guacamole: has joined #ruby
[01:12:31] shakes: has joined #ruby
[01:13:40] bronson: has joined #ruby
[01:14:28] guacamole: has joined #ruby
[01:18:21] guacamole: has joined #ruby
[01:23:31] Emmanuel_Chanel: has joined #ruby
[01:28:51] znz_jp: has joined #ruby
[01:29:12] guardianx: has joined #ruby
[01:29:35] LenPayne: has joined #ruby
[01:30:40] guardianxx: has joined #ruby
[01:31:52] cdg: has joined #ruby
[01:32:13] UserOO7: has joined #ruby
[01:33:13] alfiemax: has joined #ruby
[01:35:09] r3kz: has joined #ruby
[01:37:28] jeremy04: has joined #ruby
[01:38:53] konsolebox: has joined #ruby
[01:40:52] lele: has joined #ruby
[01:43:05] Mahmoud: has joined #ruby
[01:43:37] elphe: has joined #ruby
[01:44:08] tAn: has joined #ruby
[01:46:14] l_tonz: has joined #ruby
[01:55:29] Jameser: has joined #ruby
[02:00:53] UserOO7_: has joined #ruby
[02:06:16] UserOO7: has joined #ruby
[02:14:03] dviola: has joined #ruby
[02:15:05] bronson: has joined #ruby
[02:22:11] weez17_: has joined #ruby
[02:24:54] alfiemax: has joined #ruby
[02:26:53] cdg: has joined #ruby
[02:28:41] cjs226: has joined #ruby
[02:29:34] oleo: has joined #ruby
[02:30:22] gizmore|2: has joined #ruby
[02:30:25] tAn: has joined #ruby
[02:31:47] plexi: has joined #ruby
[02:36:39] mniip: has joined #ruby
[02:43:18] cdg: has joined #ruby
[02:45:39] cschneid_: has joined #ruby
[02:45:55] PaulCapestany: has joined #ruby
[02:46:10] ramfjord: has joined #ruby
[02:51:15] ramfjord: has joined #ruby
[02:51:59] l_tonz: has joined #ruby
[02:54:42] guille-moe: has joined #ruby
[02:56:56] oetjenj: has joined #ruby
[02:57:20] xco: has joined #ruby
[02:57:47] ramfjord: has joined #ruby
[03:05:53] cschneid_: has joined #ruby
[03:06:47] sleetdrop: has joined #ruby
[03:07:08] oetjenj: has joined #ruby
[03:07:54] oetjenj: has joined #ruby
[03:08:18] UserOO7: has joined #ruby
[03:09:52] cschneid_: has joined #ruby
[03:11:37] k0mpa: has joined #ruby
[03:15:41] bronson: has joined #ruby
[03:16:32] alfiemax: has joined #ruby
[03:27:36] willardg: has joined #ruby
[03:29:26] uZiel: has joined #ruby
[03:31:30] darkhanb: has joined #ruby
[03:31:52] istrasci1: has joined #ruby
[03:33:27] istrasci1: If I call Array#any? or Array#all?, are they guaranteed to evaluate the array objects in order?
[03:34:43] pastorinni: has joined #ruby
[03:35:47] ramfjord: has joined #ruby
[03:42:06] sanscoeur: has joined #ruby
[03:42:10] conceivably: has joined #ruby
[03:44:05] Radar: istrasci1: Yes I believe they do check the array in order.
[03:44:27] Radar: >> istrasci1:
[03:44:28] ruby[bot]: Radar: # => /tmp/execpad-63837f692099/source-63837f692099:2: syntax error, unexpected ':', expecting keyword_end ...check link for more (https://eval.in/933267)
[03:44:31] Radar: >> [1,2,3,4,5].all? { |e| p e; e }
[03:44:32] ruby[bot]: Radar: # => 1 ...check link for more (https://eval.in/933268)
[03:44:41] istrasci1: Radar: So we can safely short-circuit this way?
[03:44:44] raz: has joined #ruby
[03:44:54] Radar: istrasci1: yes, if you use any? it would stop at the first element which returned true.
[03:45:04] tAn: has joined #ruby
[03:45:39] naprimer2: has joined #ruby
[03:53:55] meadmoon: has joined #ruby
[03:54:01] plexi: has joined #ruby
[03:57:56] sleetdrop: has joined #ruby
[03:59:59] Troy2: has joined #ruby
[04:02:31] MaksimPinigin1: has joined #ruby
[04:02:35] govg: has joined #ruby
[04:03:21] MaksimPinigin1: has joined #ruby
[04:05:50] jenrzzz: has joined #ruby
[04:05:50] jenrzzz: has joined #ruby
[04:07:05] howdoi: has joined #ruby
[04:09:01] kriskropd: has joined #ruby
[04:13:51] Jameser: has joined #ruby
[04:16:37] bronson: has joined #ruby
[04:17:32] bhaak: has joined #ruby
[04:23:49] shinnya: has joined #ruby
[04:24:50] tAn: has joined #ruby
[04:25:25] cdg: has joined #ruby
[04:28:10] Jameser`: has joined #ruby
[04:28:34] cdg_: has joined #ruby
[04:34:21] l_tonz: has joined #ruby
[04:36:36] orbyt_: has joined #ruby
[04:36:54] ledestin: has joined #ruby
[04:38:51] guacamole: has joined #ruby
[04:40:14] l_tonz: has joined #ruby
[04:48:46] gix-: has joined #ruby
[04:49:52] DTZUZO: has joined #ruby
[04:51:00] phate408: has joined #ruby
[04:54:18] eckhardt: has joined #ruby
[04:58:16] UserOO7: has joined #ruby
[04:59:34] elphe: has joined #ruby
[04:59:50] kies: has joined #ruby
[05:05:21] bmurt: has joined #ruby
[05:06:49] alfiemax: has joined #ruby
[05:07:12] cschneid_: has joined #ruby
[05:07:42] tAn: has joined #ruby
[05:07:52] UserOO7_: has joined #ruby
[05:08:05] guacamole: has joined #ruby
[05:11:20] NightMonkey: has joined #ruby
[05:11:51] cdg: has joined #ruby
[05:14:27] LenPayne: has joined #ruby
[05:14:36] cdg_: has joined #ruby
[05:17:23] bronson: has joined #ruby
[05:17:26] istrasci1: has left #ruby: ()
[05:17:40] ur5us: has joined #ruby
[05:18:20] cdg: has joined #ruby
[05:22:12] iamarun: has joined #ruby
[05:23:00] guacamole: has joined #ruby
[05:25:39] cdg: has joined #ruby
[05:29:20] mjolnird: has joined #ruby
[05:31:42] aupadhye: has joined #ruby
[05:32:14] brent__: has joined #ruby
[05:32:35] cdg: has joined #ruby
[05:37:08] orbyt_: has joined #ruby
[05:37:44] MaksimPinigin: has joined #ruby
[05:37:47] kapil___: has joined #ruby
[05:41:23] guacamole: has joined #ruby
[05:50:20] govg: has joined #ruby
[05:54:47] alfiemax: has joined #ruby
[05:56:58] cschneid_: has joined #ruby
[06:15:01] cschneid_: has joined #ruby
[06:18:09] bronson: has joined #ruby
[06:19:10] tAn: has joined #ruby
[06:24:14] LocaMocha: has joined #ruby
[06:29:13] anisha: has joined #ruby
[06:30:31] meinside: has joined #ruby
[06:30:31] eckhardt: has joined #ruby
[06:30:59] govg: has joined #ruby
[06:34:52] goatish: has joined #ruby
[06:43:46] avelldiroll: has joined #ruby
[06:48:25] KeyJoo: has joined #ruby
[06:51:57] NightMonkey: has joined #ruby
[06:52:45] alfiemax: has joined #ruby
[07:00:40] drewmcmillan: has joined #ruby
[07:02:06] kke: has joined #ruby
[07:04:07] apeiros: has joined #ruby
[07:07:20] edwardly: has joined #ruby
[07:07:20] edwardly: has joined #ruby
[07:08:57] rabajaj: has joined #ruby
[07:10:33] yeticry: has joined #ruby
[07:14:26] ur5us: has joined #ruby
[07:15:23] tectonic: has joined #ruby
[07:16:16] drewmcmillan: has joined #ruby
[07:16:40] conta: has joined #ruby
[07:18:55] bronson: has joined #ruby
[07:21:41] dionysus69: has joined #ruby
[07:21:42] ltem: has joined #ruby
[07:22:20] alex``: has joined #ruby
[07:30:31] darkhanb: has joined #ruby
[07:30:36] drewmcmillan: has joined #ruby
[07:35:11] mkroman: has joined #ruby
[07:36:12] ramfjord: has joined #ruby
[07:37:43] nowhereman_: has joined #ruby
[07:38:55] Terens: has joined #ruby
[07:40:06] govg: has joined #ruby
[07:48:54] andikr: has joined #ruby
[07:49:08] Pgouv_: has joined #ruby
[07:50:17] JusticeFries: has joined #ruby
[07:57:30] zautomata: has joined #ruby
[07:58:51] anas: has joined #ruby
[07:59:08] apeiros: has joined #ruby
[08:00:26] burgestrand: has joined #ruby
[08:01:36] Dimik: has joined #ruby
[08:03:14] _main_: has joined #ruby
[08:03:47] phaul: has joined #ruby
[08:08:09] dminuoso: Burgestrand: Interesting, I did not expect that.
[08:08:20] aufi: has joined #ruby
[08:09:18] romain_t: has joined #ruby
[08:09:44] burgestrand: dminuoso I've always considered private/protected in Ruby more as guidelines than hard rules, turns out private constants aren't exempt from that :D
[08:14:17] dminuoso: Burgestrand: Honestly its way too easy to break basic principles that enforce good design.
[08:16:07] guardianx: has joined #ruby
[08:17:05] TomyWork: has joined #ruby
[08:17:21] burgestrand: dminuoso Well, I disagree :D restricted by default with a roundabout workaround is a nice way of going about it. It's hard to accidentally do something against the design, unless you're copy-pasting from stackoverflow in which case you're already out on a limb not even considering you're about the break some rules
[08:17:58] alex``: has joined #ruby
[08:18:38] iamarun: has joined #ruby
[08:18:43] tAn: has joined #ruby
[08:18:44] burgestrand: That said, in practice I don't really care, can't say it's made or broken my day more than possibly a few times…
[08:19:26] dminuoso: Burgestrand: If you have to resort to breaking design boundaries, then clearly the design is wrong in the first place. Any further development is likely shoehorning new features into said, already shoehorned, design.
[08:19:48] tAn: has joined #ruby
[08:19:55] burgestrand: I'm mainly doing mobile development nowadays, more often than not I've had to submit pull requests, wait a few days and then update dependencies just to get around something not being visible publicly, with the only reason it not being public was that nobody had needed it before
[08:20:09] bronson: has joined #ruby
[08:21:02] burgestrand: dminuoso Sure, but I don't think I've ever come across a perfect design because circumstance change
[08:25:04] halt: has joined #ruby
[08:25:52] claudiuinberlin: has joined #ruby
[08:27:03] jnyw: has joined #ruby
[08:30:15] mark_66: has joined #ruby
[08:30:58] zautomata: has joined #ruby
[08:32:24] ledestin: has joined #ruby
[08:37:01] juggler: has joined #ruby
[08:38:28] eckhardt: has joined #ruby
[08:41:11] yeoman: eam: thanks alot
[08:41:35] jaruga: has joined #ruby
[08:47:18] zautomata1: has joined #ruby
[08:47:22] yeoman: is it just me or does rust look like it stole alot of ruby?
[08:47:32] yeoman: combos.iter().find(|&&combo| combo == prev_bits & combo)
[08:52:45] drewmcmillan: has joined #ruby
[08:53:57] amatas: has joined #ruby
[08:56:26] dminuoso: yeoman: no, its just basic functional programming.
[09:00:17] dminuoso: yeoman: A block in ruby is just a lambda expression, its mostly the same as proc or lambda (with just some subtle and minor differences), and a lambda expression is just a first class function.
[09:00:30] dminuoso: so its no different than say lisps: (find p l)
[09:00:41] yeoman: dminuoso: but this |param| stuff
[09:00:42] yeoman: looks ruby
[09:00:46] yeoman: i know it's basicially lambda
[09:00:51] hurricanehrndz: has joined #ruby
[09:01:50] dminuoso: yeoman: Oh yeah thats probably inspired by Ruby. But I dont know how you get from there to "stealing a lot of ruby"
[09:02:01] dminuoso: Rust is so unlike Ruby in everything.
[09:04:13] dminuoso: yeoman: https://doc.rust-lang.org/reference/influences.html
[09:06:17] yeoman: lol, why is it crossed? the text
[09:07:07] dminuoso: yeoman: It refers to the `do` keyword from back in the day.
[09:08:14] dminuoso: yeoman: you used to be able to do `do f(...) |a| { ... }`
[09:08:43] dminuoso: Which was semantically basically just `f(...) do |a| ... end`
[09:08:53] dminuoso: (The former being Rust, the latter being Ruby)
[09:08:53] alfiemax: has joined #ruby
[09:09:32] dminuoso: yeoman: But that syntax is less elegant than you might think if you consider a block being just a lambda expression, and it effectively being an argument.
[09:10:25] dminuoso: because even in ruby `f(...) { ... }` is semantically: f(..., ->() { ...})
[09:11:08] dminuoso: But the reasons for removal were related to closures and procedures, it was kind of messy.
[09:11:12] dminuoso: https://github.com/rust-lang/rust/issues/10815 if you want to know more.
[09:19:16] ams__: has joined #ruby
[09:19:39] tvw: has joined #ruby
[09:20:59] Gnukpd: has joined #ruby
[09:22:08] jnollette: has joined #ruby
[09:23:16] tectonic_: has joined #ruby
[09:24:47] marr: has joined #ruby
[09:29:49] sepp2k: has joined #ruby
[09:32:02] zautomata1: has joined #ruby
[09:34:57] MaksimPinigin: has joined #ruby
[09:36:21] ramfjord: has joined #ruby
[09:38:05] cdg: has joined #ruby
[09:38:20] zautomata1: has joined #ruby
[09:39:21] cdg_: has joined #ruby
[09:44:51] iamarun: has joined #ruby
[09:47:09] Maximus580: has joined #ruby
[09:47:54] Maximus580: Anyone here?
[09:50:58] johno84: has joined #ruby
[09:52:35] Immune: has joined #ruby
[09:53:19] yeoman: 2 minutes of waiting
[09:56:03] tectonic_: has joined #ruby
[09:58:45] deadnull: has joined #ruby
[09:59:04] milardovich: has joined #ruby
[10:01:17] dhollin3: has joined #ruby
[10:10:42] Beams: has joined #ruby
[10:14:42] tectonic: has joined #ruby
[10:15:36] cdg: has joined #ruby
[10:15:50] ur5us: has joined #ruby
[10:21:37] bronson: has joined #ruby
[10:22:32] Riddell: has joined #ruby
[10:32:27] guardianx: has joined #ruby
[10:32:44] biberu: has joined #ruby
[10:37:04] nemesit|znc: has joined #ruby
[10:37:37] ldnunes: has joined #ruby
[10:49:59] iamarun: has joined #ruby
[10:55:50] biberu: has joined #ruby
[10:57:52] guardianx: has joined #ruby
[11:00:19] JusticeFries: has joined #ruby
[11:04:13] cdg: has joined #ruby
[11:05:10] elphe: has joined #ruby
[11:12:26] Terens: has joined #ruby
[11:13:19] uZiel: has joined #ruby
[11:13:31] apparition: has joined #ruby
[11:13:44] jottr: has joined #ruby
[11:13:51] Terens: I receive messages from a socket using a custom format. Each message has a topic as a destination. Which is a good pattern to offload
[11:14:18] Terens: to handle this and separate them somehow ?
[11:14:25] Troy2: has joined #ruby
[11:17:36] meadmoon: has joined #ruby
[11:19:46] zwliew: has joined #ruby
[11:22:36] bronson: has joined #ruby
[11:23:16] elphe: has joined #ruby
[11:23:47] canton7: terens, publish-subscribe or chain or responsibility?
[11:25:38] DrCode: has joined #ruby
[11:26:17] Jameser: has joined #ruby
[11:31:15] burgestrand: has joined #ruby
[11:31:50] uZiel: has joined #ruby
[11:33:53] miskatonic: has joined #ruby
[11:34:03] Riddell: has joined #ruby
[11:34:45] Jameser`: has joined #ruby
[11:35:50] walterheck: has joined #ruby
[11:36:31] ramfjord: has joined #ruby
[11:39:54] mtkd: has joined #ruby
[11:40:57] plexigras: has joined #ruby
[11:41:06] walterheck: has joined #ruby
[11:48:13] MyMind: has joined #ruby
[11:54:00] plexigras: has joined #ruby
[11:54:54] cdg: has joined #ruby
[11:55:24] mtkd: has joined #ruby
[11:56:47] Terens: canton7, what do you mean ?
[11:56:58] canton7: terens, two patterns which might be what you're after
[11:57:09] canton7: *chain of responsibility
[11:57:24] Terens: hm ok thankz
[11:57:47] canton7: (they're both on wikipedia)
[11:59:12] ElFerna: has joined #ruby
[12:01:02] elphe: has joined #ruby
[12:02:13] mrsolo: has joined #ruby
[12:03:25] cschneid_: has joined #ruby
[12:03:46] clemens3: has joined #ruby
[12:04:31] plexigras: has joined #ruby
[12:05:42] Troy2: has joined #ruby
[12:05:55] plexigras: has joined #ruby
[12:07:23] KeyJoo: has joined #ruby
[12:07:24] drewmcmillan: has joined #ruby
[12:07:30] dminuoso: This does not sound like something in need of elaborate patterns.. ¯\_(ツ)_/¯
[12:09:33] jottr: has joined #ruby
[12:16:06] canton7: publish-subscribe is just a name for a hash of "name of topic" -> object which receives messages for that topic
[12:18:48] dcluna: has joined #ruby
[12:21:00] apeiros: *objects IMO
[12:21:56] InfinityFye: has joined #ruby
[12:21:57] canton7: if the subscriber is the thing responsible for decoding the object, though, there's likely to be only one of them: you're not going to be decoding the same message twice independently
[12:22:29] apeiros: I'd expect messages in a pubsub to be uniform
[12:22:42] ElFerna: has joined #ruby
[12:22:50] apeiros: at least from the view of the subscribers
[12:23:14] Psybur: has joined #ruby
[12:23:17] bronson: has joined #ruby
[12:23:30] canton7: the original problem, as I understood it, was that he has a bunch of (say binary) messages coming in, differentiated by a string topic. He wants to decode those messages (you know how to decode a message based on its string topic), then do some message-specific processing on it
[12:25:18] _aeris_: has joined #ruby
[12:26:18] Riddell: has joined #ruby
[12:26:49] Troy2: has joined #ruby
[12:27:04] Lyubo1: has joined #ruby
[12:27:28] Psybur_: has joined #ruby
[12:27:46] llua: has joined #ruby
[12:27:55] canton7: ... so my suggestions were a bunch of decoders (one per possible topic value), that are registered with the thing that receives the messages. A received message is dispatched to the appropriate decoder for that topic. Another suggestion is chain of responsibility, where the decoders form a linked list, and a decoder either consumes a message (if it can handle it), or passes it onto the next decoder in the chain (if it cant')
[12:28:27] jinie: has joined #ruby
[12:28:31] Riddell: has joined #ruby
[12:29:25] AJA4350: has joined #ruby
[12:32:04] apeiros: if the messages indeed are structurally different, then your approach is of course sensible. I'm not sure I'd call it pubsub, though. not sure how I'd call it. it's a form of delegation.
[12:37:42] canton7: publish-register? :P
[12:38:40] apeiros: register seems a good term
[12:39:00] apeiros: anyway, minutiae :D
[12:39:50] Psybur: has joined #ruby
[12:45:28] Terens: has joined #ruby
[12:46:13] Terens: canton7, ok that could work
[12:46:15] vyorkin: has joined #ruby
[12:47:37] ElFerna: has joined #ruby
[12:51:05] Jameser: has joined #ruby
[12:56:05] xco: has joined #ruby
[13:01:11] ElFerna: has joined #ruby
[13:03:55] synthroid: has joined #ruby
[13:08:39] ShalokShalom: has joined #ruby
[13:10:51] Beams: has joined #ruby
[13:13:41] raynold: has joined #ruby
[13:13:55] govg: has joined #ruby
[13:14:51] crst: has joined #ruby
[13:16:15] dain: has joined #ruby
[13:16:20] shinnya: has joined #ruby
[13:16:29] crst: Hi, this looks really strange to me. Does it make sense? supplier_fuel_price * (invoice_order_amount || order_amount)
[13:16:59] Xeago: crst: what looks strange to you? Syntax or logic?
[13:17:08] crst: Xeago: logic
[13:17:43] Xeago: I'd deem it plausible but definitely frown-worthy without a comment.
[13:18:14] crst: lol, that's a great comment actually
[13:18:41] crst: it calcultes records ind a db table
[13:18:45] Cyb3rCl4w: has joined #ruby
[13:18:51] chocoelho: has joined #ruby
[13:18:58] crst: what if both are present? or both are null
[13:19:27] dain: has left #ruby: ()
[13:20:50] canton7: (invoice_order_amount || order_amount) is an idiom to take invoice_order_amount if invoice_order_amount is not nil (or false), otherwise take order_amount
[13:21:38] dminuoso: Xeago: That is not frown worthy at all.
[13:22:08] dminuoso: Xeago: If that is not readily readable you are not comfortable with ruby yet. That code looks concise and clear, documentation would just be pointless noise.
[13:22:26] dminuoso: It's a very common idiom.
[13:22:44] milardovich: has joined #ruby
[13:23:00] dminuoso: crst: If both are nil you are out of luck, but that's what you get for working in a singly typed language. :-)
[13:23:19] Cyb3rCl4w: has left #ruby: ()
[13:24:20] bronson: has joined #ruby
[13:25:39] Ishido: has joined #ruby
[13:25:49] crst: dminuoso: thanks for the explanation, it makes more sense to me now
[13:26:22] bluesmonk: has joined #ruby
[13:27:19] crst: canton7 ^
[13:31:33] Troy2: has joined #ruby
[13:32:44] dminuoso: crst: what you could do is `factor = invoice_order_amount || order_amount; handle_error if factor.nil?; ... supplier_fuel_price * factor`
[13:32:58] dminuoso: Kind of depends on whether you can assume order_amount to exist or not.
[13:34:01] plexigras: has joined #ruby
[13:34:46] crst: dminuoso: There's not much reliability on the new project I'm working on. It's a mess to be honest and needs a big cleaning.
[13:35:59] k0mpa: has joined #ruby
[13:36:09] jeffreylevesque: has joined #ruby
[13:36:18] crst: I have been working with laravel for last couple of months. Really happy working with rails again, though laravel is really ok
[13:37:23] aupadhye: has joined #ruby
[13:38:53] bmurt: has joined #ruby
[13:41:30] plexigras: has joined #ruby
[13:43:41] JusticeFries: has joined #ruby
[13:58:20] cdg: has joined #ruby
[13:59:17] DTZUZO: has joined #ruby
[14:01:04] mtkd: has joined #ruby
[14:08:13] dinfuehr: has joined #ruby
[14:08:58] JusticeFries: has joined #ruby
[14:09:02] cdg: has joined #ruby
[14:09:51] laekur: has joined #ruby
[14:11:31] Puffball: has joined #ruby
[14:18:26] LenPayne: has joined #ruby
[14:20:12] tlaxkit: has joined #ruby
[14:21:43] koenrh: has joined #ruby
[14:22:13] JusticeFries: has joined #ruby
[14:25:17] bronson: has joined #ruby
[14:29:50] milardovich: has joined #ruby
[14:33:30] AgentVenom: has joined #ruby
[14:36:00] plexigras: has joined #ruby
[14:36:46] milardovich: has joined #ruby
[14:37:04] ramfjord: has joined #ruby
[14:38:53] jeremy04: has joined #ruby
[14:39:05] DLSteve: has joined #ruby
[14:40:17] jottr: has joined #ruby
[14:40:46] Riddell: has joined #ruby
[14:43:47] jaruga_: has joined #ruby
[14:45:26] sleetdrop: has joined #ruby
[14:46:44] rich: has joined #ruby
[14:48:47] howdoi: has joined #ruby
[14:50:02] jobewan: has joined #ruby
[14:51:35] Press10: has joined #ruby
[14:51:57] JusticeFries: has joined #ruby
[14:53:53] Press10: Hey all. Brains not working today. How would I get an objects class name within said object instance method. self.class.name public_send(:class).name aren't giving me what I want (instance.class.name)
[14:54:43] rippa: has joined #ruby
[14:57:26] apeiros: >> class Foo; def whatsmyname; self.class.name; end; end; Foo.new.whatsmyname
[14:57:32] ruby[bot]: apeiros: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[14:57:48] Press10: I guess to_s works.
[14:57:50] apeiros: >> class Foo; def whatsmyname; self.class.name; end; end; Foo.new.whatsmyname
[14:57:51] ruby[bot]: apeiros: # => "Foo" (https://eval.in/933702)
[14:58:08] apeiros: Press10: see ^, Module#name is correct. can't tell you why it doesn't work for you
[14:58:30] oleo: has joined #ruby
[14:59:46] Press10: Ah silly mistake. I had a feeling my brain wasn't working. I placed self.class.name in initialize without a print statement and was just getting back the Foo instance, thinking thats what self.class.name was returning.
[14:59:59] Jameser: has joined #ruby
[15:00:01] rich: has left #ruby: ("WeeChat 1.6")
[15:00:03] Press10: Thanks apeiros.
[15:01:20] pastorinni: has joined #ruby
[15:07:39] jottr: has joined #ruby
[15:08:41] Paraxial: has joined #ruby
[15:08:43] Terens: I am having a weird issue
[15:11:45] apeiros__: has joined #ruby
[15:13:45] konsolebox: has joined #ruby
[15:17:33] Rapture: has joined #ruby
[15:19:36] safetypin: has joined #ruby
[15:20:08] goatish: has joined #ruby
[15:24:03] dviola: has joined #ruby
[15:26:01] Prutheus: has joined #ruby
[15:26:04] bronson: has joined #ruby
[15:26:45] Prutheus: Hello. I am writing a Rails webapp where I want to run several scripts in background (via threads). THe problem is , i need to store the threads in database so I can start and stop them manually. But Marshal cant convert threads, so how could I do that?
[15:27:07] dminuoso: prutheus: Serialize the process, not the code.
[15:27:21] Prutheus: what do you mean?
[15:27:32] dminuoso: prutheus: serialize the state of computation
[15:27:41] dminuoso: you have a thread that just increments a counter
[15:27:49] dminuoso: you would just serialize the counter, and deserialize when you resume
[15:28:12] Prutheus: No that is not possible. I have a thread which do webscraping
[15:28:23] dminuoso: prutheus: Why would that not be possible.
[15:28:24] Prutheus: I wanna launch several webscrapers via the interface
[15:28:34] Prutheus: The webscraper is a thread, not a counter
[15:29:46] dminuoso: prutheus: The webscraper has internal state no?
[15:29:46] dminuoso: maybe its a "list of websites to scrape"
[15:29:46] dminuoso: so the state would be "which item has it compeleted last"
[15:31:21] Prutheus: nono that is not possible. the webscraper already is done. very complex. I just need to run or stop him via his Class methods start or stop, which are handling a thread of him
[15:31:55] huddy: has joined #ruby
[15:32:36] jottr: has joined #ruby
[15:32:47] dminuoso: prutheus: Not following you. Uncomplexify your problem.
[15:33:09] Prutheus: Or is there any way I can perform the thread operation on a variable which is rails-servesided, so I mean my a which is SCRAPER_CLASS.new element, that is server-sided and I can access it from somewhere
[15:33:19] Prutheus: i am new to rails so I dont know where to put it to be global
[15:37:49] Prutheus: can store it globally with $ variables
[15:40:31] cjs226: has joined #ruby
[15:51:56] plexigras: has joined #ruby
[15:52:23] troys: has joined #ruby
[15:55:47] milardovich: has joined #ruby
[15:57:35] valkyr2e: has joined #ruby
[16:00:57] cschneid_: has joined #ruby
[16:03:52] Prutheus: has joined #ruby
[16:03:56] Prutheus: Hey, its me again
[16:04:09] Prutheus: one more question to rails:
[16:05:12] Prutheus: How can I create a method like the Controller defaults new method and route it, but it should take no controller argument. e.g. Recipes Controller should have a download method which route is /recipes/dowload , without a recipe id in route
[16:05:39] Prutheus: now, i always get a error at set_recipe scaffolded function with Couldn't find Recipe with 'id'=download
[16:05:41] mtkd: has joined #ruby
[16:06:06] dareenzo: has joined #ruby
[16:11:56] solocshaw: has joined #ruby
[16:17:06] synthroid: has joined #ruby
[16:17:20] synthroid: has joined #ruby
[16:17:47] jottr: has joined #ruby
[16:17:52] yokel: has joined #ruby
[16:18:21] amatas_: has joined #ruby
[16:23:58] amatas_: has joined #ruby
[16:27:03] bronson: has joined #ruby
[16:30:33] vondruch: has joined #ruby
[16:31:23] uZiel: has joined #ruby
[16:38:45] cdg: has joined #ruby
[16:41:22] FrostCandy: has joined #ruby
[16:43:38] FrostCandy: Hi all, I want to set up a hash that will sometimes not include some variables for sending an http post. So basically d={ var1 = var2 unless var2.nil? } exept this will still have the key var1, and I don't want var1 at all if var2 is nil
[16:44:54] eckhardt: has joined #ruby
[16:44:59] FrostCandy: maybe something like d = { (unless var2.nil? var1 = var2), (unless var4.nil? var3 = var 4) }
[16:46:16] jottr: has joined #ruby
[16:48:57] [Butch]: has joined #ruby
[16:49:42] Troy2: has joined #ruby
[16:55:13] FrostCandy: rather d = { (unless var2.nil? var1 => var2 ), }
[16:59:20] n0m4d1c: has joined #ruby
[17:02:32] universa1: has joined #ruby
[17:03:54] reber: has joined #ruby
[17:04:04] FrostCandy: found it, d[:v] = "there" unless x.empty?
[17:04:31] Puffball: has joined #ruby
[17:05:18] n0m4d1c_: has joined #ruby
[17:06:40] phaul: has joined #ruby
[17:11:37] n0m4d1c: has joined #ruby
[17:15:09] elphe: has joined #ruby
[17:16:39] AJA4350: has joined #ruby
[17:18:55] tcopeland: if prutheus comes back… sounds like a collection route http://guides.rubyonrails.org/routing.html#adding-collection-routes
[17:23:36] Riddell: has joined #ruby
[17:27:46] drewmcmillan: has joined #ruby
[17:27:46] bronson: has joined #ruby
[17:29:02] fmcgeough: has joined #ruby
[17:30:36] darkhanb: has joined #ruby
[17:33:40] DTZUZO: has joined #ruby
[17:34:40] alfiemax: has joined #ruby
[17:36:07] marr: has joined #ruby
[17:37:56] JusticeFries: has joined #ruby
[17:40:25] ramfjord: has joined #ruby
[17:41:52] dionysus69: has joined #ruby
[17:42:29] orbyt_: has joined #ruby
[17:43:02] uZiel: has joined #ruby
[17:49:24] guacamole: has joined #ruby
[17:49:26] Pisuke: has joined #ruby
[17:52:36] sanscoeur: has joined #ruby
[17:53:10] JusticeFries: has joined #ruby
[17:55:27] alex``: has joined #ruby
[17:55:48] guacamole: has joined #ruby
[17:56:14] apeiros: has joined #ruby
[17:58:07] Riddell: has joined #ruby
[17:59:09] d5sx43: has joined #ruby
[17:59:44] jtdoncas: has joined #ruby
[18:04:48] guacamole: has joined #ruby
[18:04:48] guacamole: has joined #ruby
[18:05:18] alfiemax: has joined #ruby
[18:05:45] aScottishBoat: has joined #ruby
[18:10:17] dan64-: has joined #ruby
[18:11:45] elphe: has joined #ruby
[18:15:35] Riddell: has joined #ruby
[18:17:21] Bish: do us internet providers prohibit incoming connections by default :o?
[18:17:57] Vapez: has joined #ruby
[18:19:02] ltem: has joined #ruby
[18:19:12] eam: generally no, but quite a few block certain ports and some put users behind NAT
[18:20:22] Bish: what a certain ports?
[18:20:32] Bish: 22 21 ? etc
[18:21:47] apeiros: has joined #ruby
[18:27:20] r0ph: has joined #ruby
[18:27:55] chouhoulis: has joined #ruby
[18:28:02] Sembei: has joined #ruby
[18:28:12] JusticeFries: has joined #ruby
[18:28:33] bronson: has joined #ruby
[18:28:43] gnarf: has joined #ruby
[18:36:01] DoubleMalt: has joined #ruby
[18:37:53] eam: Bish: I'd guess most common would be virus related ports. Filtering outbound port 25 is suuuuper common, for example
[18:37:59] eam: in terms of blocking protocols
[18:39:15] [Butch]: has joined #ruby
[18:39:30] Bish: yeah because viruses send emails
[18:39:34] Bish: im just kidding.. i know.
[18:41:59] ldnunes: has joined #ruby
[18:43:27] tomphp: has joined #ruby
[18:44:52] eam: I mean, they do
[18:45:05] eam: one of the most common uses for a botnet is spam
[18:46:30] elphe: has joined #ruby
[18:48:15] LenPayne: has joined #ruby
[18:48:33] mikkelsen: has joined #ruby
[18:48:38] DTZUZO: has joined #ruby
[18:51:12] milardovich: has joined #ruby
[18:52:44] ramfjord: has joined #ruby
[18:52:52] baweaver: GOOD MORNING
[18:53:53] r3kz: has joined #ruby
[19:02:03] orbyt_: has joined #ruby
[19:02:31] sameerynho: has joined #ruby
[19:04:12] ur5us: has joined #ruby
[19:05:01] quobo: has joined #ruby
[19:14:51] alfiemax: has joined #ruby
[19:14:56] huddy: has joined #ruby
[19:17:39] QualityAddict: has joined #ruby
[19:20:52] nicesignal: has joined #ruby
[19:22:48] TomyLobo: has joined #ruby
[19:24:31] jamesaxl: has joined #ruby
[19:27:50] safetypin: has joined #ruby
[19:27:54] Riddell: has joined #ruby
[19:29:23] bronson: has joined #ruby
[19:29:27] hfp_work: has joined #ruby
[19:29:50] shaman42: has joined #ruby
[19:38:42] miskatonic: has joined #ruby
[19:39:49] guacamole: has joined #ruby
[19:39:49] guacamole: has joined #ruby
[19:42:09] chouhoulis: has joined #ruby
[19:43:36] guacamole: has joined #ruby
[19:43:36] guacamole: has joined #ruby
[19:44:38] MyMind: has joined #ruby
[19:46:35] nadir: has joined #ruby
[19:47:34] oetjenj: has joined #ruby
[19:51:45] troulouliou_dev: has joined #ruby
[19:54:33] guille-moe: has joined #ruby
[19:57:05] knight33: has joined #ruby
[19:57:51] drewmcmillan: has joined #ruby
[19:58:26] milardovich: has joined #ruby
[20:03:01] chouhoulis: has joined #ruby
[20:05:13] guille-moe: has joined #ruby
[20:05:18] brent__: has joined #ruby
[20:05:46] KeyJoo: has joined #ruby
[20:07:35] jenrzzz: has joined #ruby
[20:07:35] jenrzzz: has joined #ruby
[20:08:28] DTZUZO: has joined #ruby
[20:10:29] ur5us: has joined #ruby
[20:11:17] mtkd: has joined #ruby
[20:12:15] ur5us: has joined #ruby
[20:13:22] darkhanb: has joined #ruby
[20:13:42] jaruga: has joined #ruby
[20:15:04] tomphp: has joined #ruby
[20:15:06] sameerynho: has joined #ruby
[20:19:35] darkhanb: has joined #ruby
[20:20:38] claudiuinberlin: has joined #ruby
[20:20:51] Gnukpd: has joined #ruby
[20:22:19] sameerynho: has joined #ruby
[20:23:15] Hanmac: has joined #ruby
[20:26:13] darkhanb: has joined #ruby
[20:28:35] zapata: has joined #ruby
[20:29:37] rrutkowski: has joined #ruby
[20:31:06] bronson: has joined #ruby
[20:31:11] darkhanb_: has joined #ruby
[20:33:36] eckhardt: has joined #ruby
[20:33:53] mistergibson: has joined #ruby
[20:36:36] alfiemax: has joined #ruby
[20:38:06] orbyt_: has joined #ruby
[20:39:19] rrutkowski: has joined #ruby
[20:41:35] milardovich: has joined #ruby
[20:48:36] DoubleMalt: has joined #ruby
[20:51:08] cats: has joined #ruby
[20:51:16] raynold: has joined #ruby
[20:52:07] desperek: has joined #ruby
[20:53:17] sammi`: has joined #ruby
[20:58:07] SeepingN: has joined #ruby
[21:02:37] jottr: has joined #ruby
[21:03:16] guacamole: has joined #ruby
[21:03:16] guacamole: has joined #ruby
[21:03:55] rrutkowski: has joined #ruby
[21:05:08] miah: has joined #ruby
[21:05:19] Gnukpd: has left #ruby: ("Leaving")
[21:07:48] jenrzzz: has joined #ruby
[21:07:48] jenrzzz: has joined #ruby
[21:08:21] Stazer: has joined #ruby
[21:08:41] Stazer: has left #ruby: ()
[21:08:46] rrutkowski: has joined #ruby
[21:08:52] Stazer: has joined #ruby
[21:09:19] guacamole: has joined #ruby
[21:09:19] guacamole: has joined #ruby
[21:10:02] cjs226: has joined #ruby
[21:12:34] phaul: has joined #ruby
[21:14:54] jrp93: has joined #ruby
[21:17:39] Stazer: has joined #ruby
[21:18:17] johno84: has joined #ruby
[21:22:18] cdg_: has joined #ruby
[21:24:54] Troy2: has joined #ruby
[21:25:54] hexian: has joined #ruby
[21:26:36] hexian: anyone here have experience with using rb_gc_register_address (aka rb_global_variable) from C exts?
[21:26:47] troulouliou_div2: has joined #ruby
[21:29:04] jtdoncas: has joined #ruby
[21:30:03] hexian: I have structs created in an extension which need to prevent GC from freeing a ruby proc which is used as a callback... I'd really like to do this efficiently without resorting to something slow like storing the objects in a hash, but using rb_gc_register_address only works on a static VALUE created from C, it does nothing on an object created by Ruby such as a block
[21:30:51] hexian: surely there should be a more efficient way to mark these ruby procs as referenced by the C extension
[21:31:48] Immune: has joined #ruby
[21:31:51] bronson: has joined #ruby
[21:31:55] pilne: has joined #ruby
[21:32:30] tAn: has joined #ruby
[21:35:58] pastorinni: has joined #ruby
[21:36:07] sammi`: has joined #ruby
[21:37:09] goatish: has joined #ruby
[21:41:47] hexian: if I understand correctly, rb_gc_register_address doesn't work on a ruby created object because the VALUE passed to the C extension is a copy of the VALUE.. so what I actually need to know is how to get a pointer to the address of the actual ruby VALUE on the heap
[21:45:58] banko: has joined #ruby
[21:53:24] minimalism: has joined #ruby
[21:53:53] miskatonic: has joined #ruby
[21:55:44] jenrzzz: has joined #ruby
[21:56:31] JusticeFries: has joined #ruby
[21:58:52] orbyt_: has joined #ruby
[22:01:07] cdg: has joined #ruby
[22:05:18] jeffreylevesque: has joined #ruby
[22:08:36] abra_ha_m: has joined #ruby
[22:09:41] weathermaker: has joined #ruby
[22:10:34] jenrzzz: has joined #ruby
[22:13:37] alfiemax: has joined #ruby
[22:15:55] mtkd: has joined #ruby
[22:16:22] fmcgeough: has joined #ruby
[22:18:03] JusticeFries: has joined #ruby
[22:18:07] npgm: has joined #ruby
[22:18:17] Derperperd: has joined #ruby
[22:18:59] Derperperd: has joined #ruby
[22:19:28] jnyw: has joined #ruby
[22:21:19] Troy2: has joined #ruby
[22:26:23] FastJack: has joined #ruby
[22:28:23] pastorin_: has joined #ruby
[22:29:02] rrutkowski: has joined #ruby
[22:32:39] bronson: has joined #ruby
[22:33:43] rrutkowski: has joined #ruby
[22:35:04] alfiemax: has joined #ruby
[22:35:44] banisterfiend: has joined #ruby
[22:36:25] orbyt_: has joined #ruby
[22:37:33] zwliew: has joined #ruby
[22:47:55] DTZUZO: has joined #ruby
[22:48:56] krawchyk: has joined #ruby
[22:51:25] quobo: has joined #ruby
[22:51:25] quobo: has joined #ruby
[22:51:27] quobo: has joined #ruby
[22:52:32] ahrs: has joined #ruby
[22:52:38] yosafbridge: has joined #ruby
[22:52:59] Scient: has joined #ruby
[22:53:16] Kilobyte22: has joined #ruby
[22:54:46] cjs226: has joined #ruby
[22:56:15] zenspider: halp. I'm refactoring some stuff in minitest and I need a name.
[22:56:17] selim: has joined #ruby
[22:56:28] Axsuul: has joined #ruby
[22:56:53] zenspider: I've separated Result from Test, both subclass Runnable, and both include a module with some code they have in common. I'm currently calling it Minitest::Thingy but...maybe that's not the best name :P
[22:57:24] desperek: has joined #ruby
[22:57:37] zenspider: The module includes concrete impls of passed?, skipped?, result_code, and location.
[22:58:18] drakko: has joined #ruby
[22:58:20] zenspider: passed? skipped? and result_code are all abstract methods on Runnable so I can't/won't push those up
[22:58:35] zenspider: location? maybe but probably not because it currently has knowledge about Result
[22:59:34] zenspider: Hexian: did you get it figured out?
[23:01:09] hexian: zenspider: yes, it wasn't clear that it's not about where the object came from but just that the pointer used for registration is static in memory
[23:03:11] zenspider: you can also hold onto the proc in one of your structs and register THAT using TypeData_Make_Struct and friends
[23:04:01] zenspider: if it's a 1-off proc then registering it as a global is fine
[23:05:15] hexian: yeah in this case I'm avoiding creating any ruby object to wrap my struct and the proc since that isn't needed, I just needed to be able to prevent GC from freeing it
[23:06:33] zenspider: you can also stow away an array into a class const or class ivar and push them all into that... any valid object reference will do
[23:06:59] postmodern: has joined #ruby
[23:10:47] hexian: that is slower, but looking at the ruby source.. rb_gc_unregister_address isn't gonna scale either
[23:12:05] zenspider: do you have actual measurements showing that it matters? otherwise, it's mentarbation.
[23:12:42] zenspider: if you're creating and registering so many procs that pushing them into an array is slowing you down, you might want to rethink things.
[23:17:06] ramfjord: has joined #ruby
[23:17:12] ricer2: has joined #ruby
[23:19:06] ricer2: has joined #ruby
[23:20:49] jeffreylevesque: has joined #ruby
[23:23:30] rrutkowski: has joined #ruby
[23:23:55] ErhardtMundt: has joined #ruby
[23:25:46] alfiemax: has joined #ruby
[23:27:04] rrutkowski: has joined #ruby
[23:28:11] jeffreylevesque_: has joined #ruby
[23:28:45] ramfjord: has joined #ruby
[23:29:48] rrutkowski_: has joined #ruby
[23:32:35] rrutkowski_: has joined #ruby
[23:33:23] bronson: has joined #ruby
[23:34:29] zachary12: has joined #ruby
[23:34:48] ramfjord: has joined #ruby
[23:35:08] JusticeFries: has joined #ruby
[23:36:09] drewmcmillan: has joined #ruby
[23:36:33] baweaver: zenspider: AbstractSingletonProxyFactoryMapperBean
[23:37:20] baweaver: Anyways, more seriously... You have a Result and a Test, both share concepts which are essentially result oriented like passed, skipped, result_code, and location?
[23:37:27] tectonic: FactoryFactory
[23:37:36] zenspider: OH FUCK YOU
[23:37:42] zenspider: BOTH OF YOU
[23:37:45] sanscoeur: has joined #ruby
[23:37:46] guacamole: has joined #ruby
[23:37:47] guacamole: has joined #ruby
[23:38:04] rrutkowski: has joined #ruby
[23:38:21] zenspider: baweaver: yeah. currently: Runnable < Result < Test but I'm breaking the last two apart
[23:39:12] baweaver: Test inherits from Result?
[23:39:34] baweaver: (well, used to)
[23:40:24] baweaver: They seem like concepts that could be called a Status. Status of the test or of the test's result
[23:40:33] baweaver: though it kinda feels like a Test has_a Result
[23:41:08] ramfjord: has joined #ruby
[23:42:33] rrutkowski: has joined #ruby
[23:44:16] zenspider: baweaver: yeah. Test#run -> Result
[23:44:47] baweaver: Admittedly haven't read the minitest source before
[23:44:48] zenspider: Originally it was Test#run -> self, but tests can do all sorts of shit that aren't serializable
[23:45:04] zenspider: so this is insulation that tries to guarantee Marshal will work
[23:45:05] zacts: has joined #ruby
[23:45:48] Troy2: has joined #ruby
[23:46:13] sammi`: has joined #ruby
[23:46:45] zenspider: baweaver: I have to step out. Throw anything at me in PM
[23:47:06] ramfjord: has joined #ruby
[23:52:21] sdrew: has joined #ruby
[23:52:26] eb0t: has joined #ruby
[23:53:05] ramfjord: has joined #ruby
[23:56:25] orbyt_: has joined #ruby
[23:57:41] eblip: has joined #ruby