« Back to channel list

#ruby - 10 January 2018

« Back 1 day Forward 1 day »
[00:00:18] hahuang65: has joined #ruby
[00:00:30] selim: has joined #ruby
[00:04:28] jxv: has joined #ruby
[00:10:42] jxv: has joined #ruby
[00:21:41] guacamole: has joined #ruby
[00:23:30] zapata: has joined #ruby
[00:23:40] guacamole: has joined #ruby
[00:24:05] k0mpa: has joined #ruby
[00:25:31] k0mpa: has joined #ruby
[00:26:27] Noisy: has joined #ruby
[00:30:10] Mekkis: has joined #ruby
[00:30:45] goatish: has joined #ruby
[00:31:15] jamiejackson: has joined #ruby
[00:32:00] Inoperable: has joined #ruby
[00:34:16] zapata_: has joined #ruby
[00:34:53] banisterfiend: has joined #ruby
[00:36:19] mikecmpbll: has joined #ruby
[00:36:22] dizzy1or5[m]: has joined #ruby
[00:37:16] Jameser: has joined #ruby
[00:37:59] alfiemax: has joined #ruby
[00:37:59] elphe: has joined #ruby
[00:38:37] headius: has joined #ruby
[00:38:56] znz_jp: has joined #ruby
[00:39:03] nyuszika7h: has joined #ruby
[00:39:59] jonjits[m]1: has joined #ruby
[00:40:20] Miron: has joined #ruby
[00:41:00] m0x00: has joined #ruby
[00:41:06] endemic: has joined #ruby
[00:41:44] S007: has joined #ruby
[00:47:41] Noisy: has left #ruby: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[00:49:32] guacamole: has joined #ruby
[00:53:13] Troy2: has joined #ruby
[00:54:31] pastorinni: has joined #ruby
[00:54:53] alfiemax: has joined #ruby
[00:55:51] Miron: has joined #ruby
[00:56:02] S007: has joined #ruby
[00:59:37] bronson: has joined #ruby
[01:03:51] l_tonz: has joined #ruby
[01:10:38] r4z3r: has joined #ruby
[01:10:38] bmurt: has joined #ruby
[01:11:32] ResidentBiscuit: has joined #ruby
[01:13:18] orbyt_: has joined #ruby
[01:13:38] l_tonz: has joined #ruby
[01:16:53] Algebr: has joined #ruby
[01:18:23] troydm: I might be dumb, but I open3 a cat command and trying to feed stdin to it but I keep weird behaviour with stderr, because it blocks read_nonblock
[01:18:24] Algebr: anyone here going to the ruby thing tonight in SF?
[01:18:44] Algebr: havenwood: going to SF thing?
[01:18:58] havenwood: Algebr: I'm in LA at the moment
[01:19:12] havenwood: Algebr: Otherwise I would be!
[01:21:42] vhvv: has joined #ruby
[01:27:56] Zamyatin: has joined #ruby
[01:28:47] guacamole: has joined #ruby
[01:31:10] s3nd1v0g1us: has joined #ruby
[01:36:00] guacamole: has joined #ruby
[01:38:06] eckhardt: has joined #ruby
[01:39:16] jeffreylevesque: has joined #ruby
[01:40:44] cdg: has joined #ruby
[01:44:41] Azure|dc: has joined #ruby
[01:44:53] hahuang65: has joined #ruby
[01:46:16] drewmcmillan: has joined #ruby
[01:47:00] tAn: has joined #ruby
[01:47:24] alfiemax: has joined #ruby
[02:03:14] k0mpa: has joined #ruby
[02:03:31] jnollette: has joined #ruby
[02:09:37] n0m4d1c: has joined #ruby
[02:10:16] steveh7: has joined #ruby
[02:13:31] shinnya: has joined #ruby
[02:16:07] ramfjord: What's this ruby thing in SF tonight??
[02:16:35] cdg: has joined #ruby
[02:17:38] ramfjord: havenwood: do you have a link for it? Seems Algebr is offline
[02:18:15] havenwood: ramfjord: https://www.meetup.com/fogcityruby/events/246414035/
[02:18:26] ramfjord: ty for the link!
[02:21:47] l_tonz: has joined #ruby
[02:25:59] tao_: has joined #ruby
[02:26:33] SuperLag: has joined #ruby
[02:29:08] jready: has joined #ruby
[02:29:35] gizmore: has joined #ruby
[02:29:43] brianpWins: has joined #ruby
[02:36:32] jnollette: has joined #ruby
[02:37:23] alfiemax: has joined #ruby
[02:38:56] guacamole: has joined #ruby
[02:42:02] chocoelho: has joined #ruby
[02:49:25] pastorinni: has joined #ruby
[02:50:45] cdg: has joined #ruby
[02:52:49] cdg: has joined #ruby
[02:54:09] elphe: has joined #ruby
[02:59:25] l_tonz: has joined #ruby
[03:00:14] vhvv: has joined #ruby
[03:00:38] tAn: has joined #ruby
[03:00:56] bronson: has joined #ruby
[03:01:58] vhvv: has left #ruby: ()
[03:05:27] alfiemax: has joined #ruby
[03:07:47] safetypin: has joined #ruby
[03:10:52] l_tonz: has joined #ruby
[03:15:57] JusticeFries: has joined #ruby
[03:25:04] mjolnird: has joined #ruby
[03:37:19] Azure: has joined #ruby
[03:38:02] darkhanb: has joined #ruby
[03:40:16] hahuang65: has joined #ruby
[03:43:47] tAn: has joined #ruby
[03:46:58] bmurt: has joined #ruby
[03:47:45] zwliew: has joined #ruby
[03:48:28] KrzaQ: has joined #ruby
[03:59:03] uZiel: has joined #ruby
[04:00:23] govg: has joined #ruby
[04:01:13] elphe: has joined #ruby
[04:11:44] chridal: has joined #ruby
[04:11:45] alfiemax: has joined #ruby
[04:12:31] l_tonz: has joined #ruby
[04:14:46] elcontrastador: has joined #ruby
[04:16:12] DmitryBochkarev: has joined #ruby
[04:20:35] bmurt: has joined #ruby
[04:23:37] tAn: has joined #ruby
[04:28:07] Megamosaren: has joined #ruby
[04:29:08] elphe: has joined #ruby
[04:30:52] JusticeFries: has joined #ruby
[04:37:58] KeyJoo: has joined #ruby
[04:46:02] l_tonz: has joined #ruby
[04:46:50] Zamyatin: has joined #ruby
[04:50:23] kies: has joined #ruby
[04:50:52] gix: has joined #ruby
[04:57:10] kapil___: has joined #ruby
[04:58:48] mikecmpbll: has joined #ruby
[04:59:53] iamarun: has joined #ruby
[05:01:44] bronson: has joined #ruby
[05:07:18] alfiemax: has joined #ruby
[05:07:38] tAn: has joined #ruby
[05:20:31] KeyJoo: has joined #ruby
[05:30:05] jtdoncas: has joined #ruby
[05:32:45] aupadhye: has joined #ruby
[05:35:57] za1b1tsu: has joined #ruby
[05:41:20] hahuang65: has joined #ruby
[05:47:35] tAn: has joined #ruby
[05:53:24] dionysus69: has joined #ruby
[05:59:05] l_tonz: has joined #ruby
[06:14:39] iamarun: has joined #ruby
[06:15:55] oetjenj: has joined #ruby
[06:16:20] jenrzzz: has joined #ruby
[06:16:33] ur5us: has joined #ruby
[06:16:43] oetjenj: has joined #ruby
[06:17:28] oetjenj: has joined #ruby
[06:18:14] oetjenj: has joined #ruby
[06:19:00] oetjenj: has joined #ruby
[06:19:12] jamesaxl: has joined #ruby
[06:19:46] oetjenj: has joined #ruby
[06:20:30] quobo: has joined #ruby
[06:20:33] oetjenj: has joined #ruby
[06:21:24] LocaMocha: has joined #ruby
[06:26:12] dinfuehr: has joined #ruby
[06:30:36] elphe: has joined #ruby
[06:31:12] rabajaj: has joined #ruby
[06:31:46] anisha: has joined #ruby
[06:36:04] tAn: has joined #ruby
[06:38:24] apeiros: has joined #ruby
[06:38:44] mikhael_k33hl: has joined #ruby
[06:39:19] mikhael_k33hl: Tried running rubocop on my rb file to check. I'm getting this Missing top-level module documentation comment. module FileOps warning. What does this mean?
[06:40:15] apeiros: mikhael_k33hl: I assume it means that you didn't document that module
[06:40:42] elphe: has joined #ruby
[06:41:40] mikhael_k33hl: apeiros: Uhhhm how do I document it? using comments?
[06:41:52] apeiros: yes. see rdoc or yard.
[06:42:43] mikhael_k33hl: apeiros: okay I'll take a look at it
[06:44:25] alfiemax: has joined #ruby
[06:47:50] Megamosaren: has joined #ruby
[06:49:34] Asher: has joined #ruby
[06:50:03] darkhanb: has joined #ruby
[07:01:26] drewmcmillan: has joined #ruby
[07:02:35] bronson: has joined #ruby
[07:04:39] jamesaxl: has joined #ruby
[07:04:56] dionysus69: has joined #ruby
[07:05:02] phaul: has joined #ruby
[07:07:12] darkhanb: has joined #ruby
[07:07:17] Puffball: has joined #ruby
[07:17:43] ramfjord: has joined #ruby
[07:24:18] Asher: has joined #ruby
[07:28:17] LenPayne: has joined #ruby
[07:29:43] roshanavand: has joined #ruby
[07:31:27] jtdoncas: has joined #ruby
[07:33:17] zwliew: has joined #ruby
[07:35:20] mikhael_k33hl: Regarding Logging, can someone refer me to an article pertaining ruby's best practice about it? or are you guys using a gem?
[07:37:01] apeiros: mikhael_k33hl: logger is part of stdlib
[07:37:16] apeiros: best practices depend highly on your use-case
[07:37:18] mikhael_k33hl: apeiros: currently reading about it: http://rubylearning.com/satishtalim/ruby_logging.html
[07:37:41] jtdoncas: has joined #ruby
[07:37:44] apeiros: f.ex. part of 12factor apps is to not log to files at all
[07:38:21] apeiros: in a server application which runs in multiple processes and threads, you should make PID and Thread-ID part of what you emit (rails terribly fails at that)
[07:38:21] mikhael_k33hl: apeiros: so just output it on standard output?
[07:38:39] apeiros: mikhael_k33hl: again, depends on your use-case.
[07:38:56] apeiros: as with most things in programming, there's no silver bullet. no one true answer.
[07:39:10] mikhael_k33hl: apeiros: Hmm so it would be best to create the Log Object on a module and just include it on every class that I need logging capabilities right?
[07:39:38] mikhael_k33hl: oh or just create a global variable
[07:42:08] apeiros: I prefer constants over globals
[07:42:12] hahuang65: has joined #ruby
[07:42:24] apeiros: and I'd probably prefer a class method over a constant to access the logger
[07:42:28] apeiros: e.g. YourApp.logger
[07:42:53] andikr: has joined #ruby
[07:44:37] dminuoso: apeiros: constants _are_ globals.
[07:45:05] conta: has joined #ruby
[07:46:09] dminuoso: The only difference is that $ gvars dont have namespacing, so I guess that makes constants a little more organizeable.
[07:47:18] Jameser: has joined #ruby
[07:48:52] dminuoso: Though I guess there's that bit about private_constant, but oh well - out of all the gems I have installed, only concurrent-ruby actually makes use of it.
[07:50:53] tAn: has joined #ruby
[07:51:55] apeiros: dminuoso: no, they are globally visible. they are not globals. yes, the distinction matters.
[07:52:08] iamarun: has joined #ruby
[07:52:21] apeiros: and correct, the namespacing is the relevant feature. Foo != Foo depending on your Module.nesting
[07:52:37] apeiros: whereas $foo is always == $foo
[07:52:42] dminuoso: apeiros: what exactly is the difference between a globally visible variable and a global variable then?
[07:52:54] apeiros: (meaning the variable, not the ref'd obj)
[07:54:21] dminuoso: apeiros: That's just language ergonomics. private_constant aside, constants are global variables. Foo == Foo always. The thing is, just imagine you never used relative constant names, but always fully qualify them.
[07:54:32] dminuoso: Say ::Foo::Bar::Quux
[07:54:48] apeiros: in short: the difference is that the name alone is not identifying the constant.
[07:55:07] dminuoso: apeiros: It absolutely is.
[07:55:20] apeiros: if you fully qualify it, yes
[07:55:30] apeiros: if not, context is part of the identification.
[07:55:37] apeiros: same as other variables.
[07:55:52] apeiros: by your logic, any globally reachable variable is a global.
[07:56:11] dminuoso: That is the very definition of a global variable.
[07:56:19] apeiros: then the distinction doesn't matter and why do we use terminology anyway? :-p
[07:56:28] apeiros: I can reach ivars globally too
[07:56:34] apeiros: if I have enough identifying information
[07:56:48] dminuoso: You dont need identifying information.
[07:56:49] apeiros: and "enough identifying information" = "stuff beyond the bare name"
[07:56:51] dminuoso: And realistically yes.
[07:56:56] dminuoso: Because you have ObjectSpace.
[07:57:04] apeiros: and "fully qualified" = "stuff beyond the bare name"
[07:57:14] apeiros: so sorry, but IMO your reason is pointless.
[07:57:56] apeiros: ObjectSpace requires identifying information too
[07:58:11] apeiros: e.g. an object id for _id2ref
[07:59:20] apeiros: ACTION shall henceforth call an @ivar an @diminuoso_global ;-p
[07:59:36] apeiros: no tabcomplete with @ :<
[08:02:04] Chuguniy: has joined #ruby
[08:02:15] TomyWork: has joined #ruby
[08:02:30] elphe: has joined #ruby
[08:02:32] mark_66: has joined #ruby
[08:05:53] madhatter: has joined #ruby
[08:09:37] elphe: has joined #ruby
[08:10:44] tAn: has joined #ruby
[08:12:03] jtdoncas: has joined #ruby
[08:13:37] drewmcmillan: has joined #ruby
[08:28:37] burgestrand: has joined #ruby
[08:29:25] Jameser: has joined #ruby
[08:30:50] aufi: has joined #ruby
[08:32:40] eckhardt: has joined #ruby
[08:35:25] iamarun: has joined #ruby
[08:37:13] amatas: has joined #ruby
[08:37:41] jtdoncas: has joined #ruby
[08:38:59] l_tonz: has joined #ruby
[08:39:02] claudiuinberlin: has joined #ruby
[08:39:45] InfinityFye: has joined #ruby
[08:39:46] Chuguniy: has joined #ruby
[08:41:23] marr: has joined #ruby
[08:42:24] InfinityFye: has left #ruby: ()
[08:48:20] elphe: has joined #ruby
[08:50:57] guille-moe: has joined #ruby
[08:51:53] dinfuehr: has joined #ruby
[08:52:33] jenrzzz: has joined #ruby
[09:02:15] VladGh_: has joined #ruby
[09:02:47] vtx: has joined #ruby
[09:03:48] bronson: has joined #ruby
[09:09:06] iamarun: has joined #ruby
[09:15:34] mikecmpbll: has joined #ruby
[09:17:53] ramfjord: has joined #ruby
[09:18:35] livcd: has joined #ruby
[09:19:19] Beams: has joined #ruby
[09:19:53] jtdoncas: has joined #ruby
[09:22:47] anisha: has joined #ruby
[09:23:20] surrounder: has joined #ruby
[09:27:01] sepp2k: has joined #ruby
[09:28:53] iamarun: has joined #ruby
[09:29:41] MrBusiness: has joined #ruby
[09:29:56] dviola: has joined #ruby
[09:31:35] l_tonz: has joined #ruby
[09:32:51] guardianx: has joined #ruby
[09:35:27] biberu: has joined #ruby
[09:38:34] alfiemax: has joined #ruby
[09:40:49] surrounder: has joined #ruby
[09:43:08] randomstrangerb: has joined #ruby
[09:43:16] hahuang65: has joined #ruby
[09:44:59] anas: has joined #ruby
[09:45:10] Axy: has joined #ruby
[09:47:00] jnollette: has joined #ruby
[09:47:55] DaniG2k: has joined #ruby
[09:47:59] iamarun: has joined #ruby
[09:52:30] jtdoncas: has joined #ruby
[10:05:40] Cavallari: has joined #ruby
[10:09:15] tomphp: has joined #ruby
[10:12:29] alex``: has joined #ruby
[10:14:41] iamarun: has joined #ruby
[10:15:38] jaruga: has joined #ruby
[10:20:41] alex``: has joined #ruby
[10:22:56] tvw: has joined #ruby
[10:23:33] jtdoncas: has joined #ruby
[10:24:27] jottr_: has joined #ruby
[10:25:45] alfiemax: has joined #ruby
[10:27:56] milardovich: has joined #ruby
[10:27:56] alfiemax_: has joined #ruby
[10:28:03] ldnunes: has joined #ruby
[10:29:11] Tempesta: has joined #ruby
[10:29:27] uZiel_: has joined #ruby
[10:34:20] modin: has joined #ruby
[10:37:39] miskatonic: has joined #ruby
[10:39:12] l_tonz: has joined #ruby
[10:39:45] jtdoncas: has joined #ruby
[10:43:57] alfiemax: has joined #ruby
[10:45:03] Immune: has joined #ruby
[10:50:02] iamarun: has joined #ruby
[10:52:43] Riddell: has joined #ruby
[10:54:49] jtdoncas: has joined #ruby
[10:55:38] roshanavand: has left #ruby: ()
[11:00:21] miskatonic: has joined #ruby
[11:00:30] uZiel: has joined #ruby
[11:03:36] huyderman: has joined #ruby
[11:04:53] bronson: has joined #ruby
[11:05:18] sja: has joined #ruby
[11:10:15] ldnunes: has joined #ruby
[11:14:50] Inoperable: has joined #ruby
[11:15:11] l_tonz: has joined #ruby
[11:18:26] alex``: has joined #ruby
[11:19:34] jottr_: has joined #ruby
[11:22:18] ivanskie: has joined #ruby
[11:25:18] tvw: has joined #ruby
[11:26:48] ams__: has joined #ruby
[11:30:15] jtdoncas: has joined #ruby
[11:31:25] drewmcmillan: has joined #ruby
[11:36:22] l_tonz: has joined #ruby
[11:38:47] Troy2: has joined #ruby
[11:38:52] Jameser: has joined #ruby
[11:41:30] rahul_bajaj: has joined #ruby
[11:41:57] AJA4350: has joined #ruby
[11:44:04] hahuang65: has joined #ruby
[11:47:22] roshanavand: has joined #ruby
[11:49:17] l_tonz: has joined #ruby
[11:53:56] Immune: has joined #ruby
[11:54:56] alfiemax: has joined #ruby
[11:56:09] Psybur: has joined #ruby
[11:58:09] dinfuehr: has joined #ruby
[12:00:21] jamiejackson: has joined #ruby
[12:00:27] jtdoncas: has joined #ruby
[12:01:24] pwnd_nsfw`: has joined #ruby
[12:04:07] pwnd_nsfw: has joined #ruby
[12:09:45] jtdoncas: has joined #ruby
[12:17:50] Megamosaren: has joined #ruby
[12:18:59] KeyJoo: has joined #ruby
[12:19:02] n0m4d1c: has joined #ruby
[12:20:43] govg: has joined #ruby
[12:20:50] cdg: has joined #ruby
[12:22:10] Jameser: has joined #ruby
[12:24:12] jottr: has joined #ruby
[12:24:55] apparition: has joined #ruby
[12:24:59] QualityAddict: has joined #ruby
[12:25:03] SCHAPiE: has joined #ruby
[12:25:36] n0m4d1c_: has joined #ruby
[12:34:18] zwliew: has joined #ruby
[12:36:58] l_tonz: has joined #ruby
[12:38:21] Immune: has joined #ruby
[12:38:34] jtdoncas: has joined #ruby
[12:40:55] shinnya: has joined #ruby
[12:44:52] leah2: has joined #ruby
[12:46:18] alfiemax: has joined #ruby
[12:47:37] VladGh: has joined #ruby
[12:52:18] l_tonz: has joined #ruby
[12:54:54] alfiemax: has joined #ruby
[12:59:36] alfiemax: has joined #ruby
[13:00:53] ahrs: has joined #ruby
[13:02:38] miskaton`: has joined #ruby
[13:05:24] vondruch_: has joined #ruby
[13:05:37] bronson: has joined #ruby
[13:08:19] Strepsils: has joined #ruby
[13:12:09] synthroid: has joined #ruby
[13:13:29] PaulCapestany: has joined #ruby
[13:15:04] jtdoncas: has joined #ruby
[13:16:11] Immune: has joined #ruby
[13:17:15] tomphp: has joined #ruby
[13:18:12] ramfjord: has joined #ruby
[13:19:46] rahul_bajaj: has joined #ruby
[13:22:22] leah2: has joined #ruby
[13:29:42] apeiros: has joined #ruby
[13:30:05] l_tonz: has joined #ruby
[13:37:06] rahul_bajaj: has joined #ruby
[13:37:48] bweston92: has joined #ruby
[13:42:06] bmurt: has joined #ruby
[13:43:03] tcopeland: has joined #ruby
[13:43:42] Troy2: has joined #ruby
[13:44:19] PaulCapestany: has joined #ruby
[13:44:56] hahuang65: has joined #ruby
[13:48:24] uZiel: has joined #ruby
[13:49:41] jtdoncas: has joined #ruby
[13:50:10] jaruga: has joined #ruby
[13:52:01] Immune: has joined #ruby
[13:54:55] cdg: has joined #ruby
[13:55:09] vichib: has joined #ruby
[13:56:55] cdg: has joined #ruby
[13:57:22] l_tonz: has joined #ruby
[13:57:29] Psybur_: has joined #ruby
[13:58:03] elphe: has joined #ruby
[14:05:49] kapil___: has joined #ruby
[14:10:26] ua: has joined #ruby
[14:11:58] jeffreylevesque: has joined #ruby
[14:12:48] Terens: has joined #ruby
[14:13:06] Terens: Is there a way to override a private module ?
[14:14:05] dminuoso: terens: What private what?
[14:15:14] amatas_: has joined #ruby
[14:16:03] Terens: class AClass .... private .... module XXX ... end end
[14:16:23] Terens: to extend/change XXX module from outside
[14:16:55] dminuoso: terens: That doesn't do what you think it does.
[14:17:25] dminuoso: terens: `private` changes method visibility. A module has no notion of being "private"
[14:17:35] dminuoso: terens: There are however private constants.
[14:18:12] Terens: having private visibility
[14:18:21] Terens: is there a way to alter its code?
[14:18:32] Terens: i mean if the code above is at a gem
[14:18:37] Terens: and I want to change it
[14:18:47] alfiemax: has joined #ruby
[14:18:47] dminuoso: terens: Then fork the code.
[14:18:51] Terens: change a method inside that module
[14:19:05] Terens: maybe that is what I am going to do
[14:21:08] dminuoso: terens: If you intend to change how somebody elses code behaves, then change that code.
[14:21:35] jottr: has joined #ruby
[14:22:58] tomphp: has joined #ruby
[14:23:04] jtdoncas: has joined #ruby
[14:23:32] bonhag: has joined #ruby
[14:25:48] milardovich: has joined #ruby
[14:26:34] vondruch: has joined #ruby
[14:27:02] amatas_: has joined #ruby
[14:27:19] Guest37798: has joined #ruby
[14:28:53] burgestrand: terens Yes, ruby allows you to override defined methods, and replace constants
[14:29:02] Terens: has joined #ruby
[14:29:22] burgestrand: terens Typically frowned upon, because changing code that's not yours means it might change from underneath you without you knowing
[14:30:01] l_tonz: has joined #ruby
[14:30:17] burgestrand: Noticed you left the channel, so my previous message said: terens Yes, ruby allows you to override defined methods, and replace constants
[14:30:20] dminuoso: Burgestrand: And how do you access a module behind a private constant?
[14:30:21] ramfjord: has joined #ruby
[14:30:35] dminuoso: (For the purpose of this discussion you are forbidden to use ObjectSpace or Fidddle)
[14:30:53] burgestrand: dminuoso Where does it say it's a private constant?
[14:31:05] dminuoso: Burgestrand: It was kind of implied.
[14:31:33] burgestrand: dminuoso Not to me
[14:31:39] dminuoso: Burgestrand: Fair enough/
[14:32:36] milardovich: has joined #ruby
[14:33:49] Immune: has joined #ruby
[14:37:06] burgestrand: dminuoso Turns out `const_get` doesn't care about constant visibility :)
[14:37:13] burgestrand: (nor `const_set`)
[14:39:26] drewmcmillan: has joined #ruby
[14:39:31] burgestrand: dminuoso e.g. https://repl.it/repls/BlackNoteworthyGyrfalcon
[14:40:54] r4z3r: has joined #ruby
[14:43:09] vdl: has joined #ruby
[14:48:25] Terens: has joined #ruby
[14:49:35] pastorinni: has joined #ruby
[14:50:35] pastorinni: has joined #ruby
[14:53:28] alfiemax: has joined #ruby
[14:53:45] rippa: has joined #ruby
[14:56:55] sleetdrop: has joined #ruby
[14:59:34] Psybur__: has joined #ruby
[14:59:39] alfiemax: has joined #ruby
[15:02:54] jtdoncas: has joined #ruby
[15:03:41] chocoelho: has joined #ruby
[15:04:51] alfiemax_: has joined #ruby
[15:06:04] kies: has joined #ruby
[15:06:49] bronson: has joined #ruby
[15:08:07] safetypin: has joined #ruby
[15:08:40] randomstrangerb: has joined #ruby
[15:10:43] Psybur: has joined #ruby
[15:12:20] l_tonz: has joined #ruby
[15:12:21] Immune: has joined #ruby
[15:12:45] kobain: has joined #ruby
[15:14:53] Rapture: has joined #ruby
[15:15:04] alfiemax: has joined #ruby
[15:15:34] elphe: has joined #ruby
[15:17:19] Torrone: has joined #ruby
[15:17:19] bmurt: has joined #ruby
[15:24:47] oleo: has joined #ruby
[15:34:01] roshanavand: has joined #ruby
[15:34:51] alfiemax: has joined #ruby
[15:36:10] cedum: has joined #ruby
[15:37:18] cedum: has left #ruby: ("Good Bye")
[15:37:21] jamiejackson: has joined #ruby
[15:37:25] jtdoncas: has joined #ruby
[15:41:45] Puffball: has joined #ruby
[15:47:31] Immune: has joined #ruby
[15:51:17] roshanavand: has left #ruby: ()
[15:55:25] elphe: has joined #ruby
[16:00:46] cdg: has joined #ruby
[16:02:47] l_tonz: has joined #ruby
[16:02:56] cdg: has joined #ruby
[16:03:33] cdg_: has joined #ruby
[16:05:37] VladGh: has joined #ruby
[16:06:15] bonhag: has joined #ruby
[16:06:26] im0nde: has joined #ruby
[16:07:10] dionysus69: has joined #ruby
[16:07:11] tAn: has joined #ruby
[16:14:16] jtdoncas: has joined #ruby
[16:15:46] gizmore|2: has joined #ruby
[16:17:04] hays_: has joined #ruby
[16:18:04] vichib: has joined #ruby
[16:18:35] LenPayne: has joined #ruby
[16:18:47] vichib: has joined #ruby
[16:18:47] hays_: hey can someone help me with a pattern? I want to have a class where I define an error handler, e.g. onError { |e| ... } and then I call that error handler whenever I feel like I need do with argument e
[16:18:59] hays_: not sure how to set all of this up... an example would be awesome
[16:19:53] apeiros: has joined #ruby
[16:20:09] n0m4d1c: has joined #ruby
[16:21:54] ule: hays_: I guess you can create a custom excemption, and then every time you feel like you can raise that exception
[16:21:58] AndroUser2: has joined #ruby
[16:23:11] canton7: hays_, https://eval.in/933171
[16:23:28] canton7: but yeah, consider whether throwing an exception is more appropriate
[16:23:53] hays_: I will consider. thanks for the same.
[16:24:06] uZiel: has joined #ruby
[16:25:14] hays_: as is usually the case, I have a few things going on here, so .. my design may not be perfect :)
[16:26:35] drewmcmillan: has joined #ruby
[16:26:46] hays_: I was thinking I'd need yields to make this happen
[16:27:30] vichib: has joined #ruby
[16:27:58] alfiemax_: has joined #ruby
[16:28:29] hays_: canton7: can you explain the .(e) ? what are the parens for?
[16:29:23] Immune: has joined #ruby
[16:29:38] vichib: has joined #ruby
[16:29:44] canton7: that's shorthand for Proc#call. You could also do @error_handler.call(e)
[16:32:29] alfiemax: has joined #ruby
[16:36:37] Axsuul: has joined #ruby
[16:37:41] randomstrangerb: has joined #ruby
[16:40:16] hays_: what is the shortest way to create an Exception class? I want to do it at the begginning of my class definition and its just derived from standarderror. Do I need two lines to do this?
[16:40:43] hays_: RIght now all I am using this for is to give the exception a different name, so that I can identify it as a unique error
[16:41:42] hays_: class Foo < StandardException / end is the shortest I've found today, but I could have sworn there was a one-liner
[16:42:25] canton7: class Foo < StandardException; end
[16:42:29] synthroid: has joined #ruby
[16:42:37] [Butch]: has joined #ruby
[16:43:18] nadir: has joined #ruby
[16:45:02] hays_: I think this is what I'd seen: FailedReset = Class.new(NoMethodError)
[16:46:25] hays_: is that just different syntax for the same thing?
[16:48:22] leah2: is there a ruby ORM library which maps to plain old ruby objects (i.e. doensn't make them inherit some active record thingy), i'm thinking of something like Yesod.Persistent
[16:48:41] l_tonz: has joined #ruby
[16:48:44] tAn: has joined #ruby
[16:52:27] canton7: yes, and there's DataMapper (you need an include though), but I'm not sure if that's still in fashion
[16:52:50] leah2: last release 2011, hmm :P
[16:52:57] jtdoncas: has joined #ruby
[16:53:26] AndroUser2: has joined #ruby
[16:53:52] leah2: i guess everone not using AR uses sequel now
[16:53:54] canton7: shows how long it's been since I last did databasey stuff in Ruby :P
[16:54:02] canton7: aah I forgot about Sequel, yes
[16:54:59] leah2: hm, there is ROM too
[16:55:16] cdg: has joined #ruby
[16:56:16] l_tonz: has joined #ruby
[16:57:16] cdg__: has joined #ruby
[16:58:06] drewmcmillan: has joined #ruby
[17:02:03] d^sh: has joined #ruby
[17:02:15] troys: has joined #ruby
[17:03:03] phaul: has joined #ruby
[17:03:19] sanscoeur: has joined #ruby
[17:05:27] l_tonz: has joined #ruby
[17:06:15] Immune: has joined #ruby
[17:06:55] biberu: has joined #ruby
[17:07:51] bronson: has joined #ruby
[17:08:50] johno84: has joined #ruby
[17:12:20] rabajaj: has joined #ruby
[17:17:22] JusticeFries: has joined #ruby
[17:19:17] c_nick: has joined #ruby
[17:19:45] tAn: has joined #ruby
[17:25:42] lacour: has joined #ruby
[17:26:25] uZiel: has joined #ruby
[17:28:33] darkhanb: has joined #ruby
[17:30:17] jtdoncas: has joined #ruby
[17:34:55] alfiemax: has joined #ruby
[17:37:08] cloaked1: has joined #ruby
[17:37:33] cdg: has joined #ruby
[17:38:12] orbyt_: has joined #ruby
[17:38:14] randomstrangerb: has joined #ruby
[17:40:52] modin: has joined #ruby
[17:42:05] dinfuehr: has joined #ruby
[17:42:59] uZiel: has joined #ruby
[17:42:59] plexigras: has joined #ruby
[17:44:36] BTRE: has joined #ruby
[17:46:01] jottr: has joined #ruby
[17:46:47] Vapez: has joined #ruby
[17:47:04] hahuang65: has joined #ruby
[17:49:24] mikecmpbll: has joined #ruby
[17:49:25] Immune: has joined #ruby
[17:52:52] JusticeFries: has joined #ruby
[17:53:16] apeiros: has joined #ruby
[17:53:46] Mrgoose: has joined #ruby
[17:54:59] ramfjord: has joined #ruby
[17:56:45] [Butch]: has joined #ruby
[17:58:25] guacamole: has joined #ruby
[18:00:11] Mrgoose: has joined #ruby
[18:00:16] Troy2: has joined #ruby
[18:01:14] jtdoncas: has joined #ruby
[18:02:18] l_tonz: has joined #ruby
[18:03:28] darkhanb_: has joined #ruby
[18:06:36] DrCode: has joined #ruby
[18:09:08] SeepingN: has joined #ruby
[18:09:38] DrCode: has joined #ruby
[18:10:27] leah2: has joined #ruby
[18:12:30] mtkd: has joined #ruby
[18:13:34] plexigras: has joined #ruby
[18:17:05] l_tonz: has joined #ruby
[18:17:27] darkhanb: has joined #ruby
[18:17:36] alfiemax_: has joined #ruby
[18:19:50] claudiuinberlin: has joined #ruby
[18:21:46] eckhardt: has joined #ruby
[18:22:25] randomstrangerb: has joined #ruby
[18:22:26] tAn: has joined #ruby
[18:22:59] drewmcmillan: has joined #ruby
[18:24:09] Immune: has joined #ruby
[18:28:43] alfiemax: has joined #ruby
[18:34:25] jtdoncas: has joined #ruby
[18:35:44] dionysus69: has joined #ruby
[18:36:41] oetjenj: has joined #ruby
[18:39:40] l_tonz: has joined #ruby
[18:40:51] c_nick: has left #ruby: ("Ex-Chat")
[18:44:55] drewmcmillan: has joined #ruby
[18:45:57] guacamole: has joined #ruby
[18:49:22] darkhanb_: has joined #ruby
[18:50:28] woodruffw: has joined #ruby
[18:50:28] woodruffw: has joined #ruby
[18:51:30] gizmore|2: havenwood: an honor to re-greet you
[18:52:10] nexi: has joined #ruby
[18:53:00] gizmore: baweaver: hi
[18:53:26] baweaver: See havenwood? I get the original to say hi to me
[18:55:06] guacamole: has joined #ruby
[18:55:21] gizmore: havenwood formed me. he trained me for years to eat things you would find disgusting
[18:55:58] plexigras: has joined #ruby
[18:57:27] raynold: has joined #ruby
[19:00:09] plexigras: has joined #ruby
[19:00:23] Immune: has joined #ruby
[19:02:21] orbyt_: has joined #ruby
[19:02:30] Dimik: has joined #ruby
[19:04:57] Mrgoose2: has joined #ruby
[19:06:06] tAn: has joined #ruby
[19:07:03] jtdoncas: has joined #ruby
[19:07:52] Inoperable: has joined #ruby
[19:08:35] TomyLobo: has joined #ruby
[19:08:37] bronson: has joined #ruby
[19:09:09] govg: has joined #ruby
[19:10:41] bawNg: has joined #ruby
[19:10:48] bawNg: has joined #ruby
[19:10:48] bawNg: has joined #ruby
[19:11:25] nexi: has joined #ruby
[19:13:20] nexi: has left #ruby: ()
[19:14:59] jenrzzz: has joined #ruby
[19:14:59] jenrzzz: has joined #ruby
[19:15:51] l_tonz: has joined #ruby
[19:16:21] Hanmac: has joined #ruby
[19:16:53] jobewan: has joined #ruby
[19:17:23] jottr: has joined #ruby
[19:25:56] minimalism: has joined #ruby
[19:26:32] kies: has joined #ruby
[19:32:02] Dimik: has joined #ruby
[19:32:23] dviola: has joined #ruby
[19:34:07] Rapture: has joined #ruby
[19:35:05] nicesignal: has joined #ruby
[19:35:10] Terens: has joined #ruby
[19:35:53] Immune: has joined #ruby
[19:37:15] jenrzzz: has joined #ruby
[19:37:15] jenrzzz: has joined #ruby
[19:37:53] bawNg: does anyone know of a faster way to call a proc from a C extension? with a cached proc and interned name, rb_funcall still takes like 400 us
[19:38:42] goatish: has joined #ruby
[19:39:16] AndroUser2: has joined #ruby
[19:42:52] drewmcmillan: has joined #ruby
[19:43:26] johno84: has joined #ruby
[19:44:40] brent__: has joined #ruby
[19:44:52] jtdoncas: has joined #ruby
[19:46:16] tAn: has joined #ruby
[19:46:28] dionysus69: has joined #ruby
[19:47:11] daed: has joined #ruby
[19:49:36] mahlon: has joined #ruby
[19:52:59] jenrzzz: has joined #ruby
[19:52:59] jenrzzz: has joined #ruby
[19:56:11] orbyt_: has joined #ruby
[19:58:05] l_tonz: has joined #ruby
[19:58:17] plexigras: has joined #ruby
[20:06:33] c0ncealed: has joined #ruby
[20:08:34] Vapez: has joined #ruby
[20:09:09] elphe: has joined #ruby
[20:09:28] Sembei: has joined #ruby
[20:10:57] m0x00: has left #ruby: ("Leaving")
[20:14:54] xco: has joined #ruby
[20:17:42] mtkd: has joined #ruby
[20:18:15] jrabe: has joined #ruby
[20:18:16] jtdoncas: has joined #ruby
[20:23:12] plexigras: has joined #ruby
[20:23:46] john__: has joined #ruby
[20:24:02] sameerynho: has joined #ruby
[20:25:19] eckhardt: has joined #ruby
[20:26:30] ur5us: has joined #ruby
[20:26:53] miskatonic: has joined #ruby
[20:28:15] bmurt: has joined #ruby
[20:28:24] jeremy04: has joined #ruby
[20:29:17] sammi`: has joined #ruby
[20:31:09] Sembei: has joined #ruby
[20:40:04] tAn: has joined #ruby
[20:48:20] mikecmpbll: has joined #ruby
[20:48:33] orbyt_: has joined #ruby
[20:49:40] chocoelho: has joined #ruby
[20:52:57] troulouliou_div2: has joined #ruby
[20:53:31] pilne: has joined #ruby
[20:55:02] jenrzzz: has joined #ruby
[20:56:36] jtdoncas: has joined #ruby
[20:58:53] pastorinni: has joined #ruby
[20:59:43] pastorinni: has joined #ruby
[20:59:58] guacamole: has joined #ruby
[21:00:16] xco: has joined #ruby
[21:01:35] Pgouv_: has joined #ruby
[21:02:16] Pgouv__: has joined #ruby
[21:05:03] braderhart: has joined #ruby
[21:05:16] r3kz: has joined #ruby
[21:09:01] guacamole: has joined #ruby
[21:10:04] Sembei: has joined #ruby
[21:10:23] bronson: has joined #ruby
[21:12:22] l_tonz: has joined #ruby
[21:14:10] guacamole: has joined #ruby
[21:16:05] jenrzzz_: has joined #ruby
[21:17:40] weathermaker: has joined #ruby
[21:20:52] yeoman: thing that always bugged me
[21:21:00] yeoman: how do i read all from a socket that is there
[21:21:08] yeoman: if i do IO.select([socket])
[21:21:13] yeoman: i know i can read from that socket
[21:21:17] yeoman: but if i do socket.read
[21:21:23] yeoman: it blocks.. until? i don't know..
[21:25:15] eam: yeoman: if select returns saying it's readable then #sysread will not block
[21:25:23] guacamole: has joined #ruby
[21:26:12] eam: don't use #read or #write if you want to be particular about your i/o, as they may do i/o you don't want (or, may not do i/o that you do want) because of the buffering
[21:27:30] weathermaker: has joined #ruby
[21:29:55] Prutheus: has joined #ruby
[21:30:46] Prutheus: Hello. I need to parse a difficult string: "Building: ?????? ??????? ???? ??????Address: محيط الظريفRemark: \nمستودع للايجار محيط الظريف مساحة 300متر مع نزلة كميون ايجار شهري 1500$ للاستعلام 03124927 \\ 71127376" Need to parse the parameters Building, Address, Remark etc. Difficulty: String is not always same. Maybe Building is missing, but some Parameters more
[21:30:56] tAn: has joined #ruby
[21:31:02] Prutheus: And the parameters are directly without space behind one other, so how to split?
[21:31:37] cjohnson: prutheus: That sure sounds like a shitty format lol
[21:31:40] cjohnson: How did you end up with that?
[21:32:33] jtdoncas: has joined #ruby
[21:33:12] cjohnson: Assuming there is no end-of-value boundary, you can try using a start-of-value boundary to find the end
[21:34:07] cjohnson: So for example, come up with a list of parameters, and for each one, find Parameter:.*(?!Other|Parameters|Here)
[21:34:14] the_f0ster: has joined #ruby
[21:34:18] cjohnson: And run that regexp once per parameter
[21:34:27] cjohnson: I wouldn't just split on : since the value might contain :
[21:34:28] inoperable__: has joined #ruby
[21:34:35] the_f0ster: how I can access an instance or class variable from a module that is being extended ?
[21:36:36] Prutheus: its from taht site
[21:36:37] Prutheus: http://www.properties.com.lb/Property-Details/97683
[21:36:50] guacamole: has joined #ruby
[21:37:15] roshanavand: has joined #ruby
[21:37:32] Prutheus: cjohnson: so any better idea maybe? becasue that is very difficult
[21:37:53] dave_den: has joined #ruby
[21:38:27] dave_den: anyone know how the _default_ compile flags for compiling native extensions are set? in particular, when '-fstack-protector' is used
[21:40:13] matled: has joined #ruby
[21:41:10] cjohnson: prutheus: Oh...well you have HTML. that makes this much easier
[21:41:13] cjohnson: You didn't paste the html here
[21:41:19] cjohnson: Just use a DOM lib
[21:41:32] Prutheus: I use currently nokogiri
[21:41:43] Prutheus: but that html ... is still just a p block
[21:42:11] cjohnson: No it's not, inside that p block the title is wrapped in a <b>
[21:42:20] cjohnson: and the values are separated by <br>
[21:42:30] cjohnson: So you can just find the TextNode following the appropriate <b> that you want
[21:42:34] Prutheus: you think so, but now take that one
[21:42:41] Prutheus: http://www.properties.com.lb/Property-Details/97704
[21:42:47] Prutheus: the remark is f*cked up
[21:42:52] plexigras: has joined #ruby
[21:43:15] cjohnson: Looks the same here
[21:43:22] cjohnson: The heading is in a <b>
[21:43:27] cjohnson: And the value is in the text nodes that follow
[21:43:29] alex``: has joined #ruby
[21:43:48] Prutheus: the b's are the seperators
[21:43:50] cjohnson: You'll have to strip ": " from the beginning of the value but otherwise seems straightforward
[21:44:08] Prutheus: ill try to code that behavior
[21:44:27] cjohnson: Good luck! This is why we always suggest not scraping HTML
[21:44:41] cjohnson: You'll write this code and then tomorrow it will change and break
[21:44:45] cjohnson: or you'll get an example that fails
[21:45:13] inoperable__: has joined #ruby
[21:45:18] baweaver: welcome to htmHell
[21:45:55] baweaver: cjohnson: want a fun one to try?
[21:46:15] cjohnson: I'm going to codemash
[21:46:41] baweaver: Open challenge to the channel then, difficulty: hard
[21:46:51] baweaver: Take this site: http://www.classtab.org/
[21:47:11] baweaver: Now give me a JSON list of Composer => tabs
[21:47:22] inoperable__: has joined #ruby
[21:47:45] baweaver: such that {'Zequinha de Abreu' => ['Tico Tico']} and etc
[21:48:13] baweaver: (mind I've already written aforementioned code, just haven't put it on git yet)
[21:48:32] baweaver: the fun is that it's not semantic html and there's no real nesting
[21:48:55] baweaver: if you really want a challenge, get the meta information like LHF, MIDIs, Videos, and links as well :D
[21:49:16] baweaver: cjohnson: that's how you give Nokogiri one heck of a workout
[21:49:25] matchaw: has joined #ruby
[21:50:33] baweaver: havenwood: if you want a hard one ^
[21:52:50] drewmcmillan: has joined #ruby
[21:53:15] guacamole: has joined #ruby
[21:54:19] baweaver: Also an easier one-liner challenge: Take a string like 'aaaaaabbbcccccddd' and compact it to 'a6b3c5d3'
[21:54:56] cjohnson: def foo(input) 'a6b3c5d3' end
[21:55:04] cjohnson: foo('aaaaaabbbcccccddd')
[21:55:12] cjohnson: ACTION mic drop
[21:56:39] plexigras: has joined #ruby
[21:57:28] elphe: has joined #ruby
[21:58:49] cdg: has joined #ruby
[21:59:06] jtdoncas: has joined #ruby
[21:59:37] marr: has joined #ruby
[22:01:22] guacamole: has joined #ruby
[22:02:19] DEac-: has joined #ruby
[22:02:58] baweaver: ACTION claps
[22:03:57] weaksauce: has joined #ruby
[22:04:45] guacamole: has joined #ruby
[22:05:21] alfiemax: has joined #ruby
[22:05:30] jenrzzz: has joined #ruby
[22:05:30] jenrzzz: has joined #ruby
[22:05:34] baweaver: >> 'aaaaaabbbcccccddd'.chars.slice_when{|a,b|a!=b}.reduce(''){|s,a|s+a[0]+a.size.to_s} # Not fond of it though
[22:05:39] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[22:06:09] plexigras: has joined #ruby
[22:06:22] chocoelho: has joined #ruby
[22:06:27] baweaver: works in my REPL at least.
[22:11:59] bmurt: has joined #ruby
[22:16:37] guacamole: has joined #ruby
[22:18:13] LenPayne: has joined #ruby
[22:20:37] tomphp: has joined #ruby
[22:21:37] guacamole: has joined #ruby
[22:21:59] bmurt: has joined #ruby
[22:22:31] mtkd: has joined #ruby
[22:22:32] jenrzzz: has joined #ruby
[22:22:43] tAn: has joined #ruby
[22:23:32] tAn: has joined #ruby
[22:25:07] tAn: has joined #ruby
[22:25:41] plexigras: has joined #ruby
[22:26:15] tAn: has joined #ruby
[22:26:34] guacamole: has joined #ruby
[22:29:15] LenPayne: has joined #ruby
[22:29:41] PaulCapestany: has joined #ruby
[22:30:36] plexi: has joined #ruby
[22:31:57] tectonic: has joined #ruby
[22:35:42] hello_world: has joined #ruby
[22:39:38] mikecmpbll: has joined #ruby
[22:40:12] drewmcmillan: has joined #ruby
[22:40:42] g105b: has joined #ruby
[22:41:37] alfiemax: has joined #ruby
[22:41:54] g105b: Hi I'm trying to run gem install sass and I get this error: The last version of ffi (< 2, >= 0.5.0) to support your Ruby & RubyGems was 1.9.18. I'm running Windows 10 Pro, followed instructions on http://sass-lang.com/install "The fastest way to get Ruby on your Windows computer is to use Ruby Installer (http://rubyinstaller.org/)"
[22:43:23] Radar: g105b: is that the entirety of the error?
[22:43:58] g105b: Radar: whole error is here https://gist.github.com/g105b/23dfa50aec74901af91f086cfa63c70c
[22:44:10] g105b: Running gem install ffi -v 1.9.18 brings up the exact same message.
[22:44:11] Radar: g105b: You might be running into this: https://stackoverflow.com/questions/48171022/cannot-install-gem-ffi-windows-7-64bit
[22:45:03] g105b: Looks that way. I'm new to Ruby, so what do you think I could do to start using it?
[22:45:27] Radar: g105b: You should uninstall Ruby, then find the installer for Ruby 2.4 and install Ruby using that.
[22:46:09] havenwood: g105b: Or switch to bash on a native ubuntu kernel with WSL: https://docs.microsoft.com/en-us/windows/wsl/install-win10
[22:46:10] g105b: Oh I see RubyInstaller has back-dated versions. Thanks.
[22:46:49] havenwood: g105b: If you install WSL then you can just follow Ubuntu instructions.
[22:46:57] benjen: has joined #ruby
[22:46:59] plexi: has joined #ruby
[22:47:00] g105b: havenwood: The reason I'm here is because I'm very familiar with Linux over Windows, and turned to WSL as my security blanked, but unfortunately it isn't fit for real world use yet.
[22:47:02] havenwood: (In bash instead of PowerShell.)
[22:47:26] havenwood: g105b: I'm afraid Windows is no more fit for real world use. ;-P
[22:47:39] havenwood: g105b: gotcha
[22:47:40] g105b: I think you might be right, but somehow people insist on using it !
[22:47:51] clemens3: has joined #ruby
[22:47:55] g105b: WSL is a lie.
[22:48:04] havenwood: I got as far as Postgres, then it borked.
[22:48:27] havenwood: We were trying to update the RailsGirls curriculum for Windows and it would *really* be nice for WSL to actually work,
[22:49:17] havenwood: They may have fixed that issue? Unuse.
[22:49:45] g105b: I had to start supporting Windows, so I have forced myself to use it. WSL sounded superb, and so did Docker, but unfortunately neither are a solution just yet.
[22:50:41] bawNg: on the off chance that anyone here ever needs to reduce the overhead of calling a proc from a C extension, I got it down to around 1us by digging through the internals and using rb_vm_invoke_proc directly
[22:51:01] g105b: Sorry bawNg but that's too fast for me.
[22:53:03] havenwood: bawNg: Good question. It might be worth posing the question on the mailing list as well.
[22:53:25] havenwood: Err, I guess not a question now. You've solved it!
[22:53:28] havenwood: bawNg: Neat!
[22:53:50] bawNg: I'm prototyping a scheduler which needs to be able to fire timer callbacks as accurately as possible, getting the calling overhead down to about 1us allows the reactor thread to wake up and fire the timer with more precision than sleeping in a native ruby thread
[22:54:08] ltem: has joined #ruby
[22:54:10] g105b: havenwood: Thanks for your help, I'm up and running as I need to :)
[22:54:14] DEac-: has joined #ruby
[22:56:52] conceivably: has joined #ruby
[22:57:41] jeffreylevesque: has joined #ruby
[22:59:16] tAn: has joined #ruby
[23:02:14] conceivably: Hello, I'm writing a Ruby class that will only have one public method 'run'. How do I decide what belongs into 'initialize' and what should be done in 'run'? Both of them will be called whenever the class is used.
[23:05:14] l_tonz: has joined #ruby
[23:06:33] jenrzzz: has joined #ruby
[23:11:17] dviola: has joined #ruby
[23:11:54] bronson: has joined #ruby
[23:12:25] l_tonz: has joined #ruby
[23:15:04] cdg: has joined #ruby
[23:16:42] orbyt_: has joined #ruby
[23:16:49] Radar: conceivably: can you show us what code you have now? It'd be easier to talk to code than theoreticals.
[23:16:54] yeoman: eam: my problem wasn't the blocking
[23:17:06] yeoman: it was.. that if i don't say how much should be read
[23:17:06] eam: yeoman: ah, what's the problem?
[23:17:09] yeoman: it blocks.. for how long?
[23:17:28] yeoman: i certainly shouldn't read byte by byte, should i
[23:17:39] eam: I would characterize that as having a problem with the blocking :)
[23:17:52] yeoman: ewll.. what does sysread do? raise?
[23:18:03] eam: so first lemmie talk about read
[23:18:14] yeoman: this is not really ruby specific i always wondered about that
[23:18:18] eam: #read is going to make zero or more system calls to read(2)
[23:18:33] eam: and if you give it no size it will read it all
[23:18:40] eam: which means blocking until the connection is closed
[23:18:55] yeoman: even a flush doesn't unblock it?
[23:19:06] yeoman: so how do people do it.. generally.. i mean
[23:19:13] eam: so fd.read() literally means read everything
[23:19:22] yeoman: let's say i read 400 bytes
[23:19:28] GremL1N2: has joined #ruby
[23:19:31] yeoman: client sends 399 and that's the last thing he sends
[23:19:41] eam: fd = open "foo.iso"; buf = fd.read # you're asking to read a few gigs into buf
[23:19:54] yeoman: i think the message should be 400 bytes long.. but client things it's 399
[23:20:02] mahlon: has joined #ruby
[23:20:08] yeoman: how do people fix that problem?
[23:20:11] eam: fd.read is really a big while loop that makes lots of smaller calls to read(2) until nothing more can be read
[23:20:17] eam: does that make sense?
[23:20:25] yeoman: yeah.. well.. how do i read everything that is there?
[23:21:05] eam: so generally when you're using select() to multiplex i/o to sockets (and or do other things in the meantime) you're going to want to construct a state machine that looks like
[23:21:12] conceivably: Radar: Well there is almost no code to show yet, since I was trying to decide where to start putting it (but perhaps this is the wrong approach?). The class is a 'Report' that is initialized with some input, grabs some things from a database, makes an api call, and finally produces a more or less deeply nested hash as a result of calling run. So it seesm to me that constructing the hash should go into 'run'. But what about retrieving
[23:21:12] conceivably: things from the database and the api?
[23:21:32] eam: 1) is it ready for some amount of i/o 2) do as much i/o as you can, saving the result in a buffer 3) goto 1
[23:21:49] yeoman: yeah well
[23:21:54] yeoman: step 2 is the thing that bugs me
[23:22:01] eam: ok so how to do #2
[23:22:06] eam: fd.sysread 4096
[23:22:11] eam: read up to 4k
[23:22:23] yeoman: yeah.. well, what if client sends 4095
[23:22:24] eam: if there's more than 4k, that's fine, you loop back around to select and it returns right away
[23:22:40] eam: yeoman: that is fine, fd.read 4096 will return *up to* 4k
[23:22:45] eam: if there's one byte on the wire, you get one byte
[23:22:50] yeoman: oh.. that's where my misunderstanding was
[23:22:50] eam: and it tells you how many bytes you read
[23:22:51] BTRE: has joined #ruby
[23:22:54] eam: yeah no prob
[23:22:56] yeoman: then i don't have problems
[23:23:14] yeoman: confusing that it's reading it all without params
[23:23:15] eam: you should read up on what else it can return, if select says ready and you read zero bytes, that means EOF
[23:23:33] eam: and various other exceptions or return codes can matter as well
[23:23:37] yeoman: good to know, thanks
[23:23:55] yeoman: heading to bed, thanks alot
[23:24:01] yeoman: eam: i've never seen you around here
[23:24:02] yeoman: who are you?
[23:24:08] eam: I am ... me!
[23:24:16] eam: I'm around sometimes
[23:24:20] yeoman: i really wanna know~
[23:24:23] yeoman: who who, who whoi
[23:24:27] yeoman: or something like that.
[23:24:31] eam: I love that song
[23:24:56] yeoman: i've been here alot, weird that i can't recall your nick
[23:25:00] yeoman: maybe it's a timezone thing
[23:25:03] yeoman: are you us?
[23:27:03] Radar: conceivably: The question you should be asking is: should the retrieving of the data be done when the object is initialized, or when the "run" method is called?
[23:27:04] elphe: has joined #ruby
[23:27:11] Radar: conceivably: I think when the run method is called.
[23:27:12] milardovich: has joined #ruby
[23:27:41] cdg: has joined #ruby
[23:28:01] eam: yeah I'm in California
[23:29:33] yeoman: eam: how do people write multi client servers with IO.select in ruby?
[23:29:58] PaulCapestany: has joined #ruby
[23:30:05] yeoman: i have a Thread that does accepting and selecting and puts them into a hash in a class
[23:32:56] guacamole: has joined #ruby
[23:37:39] solocshaw: has joined #ruby
[23:40:24] eam: yeoman: you can either multiplex within a single thread, or do a thread-per-connection model
[23:40:39] eam: (or some hybrid variation thereof when you get very high performance)
[23:41:54] eam: I have a kinda simple example of multiplexing multiple connections here, if you wanna take a look. It's very much *not* abstracted so hopefully it's sort of easy to piece apart https://github.com/square/mssh/blob/master/lib/mcmd.rb
[23:42:16] eam: it's somewhat of a mess, this was one of the first things I wrote when I came back to ruby after about a decade away from it
[23:43:00] eam: in this case it's multiplexing pipes to subprocesses, but the mechanism is more or less the same
[23:45:26] alfiemax: has joined #ruby
[23:51:53] kobain: has joined #ruby
[23:52:07] plexi: has joined #ruby
[23:53:37] conceivably: has joined #ruby
[23:54:10] kke: has joined #ruby
[23:54:41] Scient: has joined #ruby
[23:55:35] tcopeland: has joined #ruby
[23:56:48] mozzarella: >> 'aaaaaabbbcccccddd'.gsub(/(.)\1*/) {|s| s[0] + s.size.to_s }
[23:56:48] johno84: has joined #ruby
[23:56:49] ruby[bot]: mozzarella: # => "a6b3c5d3" (https://eval.in/933241)
[23:57:39] baweaver: mozzarella: you're hired.
[23:58:05] PaulCapestany: has joined #ruby