« Back to channel list

#ruby - 12 March 2018

« Back 1 day Forward 1 day »
[00:01:34] n0m4d1c: has joined #ruby
[00:01:45] houhoulis: has joined #ruby
[00:04:50] kapil___: has joined #ruby
[00:07:36] RougeR: has joined #ruby
[00:18:13] hahuang61: has joined #ruby
[00:18:50] beremenushka2: has joined #ruby
[00:28:09] hahuang61: has joined #ruby
[00:29:55] Strepsils: has joined #ruby
[00:32:47] alfiemax: has joined #ruby
[00:32:50] Azure: has joined #ruby
[00:36:10] cschneid: has joined #ruby
[00:41:45] workmad3: has joined #ruby
[00:49:50] alfiemax: has joined #ruby
[00:49:50] fyrril2: has joined #ruby
[00:58:10] lroca: has joined #ruby
[01:02:39] alfiemax: has joined #ruby
[01:04:35] yxhuvud: has joined #ruby
[01:05:42] bmurt: has joined #ruby
[01:06:00] gr33n7007h: has joined #ruby
[01:06:26] mynameisdebian: has joined #ruby
[01:06:58] hahuang61: has joined #ruby
[01:08:25] gr33n7007h: has joined #ruby
[01:10:07] gs: has joined #ruby
[01:11:42] gz0: has joined #ruby
[01:14:28] RougeR: has joined #ruby
[01:19:51] alfiemax: has joined #ruby
[01:32:08] Azure: has joined #ruby
[01:38:07] SynSynack: has joined #ruby
[01:48:33] Yzguy: has joined #ruby
[01:50:57] cdg: has joined #ruby
[01:53:40] alfiemax: has joined #ruby
[01:55:37] n0m4d1c: has joined #ruby
[02:05:09] milardovich: has joined #ruby
[02:10:35] alfiemax: has joined #ruby
[02:16:36] houhoulis: has joined #ruby
[02:16:52] rgiscard: has joined #ruby
[02:23:42] alfiemax: has joined #ruby
[02:32:32] alfiemax: has joined #ruby
[02:33:32] bmurt: has joined #ruby
[02:33:48] drewmcmillan: has joined #ruby
[02:38:56] Yzguy: has joined #ruby
[02:40:46] ixti: has joined #ruby
[02:49:05] gizmore|2: has joined #ruby
[02:50:41] dviola: has joined #ruby
[02:57:51] nadir: has joined #ruby
[03:03:14] dinfuehr: has joined #ruby
[03:04:16] nowhere_man: has joined #ruby
[03:18:16] kapil___: has joined #ruby
[03:18:26] arescorpio: has joined #ruby
[03:40:24] n0m4d1c: has joined #ruby
[03:48:50] davidsiegel: has joined #ruby
[03:49:31] govg: has joined #ruby
[03:50:53] davidsiegel: Hi there! I made a tool to generate typechecked Ruby models from JSON/schema using the dry-types gem and I'm looking for feedback: https://app.quicktype.io/?l=ruby
[03:51:24] davidsiegel: I'm a little dismayed at the amount of code I had to generate to accomplish this and am looking for any ways to make it a bit more idiomatic.
[03:52:56] xuanrui: has joined #ruby
[03:53:37] cschneid: has joined #ruby
[03:56:15] knight33_: has joined #ruby
[04:03:32] alfiemax: has joined #ruby
[04:22:12] armyriad: has joined #ruby
[04:25:15] trautwein: has joined #ruby
[04:30:55] davidsiegel: has joined #ruby
[04:42:04] workmad3: has joined #ruby
[04:42:31] hahuang61: has joined #ruby
[04:46:55] nicesignal: has joined #ruby
[04:47:43] armyriad: has joined #ruby
[04:51:47] Asher: has joined #ruby
[04:52:16] alfiemax_: has joined #ruby
[04:57:40] rubemlrm: has joined #ruby
[04:58:14] gix: has joined #ruby
[04:59:47] hahuang61: has joined #ruby
[05:05:28] jamesaxl: has joined #ruby
[05:12:07] howdoi: has joined #ruby
[05:12:54] fyrril: has joined #ruby
[05:13:56] hahuang61: has joined #ruby
[05:19:30] hahuang65: has joined #ruby
[05:26:21] hahuang61: has joined #ruby
[05:27:58] soniya29: has joined #ruby
[05:33:57] sidx64: has joined #ruby
[05:35:01] mangoicedtea: has joined #ruby
[05:37:46] xco: has joined #ruby
[05:38:07] sidx64: has joined #ruby
[05:40:21] romain_t: has joined #ruby
[05:51:31] hahuang61: has joined #ruby
[05:55:47] jnollette: has joined #ruby
[05:58:35] Dimik: has joined #ruby
[06:04:52] anisha: has joined #ruby
[06:05:45] hahuang65: has joined #ruby
[06:06:30] xco: has joined #ruby
[06:07:09] karapetyan: has joined #ruby
[06:11:55] aufi: has joined #ruby
[06:15:51] anisha_: has joined #ruby
[06:17:03] hahuang61: has joined #ruby
[06:20:14] karapetyan: has joined #ruby
[06:22:03] alex``: has joined #ruby
[06:22:40] hahuang65: has joined #ruby
[06:23:14] karapetyan: has joined #ruby
[06:23:15] dionysus69: has joined #ruby
[06:26:09] hogetaro_: has joined #ruby
[06:26:50] Flabbergazta_: has joined #ruby
[06:27:18] Some-body_: has joined #ruby
[06:28:22] mahlon_: has joined #ruby
[06:29:01] aufi: has joined #ruby
[06:29:26] jhill__: has joined #ruby
[06:29:29] xco: has left #ruby: ()
[06:29:40] ammar_: has joined #ruby
[06:29:47] SuperL4g: has joined #ruby
[06:30:19] yokel_: has joined #ruby
[06:30:43] untitaker_: has joined #ruby
[06:31:39] nyuszika7h_: has joined #ruby
[06:32:14] th1nkpad: has joined #ruby
[06:32:24] sspreitzer: has joined #ruby
[06:32:24] sspreitzer: has joined #ruby
[06:33:25] pmodin: has joined #ruby
[06:33:57] Hobbyboy|BNC: has joined #ruby
[06:34:42] hahuang65: has joined #ruby
[06:34:58] Elysia: has joined #ruby
[06:35:20] headius: has joined #ruby
[06:35:30] daemonwrangler: has joined #ruby
[06:35:44] heyimwill: has joined #ruby
[06:35:50] r3dc0d3r: has joined #ruby
[06:35:50] r3dc0d3r: has joined #ruby
[06:36:08] lomex: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[06:36:18] Fridtjof: has joined #ruby
[06:37:29] Tharbakim: has joined #ruby
[06:37:29] Tharbakim: has joined #ruby
[06:39:33] dinfuehr: has joined #ruby
[06:40:01] iNs: has joined #ruby
[06:40:03] halbbalda: has joined #ruby
[06:40:19] dizzy1or5[m]: has joined #ruby
[06:40:43] KevinMGranger: has joined #ruby
[06:41:13] ndrst: has joined #ruby
[06:41:41] Takumo: has joined #ruby
[06:41:48] surminus: has joined #ruby
[06:41:52] tatpap[m]: has joined #ruby
[06:42:08] kireevco: has joined #ruby
[06:42:25] jetpack_joe: has joined #ruby
[06:42:32] workmad3: has joined #ruby
[06:42:34] roshanavand: has joined #ruby
[06:42:35] lunarkitty7: has joined #ruby
[06:42:49] jimeh: has joined #ruby
[06:42:56] sparr: has joined #ruby
[06:43:47] bcavileer: has joined #ruby
[06:43:48] arcturiaen: has joined #ruby
[06:44:10] BuildTheRobots: has joined #ruby
[06:46:55] hahuang61: has joined #ruby
[06:47:18] mangoicedtea: has left #ruby: ("Leaving")
[06:49:24] jenrzzz: has joined #ruby
[06:49:24] jenrzzz: has joined #ruby
[06:52:52] sidx64: has joined #ruby
[07:13:05] sidx64_: has joined #ruby
[07:14:38] roshanavand: has joined #ruby
[07:16:36] sidx64: has joined #ruby
[07:21:22] alfiemax: has joined #ruby
[07:22:39] gr33n7007h: has joined #ruby
[07:25:23] conta: has joined #ruby
[07:29:56] guardianx: has joined #ruby
[07:35:14] _joes_: has joined #ruby
[07:38:25] dionysus69: has joined #ruby
[07:40:41] gr33n7007h: has joined #ruby
[07:45:12] andikr: has joined #ruby
[07:50:10] hahuang61: has joined #ruby
[07:50:23] dionysus70: has joined #ruby
[07:52:51] rubemlrm: has joined #ruby
[07:56:06] jenrzzz: has joined #ruby
[08:04:00] kliq: has joined #ruby
[08:13:11] schneider: has joined #ruby
[08:16:49] alfiemax_: has joined #ruby
[08:17:23] bigblind: has joined #ruby
[08:18:14] yohji: has joined #ruby
[08:19:19] willmichael: has joined #ruby
[08:24:36] clemens3: has joined #ruby
[08:27:08] jenrzzz: has joined #ruby
[08:27:08] jenrzzz: has joined #ruby
[08:29:17] Puffball: has joined #ruby
[08:32:55] claudiuinberlin: has joined #ruby
[08:33:24] burgestrand: has joined #ruby
[08:39:58] oetjenj: has joined #ruby
[08:42:44] aupadhye: has joined #ruby
[08:42:56] rahul_bajaj: has joined #ruby
[08:43:34] c0ncealed: has joined #ruby
[08:45:32] willmichael: has joined #ruby
[08:45:33] marr: has joined #ruby
[08:48:43] hahuang61: has joined #ruby
[08:50:14] cschneid: has joined #ruby
[08:54:28] phaul: has joined #ruby
[08:57:21] sidx64: has joined #ruby
[08:57:26] schneider: has joined #ruby
[08:58:48] wojnar: has joined #ruby
[08:59:28] mikecmpbll: has joined #ruby
[09:01:18] rabajaj: has joined #ruby
[09:01:20] riotjones: has joined #ruby
[09:05:36] ltt: has joined #ruby
[09:08:38] bigblind: has joined #ruby
[09:10:31] willmichael: has joined #ruby
[09:12:49] ltt: has joined #ruby
[09:13:57] mikecmpbll: has joined #ruby
[09:14:03] tAn: has joined #ruby
[09:14:17] burgestrand: has joined #ruby
[09:16:00] _aeris_: has joined #ruby
[09:16:44] yohji: has joined #ruby
[09:18:10] guille-moe: has joined #ruby
[09:18:43] gr33n7007h: has joined #ruby
[09:18:59] KeyJoo: has joined #ruby
[09:23:01] konos5_: has joined #ruby
[09:23:45] willmichael: has joined #ruby
[09:25:36] alfiemax: has joined #ruby
[09:27:49] cdg: has joined #ruby
[09:31:19] rahul_bajaj: has joined #ruby
[09:34:44] ltt: has joined #ruby
[09:36:57] PaulePanter: has joined #ruby
[09:38:04] leitz: has joined #ruby
[09:38:38] cdg: has joined #ruby
[09:40:35] leitz: In line 5, is the "superclass.hierarchy" recursing back up the class hierarchy until it gets to "BasicObject, then creating the array, and adding each Class as it comes out of the recursion?
[09:40:39] leitz: https://gist.github.com/LeamHall/0a187cb4b1c6e1c909b220e7dcc6e84c
[09:41:39] leitz: The question is more "Do I understand this correctly?"
[09:48:13] cdg: has joined #ruby
[09:50:05] hahuang61: has joined #ruby
[09:50:40] rabajaj: has joined #ruby
[09:53:57] ltt: has joined #ruby
[10:03:05] Beams: has joined #ruby
[10:11:58] Papierkorb: has joined #ruby
[10:12:04] Papierkorb: has left #ruby: ("Konversation terminated!")
[10:13:09] marens: has joined #ruby
[10:13:09] marens: has joined #ruby
[10:16:58] Strepsils: has joined #ruby
[10:21:21] ltt: has joined #ruby
[10:26:08] schneider-: has joined #ruby
[10:28:00] Sylario: has joined #ruby
[10:29:38] ShekharReddy: has joined #ruby
[10:30:49] workmad3: has joined #ruby
[10:31:46] amatas: has joined #ruby
[10:32:33] drewmcmillan: has joined #ruby
[10:32:36] claudiuinberlin: has joined #ruby
[10:38:30] amatas: has joined #ruby
[10:39:37] milardovich: has joined #ruby
[10:42:13] tomphp: has joined #ruby
[10:42:59] milardovich: has joined #ruby
[10:43:15] ndrst: has joined #ruby
[10:44:55] vrih: has joined #ruby
[10:46:23] amatas: has joined #ruby
[10:46:39] hahuang61: has joined #ruby
[10:51:30] fribmendes: has joined #ruby
[10:52:48] TomyWork: has joined #ruby
[10:57:44] RougeR: has joined #ruby
[10:57:44] RougeR: has joined #ruby
[11:04:01] AJA4350: has joined #ruby
[11:05:06] tAn: has joined #ruby
[11:09:38] qba73: has joined #ruby
[11:13:22] tAn: has joined #ruby
[11:21:01] burgestrand: has joined #ruby
[11:21:40] goatish: has joined #ruby
[11:23:51] cdg: has joined #ruby
[11:25:56] ltt: has joined #ruby
[11:30:55] Cavallari: has joined #ruby
[11:32:48] cdg: has joined #ruby
[11:39:25] ldnunes: has joined #ruby
[11:41:04] Cavallari1: has joined #ruby
[11:45:31] atta: has joined #ruby
[11:46:30] shinnya: has joined #ruby
[11:48:25] hahuang61: has joined #ruby
[11:49:53] Puffball: has joined #ruby
[11:51:19] Cavallari1: has joined #ruby
[11:58:53] John_Ivan: has joined #ruby
[11:58:54] John_Ivan: has joined #ruby
[11:59:17] tcopeland: has joined #ruby
[12:06:15] synthroid: has joined #ruby
[12:08:49] zmo: I'd like to make a member from a parent class available as self attribute in the children classes.. I thought it would be obvious, but it actually isn't. I tried doing it the same way I defined class methods (self.name) but no luck
[12:08:59] zmo: I tried with @@name
[12:10:34] bigblind: has joined #ruby
[12:11:15] zmo: how can I have a class member and access it from a child's method ?
[12:11:22] Exagone313: has joined #ruby
[12:13:13] burgestrand: zmo could you provide a minimal example of what you want to do?
[12:14:34] zmo: class A; self.a = 42; end ; class B < A; def foo; print(a); end; end
[12:15:27] bmurt: has joined #ruby
[12:16:05] zmo: hm.. actually what I really want, beyond the syntax is the opposite pattern: class A; def foo; print(self.a); end ; class B < A; self.a = 42; end
[12:16:12] zmo: so that B.foo prints 42
[12:16:15] burgestrand: zmo in the example you provided, your `.a` is defined as A.a, but your `#foo` is defined as `B.new.foo`, is that really what you're afteR/
[12:16:18] zmo: (B.new.foo)
[12:17:09] zmo: Burgestrand - yes, I want to access A.a from an instance, without having to know the class name
[12:17:30] burgestrand: zmo Now your second explanation kind of said the opposite :)
[12:17:41] zmo: Burgestrand - indeed, but it's the same mechanism
[12:18:35] burgestrand: zmo so for one, @@-variables are shared with subclasses, whereas @-variables aren't — @@-variables in this sense are dangerous because the mechanics are more likely to come at a surprise to the developer
[12:18:54] burgestrand: zmo because of the inheritation-mechanic you can do something kind of iffy, like so: https://repl.it/repls/TrimDelightfulLoaderprogram
[12:20:04] nowhereman_: has joined #ruby
[12:20:30] burgestrand: zmo the knowledge of @@-variables tend to come with a _strong_ recommendation of "don't use them"
[12:20:44] zmo: ok, thanks, I'll try that
[12:21:26] Cavallari1: has joined #ruby
[12:21:35] zmo: well, I'm just implementing a specialization pattern, so it should be fine
[12:21:40] zmo: even though the @@ syntax is ugly :)
[12:22:14] burgestrand: zmo you can definitely create your own accessor around it
[12:22:31] burgestrand: zmo see the same link again: https://repl.it/repls/TrimDelightfulLoaderprogram
[12:22:55] mynameisdebian: has joined #ruby
[12:22:58] zmo: ah, that's indeed more elegant
[12:23:10] zmo: I'll do it that way, thanks
[12:23:45] n008f4g_: has joined #ruby
[12:24:11] ltt: has joined #ruby
[12:25:29] vaillancourtmax: has joined #ruby
[12:27:05] schneider-: has joined #ruby
[12:30:04] dreger: has joined #ruby
[12:31:00] bmurt: has joined #ruby
[12:31:06] willmichael: has joined #ruby
[12:31:16] gs: has joined #ruby
[12:34:21] inukshuk_: has joined #ruby
[12:43:08] lroca: has joined #ruby
[12:50:30] schneider-: has joined #ruby
[12:51:21] hahuang61: has joined #ruby
[12:51:21] burgestrand: has joined #ruby
[12:57:45] schneider-: has joined #ruby
[12:58:27] qba73: has joined #ruby
[12:59:02] Sambsquanch: has joined #ruby
[13:01:27] willmichael: has joined #ruby
[13:01:44] lroca: has joined #ruby
[13:02:41] willmichael: has joined #ruby
[13:03:21] conta1: has joined #ruby
[13:04:36] schneider-: has joined #ruby
[13:05:33] jcalla: has joined #ruby
[13:11:50] cdg: has joined #ruby
[13:13:50] synthroid: has joined #ruby
[13:18:31] kapil___: has joined #ruby
[13:24:59] drewmcmillan: has joined #ruby
[13:25:23] Canaimero-15d8: has joined #ruby
[13:25:28] jottr: has joined #ruby
[13:26:09] memo1: has joined #ruby
[13:26:41] Canaimero-15d8: has left #ruby: ()
[13:26:46] dminuoso: Burgestrand: everything that involves hidden sharing of state has the same smell as globals
[13:26:51] dminuoso: @@ variables are semi global.
[13:27:54] burgestrand: Burgestrand what do you mean by _semi_ global?
[13:28:27] dminuoso: Burgestrand: Well semi in that you have to derive from that class or one if its descendants. first.
[13:28:52] dminuoso: Burgestrand: It's not like every part of your program has - things like class_variable_set aside - access to it.
[13:29:04] burgestrand: dminuoso Maybe it's just arguing semantics, but I don't consider $variable.thing to be different from A.thing
[13:29:25] burgestrand: (i.e. A is global, so A.thing is global)
[13:29:26] ryandv: has joined #ruby
[13:29:43] dminuoso: Burgestrand: Yup. Though luckily people dont make a habit of keeping mutable things in constants.
[13:29:54] dminuoso: And at least most good libraries make an effort to freeze constants.
[13:30:58] goatish: has joined #ruby
[13:31:08] chatchatt: has joined #ruby
[13:32:54] dminuoso: Burgestrand: I think Ruby would be quite fine if we had a module system, using identifiers that were separated from any scope.
[13:37:45] burgestrand: dminuoso i.e. `A = require "./a"`?
[13:38:23] dminuoso: Burgestrand: No I want something that doesn't operate on the assumption that every module includes itself by simply infesting global Object
[13:38:59] burgestrand: dminuoso I don't follow
[13:39:17] dminuoso: Burgestrand: Do you know ES6 modules from JavaScript?
[13:39:18] DLSteve: has joined #ruby
[13:39:21] dminuoso: Something like that.
[13:39:41] dminuoso: Burgestrand: Effectively `require` is not a "require that library" but "eval that file"
[13:40:08] bmurt: has joined #ruby
[13:40:19] vaillancourtmax: has joined #ruby
[13:40:19] burgestrand: dminuoso Isn't that pretty much what I just wrote? I guess I capitalized the A in error, so more like `a = require "./a"`, i.e. give `require` a return value
[13:40:52] dminuoso: Burgestrand: I dont follow you then.
[13:42:40] burgestrand: dminuoso ES6 modules works by explicitly exporting certain things in your module, e.g. `export function print(…) {}`, when you require something you get an object back with accessors for each export, i.e. `kernel = require("kernel"); kernel.print("Hello");`
[13:42:42] kn-928: has joined #ruby
[13:43:07] dminuoso: Burgestrand: Ah, I was just confused because you re-used ruby `require`
[13:43:20] dminuoso: Burgestrand: But yeah, basically that.
[13:43:27] kn-928: has joined #ruby
[13:44:07] burgestrand: Yeah, I agree, I've kind of wished that when you write a gem you're pretty much hoping that the global constant you're exposing won't clash with some other global constant available in the code of whoever is requiring your gem
[13:44:14] dminuoso: Burgestrand: And I dont want to have to specify the order of dependencies (having to control the order in which require statements go in, is just pure spaghetti), this is the implementations job.
[13:44:43] ltt: has joined #ruby
[13:45:11] reber: has joined #ruby
[13:48:34] hahuang61: has joined #ruby
[13:51:51] Cork: is there a way to get the key size of OpenSSL::PKey ?
[13:52:34] aupadhye: has joined #ruby
[13:54:53] mikecmpbll: has joined #ruby
[13:56:36] ryandv: has joined #ruby
[13:57:28] darix: Cork: probably
[13:57:41] Cork: ya, just found it .n.num_bits
[13:57:50] Cork: (about a min ago)
[14:01:27] darix: doesnt work here
[14:01:46] Cork: OpenSSL::PKey.new(pem_string).n.num_bits
[14:02:02] Cork: or OpenSSL::PKey.new(4096).n.num_bits == 4096
[14:02:21] Cork: * OpenSSL::PKey::RSA.new(pem_string).n.num_bits
[14:02:27] Cork: or OpenSSL::PKey::RSA.new(4096).n.num_bits == 4096
[14:03:41] John_Ivan: has joined #ruby
[14:03:41] John_Ivan: has joined #ruby
[14:09:30] gnufied: has joined #ruby
[14:09:32] luminous: has joined #ruby
[14:09:59] da3mon: has joined #ruby
[14:10:01] KeyJoo: has joined #ruby
[14:12:07] jnollette: has joined #ruby
[14:15:07] netherwolfe: has joined #ruby
[14:15:38] chouhoulis: has joined #ruby
[14:16:27] frm: has joined #ruby
[14:16:36] da3mon: has joined #ruby
[14:17:11] hahuang61: has joined #ruby
[14:17:46] Rapture: has joined #ruby
[14:30:10] _aeris_: has joined #ruby
[14:33:08] vaillancourtmax: has joined #ruby
[14:38:49] tomphp: has joined #ruby
[14:46:17] Gnut: has joined #ruby
[14:49:36] vaillancourtmax: has joined #ruby
[14:49:45] hahuang61: has joined #ruby
[14:50:37] rippa: has joined #ruby
[14:54:59] tomphp: has joined #ruby
[14:59:25] mtkd: has joined #ruby
[15:00:36] tcopeland1: has joined #ruby
[15:01:26] cschneid: has joined #ruby
[15:04:56] jeffreylevesque: has joined #ruby
[15:05:56] kanobt61: has joined #ruby
[15:07:12] GinoMan: has joined #ruby
[15:07:21] ryandv: has joined #ruby
[15:08:01] oleo: has joined #ruby
[15:08:18] kanobt61: Using Jbuilder is it possible to create json where the key to a hash has a dot in it?
[15:08:19] kanobt61: https://gist.github.com/BenKanouse/9ba5286d567b009d577ec8a790985d79
[15:08:29] kanobt61: that gist has an example of what i want
[15:08:38] kanobt61: I did some googling and didn't come up with anything
[15:10:09] burgestrand: kanobt61 (guessing) possibly with `public_send("foo.bar", 1)`
[15:10:21] burgestrand: Sorry, `json.public_send(…)`
[15:11:04] anisha__: has joined #ruby
[15:11:12] burgestrand: I don't use jbuilder, but I have a vague memory that it uses `method_missing` to create dynamic methods that correspond to the key output
[15:12:23] kanobt61: 2.3.6 :126 > Jbuilder.encode do |json|
[15:12:23] kanobt61: 2.3.6 :127 > json.public_send("foo.bar")
[15:12:23] kanobt61: 2.3.6 :128?> end
[15:12:25] kanobt61: => "{\"public_send\":\"foo.bar\"}"
[15:12:37] kanobt61: hmm it seems to think public_send is the key then
[15:12:39] burgestrand: Hah, that's kinda hilarious
[15:13:02] kanobt61: (mindblown)
[15:13:15] burgestrand: kanobt61 even if it were to work, you'd have to give it two variables, not one, it needs to know the value
[15:13:40] kanobt61: right it errored when i did json.public_send("foo.bar", 1)
[15:13:47] burgestrand: kanobt61 you could try `json.__send__("foo.bar", 1)` :D
[15:14:00] kanobt61: oh i got ya 1min
[15:14:25] burgestrand: There's probably a more appropriate method to use for this, hehe.
[15:14:29] kanobt61: 2.3.6 :129 > Jbuilder.encode do |json|
[15:14:29] kanobt61: 2.3.6 :130 > json.__send__("foo.bar", 1)
[15:14:29] kanobt61: 2.3.6 :131?> end
[15:14:31] kanobt61: => "{\"foo.bar\":1}"
[15:14:42] kanobt61: I think that's it, thanks!
[15:14:47] burgestrand: kanobt61 Aye, `json.set!("foo.bar", 1)`
[15:14:49] conta: has joined #ruby
[15:15:23] kanobt61: oh nice, that works also
[15:15:29] kanobt61: cool, that does seem better
[15:15:38] kanobt61: kinda shady that public send didn't work lolz
[15:15:58] kanobt61: did you happen to find that in the docs? I wonder how i missed that
[15:16:25] burgestrand: kanobt61 Naw, I skipped the docs, went straight into the source
[15:16:39] burgestrand: kanobt61 https://github.com/rails/jbuilder/blob/46f9e50a97f4a93e800afbe92b50c0c990acc3ef/lib/jbuilder.rb#L29
[15:16:41] kanobt61: cool, yeah i should have thought of that
[15:16:55] burgestrand: kanobt61 (searched for `method_missing` and then saw that it used `set!`)
[15:17:25] ryandv: has joined #ruby
[15:17:33] burgestrand: kanobt61 Although, to be fair, it _does_ say in the README :)
[15:17:41] kanobt61: seems like Jbuilder could just not use method_missing magic and always use set.
[15:18:04] burgestrand: It's a stylistic preference I guess
[15:18:36] yohji: has joined #ruby
[15:18:36] kanobt61: Right, I guess it is, just, like my opinion man, that method_missing stuff turns into magic.
[15:18:55] kanobt61: lol. Well this is working great. Thanks again
[15:19:30] burgestrand: kanobt61 I agree, it doesn't help that people almost always forget to implement `respond_to_missing?`, which does make interacting with the magic stuff a little bit nicer
[15:20:19] burgestrand: kanobt61 you're welcome :)
[15:22:04] kanobt61: yeah, and it needing to act like a method has ramifications to what the json can look like. Which is probably fine most of the time. But json needing to match ruby method calls syntactically seems like an odd dependency.
[15:24:41] karapetyan: has joined #ruby
[15:28:16] rikkipitt: has joined #ruby
[15:33:33] guille-moe: has joined #ruby
[15:37:26] ltt: has joined #ruby
[15:43:15] aupadhye: has joined #ruby
[15:46:42] hahuang61: has joined #ruby
[15:47:32] [Butch]: has joined #ruby
[15:48:15] xuanrui: has joined #ruby
[15:48:57] desperek: has joined #ruby
[15:50:00] yohji: has joined #ruby
[15:51:16] conta1: has joined #ruby
[15:53:03] qba73: has joined #ruby
[15:55:57] kn-928_: has joined #ruby
[15:59:06] cagomez: has joined #ruby
[15:59:17] schneider-: has joined #ruby
[16:00:20] bmurt: has joined #ruby
[16:04:41] Guest84333: has left #ruby: ("WeeChat 1.4")
[16:06:08] vrih: has joined #ruby
[16:06:13] marxarelli: has joined #ruby
[16:18:57] nowhereman_: has joined #ruby
[16:19:38] nadir: has joined #ruby
[16:19:52] Emmanuel_Chanel: has joined #ruby
[16:20:12] Ryzokuken: has joined #ruby
[16:22:12] Emmanuel_Chanel: has joined #ruby
[16:22:16] imode: has joined #ruby
[16:24:29] tomphp: has joined #ruby
[16:29:05] kn-928_: has joined #ruby
[16:29:31] Zaab1t: has joined #ruby
[16:31:05] jcarl43: has joined #ruby
[16:31:50] marr: has joined #ruby
[16:32:09] kapil___: has joined #ruby
[16:37:58] darkhanb: has joined #ruby
[16:38:03] krawchyk: has joined #ruby
[16:38:09] memo1: has joined #ruby
[16:38:32] anjen: has joined #ruby
[16:38:54] Strepsils: has joined #ruby
[16:45:47] hahuang61: has joined #ruby
[16:49:14] TinkerTyper: has joined #ruby
[16:50:00] memo1: has joined #ruby
[16:50:48] sanscoeur: has joined #ruby
[16:53:31] hahuang65: has joined #ruby
[16:57:38] Emmanuel_Chanel: has joined #ruby
[17:03:03] kies: has joined #ruby
[17:04:39] mtkd: has joined #ruby
[17:09:11] hahuang61: has joined #ruby
[17:10:16] armyriad: has joined #ruby
[17:10:59] dmitriy_: has joined #ruby
[17:15:04] ldnunes: has joined #ruby
[17:15:38] qba73: has joined #ruby
[17:15:58] dmitriy_: has joined #ruby
[17:18:54] hahuang65: has joined #ruby
[17:21:00] dmitriy_: has joined #ruby
[17:21:01] conta: has joined #ruby
[17:26:07] dmitriy_: has joined #ruby
[17:26:26] karapetyan: has joined #ruby
[17:27:45] gizmore: has joined #ruby
[17:29:18] Inside: has joined #ruby
[17:30:34] Inside: Heyo. So this is a meta question and I don't really know where to start... but I want to develop a UI for ruby. I've used qtbindings gem in the past and it was /okay/ to use, but packaging up the application with OCRA is sorta tedious and it takes forever to start up
[17:30:45] Inside: what do people use to develop UIs for windows these days? :|
[17:31:02] dmitriy_: has joined #ruby
[17:31:19] frm: has joined #ruby
[17:32:13] dminuoso: Inside: Not ruby.
[17:32:40] dminuoso: Inside: What do you need ruby for?
[17:32:50] Inside: it's what i'm most familiar with ;)
[17:33:13] dminuoso: Inside: Then get familiar with something else.
[17:33:21] krawchyk_: has joined #ruby
[17:33:21] Inside: well that's where I was going with this
[17:33:31] goatish: has joined #ruby
[17:33:48] Inside: I'm starting to kind of see why people use electron... :/
[17:34:31] dminuoso: Inside: People use electron because they know nothing else.
[17:34:37] dminuoso: Or dont want to incur the cost.
[17:34:53] Inside: My actual use case is I'm trying to develop a UI for a PLC... which talks over RTU/Modbus
[17:35:25] Inside: My previous version was quite retarded: I had a MODBUS/Websocket server and then the UI ran inside a webpage because I needed to POST the results to a database
[17:35:46] dminuoso: Inside: Rust has pretty solid gtk+ 3 bindings
[17:36:02] dmitriy_: has joined #ruby
[17:36:04] Inside: I want to cut out the whole MODBUS/Websocket/Webpage thing and just have a single layer between the PLC & DB
[17:37:00] dminuoso: Inside: What kind of UI complexity are we talking about?
[17:37:08] dminuoso: How much "stuff" do you need to jam in there?
[17:37:10] troys: has joined #ruby
[17:37:37] frm: has joined #ruby
[17:37:37] frm: has joined #ruby
[17:37:43] Inside: Not much - 2 input forms, 4 outputs, and an image that changes based on the state of the PLC
[17:38:06] Inside: I mean the webpage approach "works" and haslogged about 10,000 interactions
[17:38:18] dminuoso: Inside: Any demands for deployability, or is it just a personal play thing?
[17:38:25] Inside: it's for a test fixture for work
[17:38:53] Inside: There would be 1-3 deployments.. probably on a windows PC since IT wants to keep everything on windows
[17:39:23] dminuoso: Inside: How do you communicate with that decice? serial bus?
[17:39:31] Inside: yeah, serial over USB
[17:40:25] dminuoso: Inside: Are the input forms to be used by humans, or is the interface to be consumed by an automated test framework?
[17:40:35] Inside: for humans
[17:40:49] Inside: it's a test fixture in a factory - not the software kind :D
[17:40:51] dminuoso: Inside: Does the device generate the picture itself, or is that something you have to do as well?
[17:41:05] dmitriy_: has joined #ruby
[17:41:07] Inside: Someone drops in a component, scans the serial number, then pushes start
[17:41:45] Inside: Then the PLC does some leak checks, etc, then the interface will read a status code from the PLC and POST it to a database. For troubleshooting the UI will show an image with a possible leak location
[17:43:56] dminuoso: Inside: a miniature sinatra solution sounds like the easiest thing then.
[17:44:16] mtkd: has joined #ruby
[17:44:55] Inside: run the server locally, have it talk to the PLC then the interface is a webpage?
[17:46:00] Inside: That's actually less retarded than what I'm doing - running a remote ruby on rails server which talks to the DB & renders the UI for the application... then running a server locally which talks to the PLC and communicates with the application UI page over websockets
[17:46:03] hahuang61: has joined #ruby
[17:46:05] dmitriy_: has joined #ruby
[17:46:13] Inside: Not sure why I didn't do that in the first place, hah.
[17:46:49] dminuoso: 18:44 Inside | run the server locally, have it talk to the PLC then the interface is a webpage?
[17:47:18] dminuoso: Given the simplicity of the interface, this is the "least-effort" solution. It's also relatively robust.
[17:47:44] dminuoso: And if for whatever reasons you need to have hardware control, you can rewrite whatever you need in a native extension,.
[17:47:56] dminuoso: (Or write it as an external library that you use in a native extension)
[17:48:05] Inside: Makes sense
[17:48:19] Inside: Yeah - there's an RMODBUS library for ruby that mostly works so I've got that covered
[17:48:26] dminuoso: Even better then =)
[17:48:35] dminuoso: Inside: And ditch rails. You just need sinatra.
[17:49:05] n13z: has joined #ruby
[17:49:17] dminuoso: Or if you want it even smaller, camping is really small
[17:49:32] Inside: size is not a problem
[17:51:03] dmitriy_: has joined #ruby
[17:51:28] eckhardt_: has joined #ruby
[17:52:38] Dimik: has joined #ruby
[17:53:51] cdg: has joined #ruby
[17:54:11] hahuang65: has joined #ruby
[17:55:50] guille-moe: has joined #ruby
[17:56:04] dmitriy_: has joined #ruby
[17:57:05] bmurt: has joined #ruby
[17:59:26] dminuoso: Inside: That's what she said.
[17:59:52] dminuoso: Inside: Send me pretty pictures if your device ends up in a big ball of flame.
[18:00:07] dminuoso: ACTION is always looking for new pictures to decorate his apartment with
[18:01:05] dmitriy_: has joined #ruby
[18:01:24] tipyn: has joined #ruby
[18:04:00] qba73: has joined #ruby
[18:04:46] fribmendes: has joined #ruby
[18:04:53] Lytol: has joined #ruby
[18:05:40] frm: has joined #ruby
[18:06:03] dmitriy_: has joined #ruby
[18:06:20] willmichael: has joined #ruby
[18:11:06] dmitriy_: has joined #ruby
[18:12:33] cagomez: has joined #ruby
[18:12:33] hahuang61: has joined #ruby
[18:14:13] rgb-one: has joined #ruby
[18:15:02] AndBobsYourUncle: has joined #ruby
[18:15:31] alfiemax: has joined #ruby
[18:16:07] dmitriy_: has joined #ruby
[18:17:06] willmichael: has joined #ruby
[18:18:28] clemens3: has joined #ruby
[18:21:07] dmitriy_: has joined #ruby
[18:22:17] \void: has joined #ruby
[18:22:47] Inside: dminuoso: oh man, at my last job someone framed a PCB that I (briefly) turned into an LED/SED
[18:22:55] WebDawg: has joined #ruby
[18:26:04] dmitriy_: has joined #ruby
[18:27:06] RougeR: has joined #ruby
[18:27:06] RougeR: has joined #ruby
[18:27:12] Emmanuel_Chanel: has joined #ruby
[18:28:20] cagomez: has joined #ruby
[18:31:06] dmitriy_: has joined #ruby
[18:33:12] _whitelogger: has joined #ruby
[18:34:48] hfp_work: has joined #ruby
[18:36:04] dmitriy_: has joined #ruby
[18:37:37] tomphp: has joined #ruby
[18:40:54] n0m4d1c: has joined #ruby
[18:41:03] biberu: has joined #ruby
[18:41:05] dmitriy_: has joined #ruby
[18:42:33] tipyn: has joined #ruby
[18:42:34] hfp_work: has joined #ruby
[18:43:11] cagomez: has joined #ruby
[18:46:07] dmitriy_: has joined #ruby
[18:46:52] hfp_work: has joined #ruby
[18:48:55] schneider-: has joined #ruby
[18:49:55] SeepingN: has joined #ruby
[18:50:24] Code4Dopamine: has joined #ruby
[18:51:06] dmitriy_: has joined #ruby
[18:51:37] rwb: has joined #ruby
[18:52:48] rgb-one: has left #ruby: ("Konversation terminated!")
[18:55:19] tomaw: has joined #ruby
[18:55:33] cagomez: has joined #ruby
[18:56:09] dmitriy_: has joined #ruby
[18:58:38] fribmendes: has joined #ruby
[18:59:53] vrih: has joined #ruby
[19:01:05] raynold: has joined #ruby
[19:01:07] dmitriy_: has joined #ruby
[19:01:29] moei: has joined #ruby
[19:05:58] am55: has joined #ruby
[19:06:09] dmitriy_: has joined #ruby
[19:06:42] cagomez: has joined #ruby
[19:08:44] milardovich: has joined #ruby
[19:09:46] hfp_work: has joined #ruby
[19:11:07] dmitriy_: has joined #ruby
[19:11:15] bmurt: has joined #ruby
[19:17:27] dmitriy_: has joined #ruby
[19:17:29] schneider-: has joined #ruby
[19:19:00] frm: has joined #ruby
[19:19:00] frm: has joined #ruby
[19:19:54] vutral|kali: has joined #ruby
[19:19:54] vutral|kali: has joined #ruby
[19:22:19] cyberRodent: has joined #ruby
[19:22:27] dmitriy_: has joined #ruby
[19:24:40] jottr: has joined #ruby
[19:25:18] conta: has joined #ruby
[19:27:33] dmitriy_: has joined #ruby
[19:29:30] milardovich: has joined #ruby
[19:31:33] fribmendes: has joined #ruby
[19:31:40] fribmendes: has joined #ruby
[19:32:34] dmitriy_: has joined #ruby
[19:33:00] fribmendes: has joined #ruby
[19:33:06] fribmendes: has joined #ruby
[19:33:52] claudiuinberlin: has joined #ruby
[19:34:16] fribmendes: has joined #ruby
[19:34:34] fribmendes: has joined #ruby
[19:35:15] jottr: has joined #ruby
[19:35:19] Yzguy: has joined #ruby
[19:37:14] cyberRodent: has joined #ruby
[19:37:32] dmitriy_: has joined #ruby
[19:39:31] jenrzzz: has joined #ruby
[19:39:31] jenrzzz: has joined #ruby
[19:42:31] dmitriy_: has joined #ruby
[19:42:36] RougeR: has joined #ruby
[19:42:36] RougeR: has joined #ruby
[19:43:11] jcalla: has joined #ruby
[19:43:41] tAn: has joined #ruby
[19:43:49] Rr4sT: has joined #ruby
[19:47:34] dmitriy_: has joined #ruby
[19:49:52] mtkd: has joined #ruby
[19:52:34] dmitriy_: has joined #ruby
[19:54:29] cagomez: has joined #ruby
[19:57:32] dmitriy_: has joined #ruby
[19:58:51] kapil___: has joined #ruby
[20:00:48] cagomez: has joined #ruby
[20:01:06] Emmanuel_Chanel: has joined #ruby
[20:01:45] cyberRodent: has joined #ruby
[20:02:31] dmitriy_: has joined #ruby
[20:02:45] raul782: has joined #ruby
[20:02:57] cdg: has joined #ruby
[20:04:30] fribmendes: has joined #ruby
[20:05:02] hahuang61: has joined #ruby
[20:07:31] dmitriy_: has joined #ruby
[20:10:54] jottr: has joined #ruby
[20:11:36] raul782: has joined #ruby
[20:12:34] dmitriy_: has joined #ruby
[20:17:32] dmitriy_: has joined #ruby
[20:22:34] dmitriy_: has joined #ruby
[20:25:14] eckhardt_: has joined #ruby
[20:25:52] tAn: has joined #ruby
[20:25:58] SeepingN: has joined #ruby
[20:27:05] cagomez: has joined #ruby
[20:27:44] frm: has joined #ruby
[20:27:44] frm: has joined #ruby
[20:28:19] dmitriy_: has joined #ruby
[20:29:05] Emmanuel_Chanel: has joined #ruby
[20:29:34] dinfuehr: has joined #ruby
[20:33:19] dmitriy_: has joined #ruby
[20:36:34] workmad3: has joined #ruby
[20:36:57] am55: has joined #ruby
[20:37:10] drewmcmillan: has joined #ruby
[20:38:18] dmitriy_: has joined #ruby
[20:38:28] karapetyan: has joined #ruby
[20:38:57] b0rng0matic: has joined #ruby
[20:39:48] jenrzzz: has joined #ruby
[20:39:49] sameerynho: has joined #ruby
[20:39:52] jenrzzz: has joined #ruby
[20:40:20] Mike11: has joined #ruby
[20:40:22] mjacob: has joined #ruby
[20:41:50] mjacob: i'm looking for a ruby tutorial for someone who already has a lot of programming experience (in my case python)
[20:41:59] mjacob: can you recommend something like that?
[20:43:13] dminuoso: mjacob: Eloquent Ruby
[20:43:18] dmitriy_: has joined #ruby
[20:44:36] am55: has joined #ruby
[20:47:33] memo1: has joined #ruby
[20:47:38] baweaver: has joined #ruby
[20:48:17] dmitriy_: has joined #ruby
[20:48:44] memo1: has joined #ruby
[20:49:02] dan64: has joined #ruby
[20:53:20] dmitriy_: has joined #ruby
[20:53:25] mtkd: has joined #ruby
[20:54:23] miah: i'd go with Well Grounded Rubyist https://www.manning.com/books/the-well-grounded-rubyist because it covers basic ruby stuff and using the stdlib. if you already have programming skills its probably the things you need to know about ruby.
[20:54:59] Yzguy: has joined #ruby
[20:57:00] mjacob: both books don't seem to be specifically for people who are already programmers. or am i misinterpreting the descriptions?
[20:57:25] mjacob: basically i'm looking for something like "dive into python", but for ruby
[20:58:19] dmitriy_: has joined #ruby
[20:58:26] miah: WGR is similar to DIP if im reading the description correctly
[20:58:57] miah: WGR isn't trying to teach you OOP etc, just how to do ruby. if you already know python you can probably skim WGR for just the details you need
[20:59:18] miah: alternatively, Ruby Pocket Reference is there too http://shop.oreilly.com/product/9780596514815.do
[21:02:05] dminuoso: mjacob: Eloquent Ruby is definitely targeted at people with programming background
[21:02:29] dminuoso: mjacob: It just has a quick dozen pages of so with some introduction for a bizarre reason that is beyond me, and then catapults into the depths of ruby.
[21:03:18] dmitriy_: has joined #ruby
[21:03:27] mjacob: dminuoso: it's from 2011. would you say it's still up-to-date?
[21:03:35] dminuoso: mjacob: Yeah.
[21:03:53] dminuoso: mjacob: Ruby hasn't changed much, the few bits you can pick up along the way.
[21:03:56] miah: ya the good ruby books are all from that era
[21:04:53] willmichael: has joined #ruby
[21:06:35] memo1: has joined #ruby
[21:08:40] dmitriy_: has joined #ruby
[21:08:40] claudiuinberlin: has joined #ruby
[21:13:21] dmitriy_: has joined #ruby
[21:14:26] hahuang61: has joined #ruby
[21:18:20] dmitriy_: has joined #ruby
[21:21:13] _whitelogger: has joined #ruby
[21:22:23] anjen: has joined #ruby
[21:23:18] dmitriy_: has joined #ruby
[21:28:13] RougeR: has joined #ruby
[21:28:13] RougeR: has joined #ruby
[21:28:18] dmitriy_: has joined #ruby
[21:30:26] memo1: has joined #ruby
[21:30:36] vaillancourtmax: has joined #ruby
[21:31:12] garyserj: has joined #ruby
[21:33:20] dmitriy_: has joined #ruby
[21:35:13] hahuang61: has joined #ruby
[21:36:32] rwb: has joined #ruby
[21:38:15] jenrzzz_: has joined #ruby
[21:38:19] dmitriy_: has joined #ruby
[21:38:44] pilne: has joined #ruby
[21:43:19] dmitriy_: has joined #ruby
[21:44:40] Code4Dopamine: mjacob: a little late, but maybe you can try to see if something fits your taste here: https://github.com/EbookFoundation/free-programming-books/blob/master/free-courses-en.md#ruby
[21:46:32] drewmcmillan: has joined #ruby
[21:46:36] SynSynack: has joined #ruby
[21:47:28] Charlie: has joined #ruby
[21:47:56] Azure: has joined #ruby
[21:48:15] rubemlrm: has joined #ruby
[21:48:32] slde_track: has joined #ruby
[21:49:10] Keltia: has joined #ruby
[21:49:32] tw1sted: has joined #ruby
[21:50:06] justinmcp: has joined #ruby
[21:50:15] darkhanb: has joined #ruby
[21:50:45] jsaak: has joined #ruby
[21:50:46] ByronJohnson: has joined #ruby
[21:50:51] Map: has joined #ruby
[21:51:12] jaredrhine: has joined #ruby
[21:51:29] phaul: has joined #ruby
[21:51:30] hfp_work: has joined #ruby
[21:51:33] Emmanuel_Chanel: has joined #ruby
[21:52:08] weaksauce: mjacob i second eloquent ruby... that's the best programming book i have read
[21:52:12] UKn0Me: has joined #ruby
[21:52:23] jnollette: has joined #ruby
[21:52:39] Arahael: has joined #ruby
[21:53:31] claudiuinberlin: has joined #ruby
[21:53:47] dhollinger: has joined #ruby
[21:54:36] dmitriy_: has joined #ruby
[21:55:14] Exagone313: has joined #ruby
[21:56:43] vaillancourtmax: has joined #ruby
[21:56:52] pastorinni: has joined #ruby
[21:57:42] GinoMan: has joined #ruby
[21:58:40] dminuoso: I wouldn't go that far..
[21:58:46] dminuoso: But its probably the best ruby book.
[21:59:35] dmitriy_: has joined #ruby
[22:01:00] n0m4d1c: has joined #ruby
[22:01:28] anjen: has joined #ruby
[22:03:39] ledestin: has joined #ruby
[22:04:38] dmitriy_: has joined #ruby
[22:05:02] johnny56_: has joined #ruby
[22:06:37] cdg: has joined #ruby
[22:06:59] memo1: has joined #ruby
[22:07:17] cdg: has joined #ruby
[22:08:06] cdg_: has joined #ruby
[22:09:18] babykosh: has joined #ruby
[22:09:37] dmitriy_: has joined #ruby
[22:10:06] weaksauce: i don't know, everything about it was great
[22:10:21] mniip: has joined #ruby
[22:10:55] dminuoso: weaksauce: Yeah but if thats the best programming book you have read, then you're in for a treat..
[22:11:12] IshMael_: has joined #ruby
[22:14:18] weaksauce: dminuoso what is better in your opinion?
[22:14:32] vaillancourtmax: has joined #ruby
[22:15:07] weaksauce: at least in the context of what someone is asking for? a book for competent programmers to get a good lay of idiomatic practices in a language
[22:15:21] weaksauce: written for experienced programmers
[22:16:16] dminuoso: weaksauce: Books that dont focus on teaching you language idioms.
[22:17:02] weaksauce: concept wise there are more useful books sure. none i have read were as nicely written though.
[22:17:04] dminuoso: weaksauce: The vast majority of language idioms are not "good patterns to train", but rather mishaps and misfeatures in language design that are hacked and worked around with poor abstractions.
[22:18:16] havenwood: has joined #ruby
[22:18:17] havenwood: has joined #ruby
[22:20:00] bmurt: has joined #ruby
[22:20:27] IshMael_: has left #ruby: ("WeeChat 2.0.1")
[22:22:40] dminuoso: miah is likely to have a fancy random suggestion, based on their comment.
[22:23:25] weaksauce: i'm all ears
[22:23:44] weaksauce: my statement might have been a bit of hyperbole ;)
[22:24:23] dminuoso: weaksauce: Im currently digging through "Pierce, Types and Programming Languages" which is a very refreshing book that is broadening my horizon with every paragraph. :)
[22:24:33] pilne: anyone have any horror stories about the pycall gem for *borrowing* things from the stricter snakey folk? (:
[22:27:28] ChaosBringer: has joined #ruby
[22:28:39] RougeR: has joined #ruby
[22:28:39] RougeR: has joined #ruby
[22:30:06] raynold: has joined #ruby
[22:30:46] memo1: has joined #ruby
[22:32:06] kn-928_: has joined #ruby
[22:32:57] eckhardt_: has joined #ruby
[22:37:00] workmad3: has joined #ruby
[22:37:05] memo1: hi, if i want to read the first 10 lines of a file, how i do it in ruby?
[22:43:06] weaksauce: file=File.open('somefile', 'r'); (1..10).to_a.each do puts file.read_line end or something like that should work
[22:46:34] milardovich: has joined #ruby
[22:49:52] guacamole: has joined #ruby
[22:49:52] guacamole: has joined #ruby
[22:52:57] yokel: has joined #ruby
[22:53:10] memo1: weaksauce: why (1..10).to_a, why i have to convert to array?
[22:53:47] weaksauce: >> (1..10).each do |i| puts i end
[22:53:49] ruby[bot]: weaksauce: # => 1 ...check link for more (https://eval.in/970739)
[22:54:05] weaksauce: i guess it works now. i thought that was not allowed
[22:59:30] cdg: has joined #ruby
[23:04:49] bmurt: has joined #ruby
[23:06:02] tcopeland: has joined #ruby
[23:07:13] s3nd1v0g1us: has joined #ruby
[23:10:32] guacamole: has joined #ruby
[23:10:32] guacamole: has joined #ruby
[23:11:43] apeiros: memo1: also File.foreach(path).first(10)
[23:11:53] memo1: hi, im trying to open a file than contains many jpeg files. When i opened it displays a lot ot rubish https://gist.github.com/anonymous/dd53cca93cb690dc4354117b5d81a65b
[23:12:21] apeiros: memo1: what did you expect? images are binary files. they don't contain text.
[23:14:17] memo1: i need to find a pattern to construct independet jpeg files, but the ?? sigs dont help me. There is a way to view the file on hex
[23:16:12] memo1: apeiros: i read a perl file that extract that kind files, looking for this patther "\xFF\xD8" and "\xFF\xD9"
[23:17:18] apeiros: ok: 1) binary files don't really have lines, 2) except for header data, text manipulation won't work all that well to manipulate jpegs
[23:18:12] apeiros: and 3) if you read the file as binary (encoding: "binary"), you can do such searches and substitutions. "\xff\xd8" is the same in ruby as in perl (or well, similar enough, not sure about perl's encoding handling)
[23:19:02] apeiros: (not that I'd recommend it, especially since you don't seem to know what those patterns actually mean)
[23:19:25] memo1: apeiros: can i share the perl file?, is short, i just try ro reply on ruby. Just for learning
[23:19:47] apeiros: sure, but it'll be others to look at it. I'm hitting the pillow now.
[23:20:37] memo1: https://gist.github.com/anonymous/10cd235949ae354cb49cb3564bd722c6 is this apeiros
[23:20:59] apeiros: as said, I'm off now
[23:21:23] milardovich: has joined #ruby
[23:21:24] memo1: thanks apeiros
[23:22:31] tAn: has joined #ruby
[23:23:13] orbyt_: has joined #ruby
[23:23:43] memo1: apeiros: to open de file (encoding binary) i with optcion 'b'?
[23:24:08] dmitriy_: has joined #ruby
[23:24:12] eckhardt_: has joined #ruby
[23:25:37] kn-928_: has joined #ruby
[23:29:08] dmitriy_: has joined #ruby
[23:31:52] cagomez: has joined #ruby
[23:34:03] dmitriy_: has joined #ruby
[23:35:44] roshanavand: has joined #ruby
[23:36:13] Charlie: has left #ruby: ()
[23:37:42] havenwood: memo1: File.binread
[23:37:45] alfiemax: has joined #ruby
[23:38:04] houhoulis: has joined #ruby
[23:38:12] havenwood: >> ''.encoding
[23:38:13] hahuang61: has joined #ruby
[23:38:14] ruby[bot]: havenwood: # => #<Encoding:UTF-8> (https://eval.in/970766)
[23:38:19] havenwood: >> ''.b.encoding
[23:38:20] ruby[bot]: havenwood: # => #<Encoding:ASCII-8BIT> (https://eval.in/970767)
[23:39:06] dmitriy_: has joined #ruby
[23:39:58] SeepingN: has joined #ruby
[23:42:21] ramfjord: has joined #ruby
[23:44:01] roca: has joined #ruby
[23:44:04] dmitriy_: has joined #ruby
[23:47:11] baweaver: has joined #ruby
[23:49:06] dmitriy_: has joined #ruby
[23:54:06] dmitriy_: has joined #ruby
[23:59:06] dmitriy_: has joined #ruby