« Back to channel list

#ruby - 09 March 2017

« Back 1 day Forward 1 day »
[00:00:32] Derperperd: has joined #ruby
[00:02:15] benlieb: has joined #ruby
[00:04:11] statelesscode: has joined #ruby
[00:06:35] Silthias: has joined #ruby
[00:06:54] cschneid_: has joined #ruby
[00:09:11] polyidus: has joined #ruby
[00:09:12] allisio: has joined #ruby
[00:11:54] duderono_: has joined #ruby
[00:16:04] oetjenj: has joined #ruby
[00:19:28] zapata: has joined #ruby
[00:20:11] JeanCarloMachado: has joined #ruby
[00:20:11] Pisuke: has joined #ruby
[00:20:18] rhyselsmore: has joined #ruby
[00:20:40] rhyselsmore: Anyone ever encountered memory leaks using DateTime.parse?
[00:21:27] marchelzo: rhyselsmore: no, can u tell me about it?
[00:23:55] rhyselsmore: marchelzo: I think it was my bad with heap tracing. I'm just trying something else that is more likely to be the culprit
[00:24:20] marchelzo: rhyselsmore: ok keep us posted
[00:25:04] ramfjord: has joined #ruby
[00:26:30] segmond: has joined #ruby
[00:26:40] enterprisey: has joined #ruby
[00:26:48] sid_fules: has joined #ruby
[00:30:04] hahuang65: has joined #ruby
[00:35:18] Derperperd: has joined #ruby
[00:35:35] segmond: has joined #ruby
[00:38:12] banisterfiend: has joined #ruby
[00:39:25] segmond: has joined #ruby
[00:39:32] JeanCarloMachado: has joined #ruby
[00:39:33] jhack: has joined #ruby
[00:39:56] polyidus: has joined #ruby
[00:41:10] jhack: Getting a error message trying to run my rails server (I think it has to do with LibSSL) https://gist.github.com/jhack32/8cc9d738857622b2c3419c2972e35419
[00:45:06] marchelzo: jhack: cool
[00:45:18] jhack: Does anyone know why?
[00:45:24] jhack: or how to fix this issue
[00:46:11] SteenJobs: has joined #ruby
[00:48:17] __Yiota: has joined #ruby
[00:48:35] brent__: has joined #ruby
[00:50:26] polyidus: has joined #ruby
[00:50:36] cschneid_: has joined #ruby
[00:53:46] choke: has joined #ruby
[00:55:06] Nicmavr: has joined #ruby
[00:55:50] Guest83939: has joined #ruby
[00:57:32] sid_fules: has joined #ruby
[00:57:48] Channel6: has joined #ruby
[01:01:12] ramfjord_: has joined #ruby
[01:09:26] polyidus: has joined #ruby
[01:13:17] Trynemjoel: has joined #ruby
[01:13:22] SteenJobs: has joined #ruby
[01:13:23] polyidus: has joined #ruby
[01:16:26] pawnbox: has joined #ruby
[01:17:07] ncthom91: has joined #ruby
[01:17:19] cibs: has joined #ruby
[01:19:49] cfec0b8d: has joined #ruby
[01:20:47] polyidus: has joined #ruby
[01:21:44] jenrzzz: has joined #ruby
[01:21:44] jenrzzz: has joined #ruby
[01:24:05] hutch34: has joined #ruby
[01:26:45] polyidus: has joined #ruby
[01:28:18] sid_fules: has joined #ruby
[01:30:03] MrBusiness: has joined #ruby
[01:35:06] mikeiniowa: has joined #ruby
[01:36:12] polyidus: has joined #ruby
[01:37:42] safetypin: has joined #ruby
[01:41:26] cseder: has joined #ruby
[01:41:30] hotpancakes: has joined #ruby
[01:42:47] gusrub: has joined #ruby
[01:44:20] im314ous: has joined #ruby
[01:45:16] ramfjord: has joined #ruby
[01:45:32] PaulCapestany: has joined #ruby
[01:46:08] pawnbox: has joined #ruby
[01:48:54] polyidus: has joined #ruby
[01:49:22] pwnd_nsfw`: has joined #ruby
[01:51:58] polyidus: has joined #ruby
[01:52:26] planigan: has joined #ruby
[01:53:11] Tau: has joined #ruby
[01:53:41] polyidus: has joined #ruby
[01:54:51] Jameser: has joined #ruby
[01:57:05] safetypin: has joined #ruby
[01:58:18] jhack: has joined #ruby
[01:59:03] sid_fules: has joined #ruby
[01:59:23] safetypin: has joined #ruby
[02:00:23] harfangk: has joined #ruby
[02:01:19] postmodern: has joined #ruby
[02:02:47] hutch34: has joined #ruby
[02:04:02] znz_jp: has joined #ruby
[02:04:59] BiHi: has joined #ruby
[02:09:19] brent__: has joined #ruby
[02:13:17] marchelzo: when you want a set, do you just use Hash?
[02:19:00] mula: has joined #ruby
[02:20:21] AndrewIsHere: has joined #ruby
[02:20:26] aibot: has joined #ruby
[02:21:19] amclain: has joined #ruby
[02:21:27] BiHi: marchelzo: require 'set'; Set.new
[02:21:48] marchelzo: bihi: is that a gem or in the standard library
[02:22:08] marchelzo: bihi: god bless u
[02:22:18] BiHi: http://ruby-doc.org/stdlib-2.4.0/libdoc/set/rdoc/index.html
[02:22:28] BiHi: my pleasure
[02:23:13] BiHi: but you're right, a Hash is enough, that's actually what Set is using https://github.com/ruby/ruby/blob/trunk/lib/set.rb#L84
[02:25:22] Suslov: has joined #ruby
[02:26:15] amclain_: has joined #ruby
[02:26:34] KicStart: has left #ruby: ()
[02:29:14] Azure: has joined #ruby
[02:29:47] sid_fules: has joined #ruby
[02:30:12] d^sh: has joined #ruby
[02:32:17] polyidus: has joined #ruby
[02:32:57] StevenStulu: has joined #ruby
[02:39:56] bmurt: has joined #ruby
[02:40:57] benlieb: has joined #ruby
[02:41:51] GSilva: has joined #ruby
[02:42:38] brent__: has joined #ruby
[02:47:06] jdm: has joined #ruby
[02:50:27] dstrunk: has joined #ruby
[02:51:55] pabloh: has joined #ruby
[02:52:11] SteenJobs: has joined #ruby
[02:55:50] itsautomatisch: has joined #ruby
[02:58:38] marcdel: has joined #ruby
[03:00:39] manjaro-kde5--: has joined #ruby
[03:02:35] polyidus: has joined #ruby
[03:02:50] nowhere_man: has joined #ruby
[03:04:37] libastral: has joined #ruby
[03:06:08] nOwz: has joined #ruby
[03:08:19] hutch34: has joined #ruby
[03:10:05] Channel6: has joined #ruby
[03:10:16] montanonic: has joined #ruby
[03:11:03] LBRapid: has joined #ruby
[03:13:22] Suslov: has joined #ruby
[03:15:34] Tempesta: has joined #ruby
[03:15:56] sid_fules: has joined #ruby
[03:21:22] nowhere_man: has joined #ruby
[03:21:45] duderonomy: has joined #ruby
[03:21:47] astrobunny: has joined #ruby
[03:25:16] marcdel: has joined #ruby
[03:25:32] pawnbox: has joined #ruby
[03:30:56] pwnd_nsfw`: has joined #ruby
[03:31:40] jgnagy: has joined #ruby
[03:32:03] bmurt: has joined #ruby
[03:33:47] Suslov: has joined #ruby
[03:34:25] brendan-: has joined #ruby
[03:35:35] maloik56: has joined #ruby
[03:35:37] enterprisey: has joined #ruby
[03:35:40] Suslo: has joined #ruby
[03:41:44] howdoi: has joined #ruby
[03:45:22] jeyraof^mbpr: has joined #ruby
[03:46:03] cdg: has joined #ruby
[03:46:30] bkxd: has joined #ruby
[03:46:40] sid_fules: has joined #ruby
[03:48:01] ResidentBiscuit: has joined #ruby
[03:52:14] Derperperd: has joined #ruby
[03:52:36] djbkd: has joined #ruby
[03:55:33] pawnbox: has joined #ruby
[04:00:17] skang: has joined #ruby
[04:02:25] cdg_: has joined #ruby
[04:05:12] pulkit4tech: has joined #ruby
[04:06:36] raspado: has joined #ruby
[04:06:44] bg: hi skang
[04:07:44] blackwind_123: has joined #ruby
[04:08:24] skweek: has joined #ruby
[04:08:38] hutch34: has joined #ruby
[04:11:14] jenrzzz: has joined #ruby
[04:11:36] herbmillerjr: has joined #ruby
[04:11:37] rhyselsmore: has joined #ruby
[04:17:02] djbkd: has joined #ruby
[04:17:23] sid_fules: has joined #ruby
[04:23:35] electrostat: has joined #ruby
[04:28:09] Jameser`: has joined #ruby
[04:29:03] ResidentBiscuit: has joined #ruby
[04:31:56] Suslov: has joined #ruby
[04:36:43] VladGh: has joined #ruby
[04:38:22] gix: has joined #ruby
[04:41:28] [reed]: has joined #ruby
[04:41:28] [reed]: has joined #ruby
[04:42:25] pawnbox: has joined #ruby
[04:48:03] JoshS: has joined #ruby
[04:48:10] sid_fules: has joined #ruby
[04:52:12] govg: has joined #ruby
[04:54:44] skang_: has joined #ruby
[04:55:32] __Yiota: has joined #ruby
[04:56:43] enterprisey: has joined #ruby
[04:59:20] pwnd_nsfw: has joined #ruby
[05:02:54] montanonic: has joined #ruby
[05:03:08] mula: has joined #ruby
[05:04:48] boog: has joined #ruby
[05:05:47] Pisuke: has joined #ruby
[05:07:00] nOwz: has joined #ruby
[05:09:34] hutch34: has joined #ruby
[05:09:39] astrobunny: has joined #ruby
[05:09:50] weaksauce: has joined #ruby
[05:12:01] tvw: has joined #ruby
[05:12:37] aryaching: has joined #ruby
[05:13:41] DTZOZU: has joined #ruby
[05:14:25] pawnbox_: has joined #ruby
[05:14:39] hotpancakes: has joined #ruby
[05:16:47] morfin: has joined #ruby
[05:17:58] ThereIsNoYeti: has joined #ruby
[05:18:58] sid_fules: has joined #ruby
[05:20:23] djbkd: has joined #ruby
[05:22:35] igniting: has joined #ruby
[05:27:36] morfin: how instance_eval is implemented?
[05:29:30] jenrzzz: has joined #ruby
[05:29:31] jenrzzz: has joined #ruby
[05:29:42] matthewd: morfin: What do you mean?
[05:30:39] skang: has joined #ruby
[05:32:08] morfin: i mean does it create method on that object?
[05:33:43] morfin: I know it set self but not sure how
[05:36:33] aupadhye: has joined #ruby
[05:39:49] matthewd: It exists inside the interpreter; how it does it is no more interesting than how self gets set when you call a method on one object from another
[05:40:31] ThereIsNoYeti: has joined #ruby
[05:41:29] rkazak_: has joined #ruby
[05:41:30] morfin: well as i know JS MyClass.mymethod.bind(instanceofmyclass) create special "native" wrapper
[05:42:20] renchan: has joined #ruby
[05:42:48] auzty: has joined #ruby
[05:42:57] matthewd: How does (JS) mymethod.call(myinstance) work?
[05:44:58] morfin: hm it do same thing as bind + call that thing?
[05:46:19] elifoster: has joined #ruby
[05:47:02] hotpanca_: has joined #ruby
[05:48:44] anisha: has joined #ruby
[05:49:43] sid_fules: has joined #ruby
[05:50:35] lenwood: has joined #ruby
[05:56:06] morfin: apply do similar thing
[05:58:19] matthewd: Right. And instance_eval in ruby works the same way. Just like those JS ones, it's a built-in native thing.
[05:59:16] boog: has joined #ruby
[05:59:59] boog: has joined #ruby
[06:00:01] aupadhye: has joined #ruby
[06:01:31] noobcake: has joined #ruby
[06:04:06] morfin: but instance_eval also allows execution of block in context of an object
[06:04:55] dminuoso: 06:50 < matthewd> [05:42:56] How does (JS) mymethod.call(myinstance) work?
[06:04:56] dminuoso: just like that
[06:05:01] pawnbox: has joined #ruby
[06:05:37] squ: has joined #ruby
[06:10:41] Immune: has joined #ruby
[06:10:53] hutch34: has joined #ruby
[06:13:44] barnett: has joined #ruby
[06:16:05] pawnbox: has joined #ruby
[06:17:16] jenrzzz: has joined #ruby
[06:17:38] Guest65382: has joined #ruby
[06:20:05] tildes: has joined #ruby
[06:20:19] Cohedrin: has joined #ruby
[06:23:28] Guest65382: 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")
[06:25:30] Silthias1: has joined #ruby
[06:27:19] ghoti: has joined #ruby
[06:33:53] bocaneri: has joined #ruby
[06:34:14] tystr: has joined #ruby
[06:34:41] dikaio: has joined #ruby
[06:34:58] hahuang65: has joined #ruby
[06:35:09] havenwood: has joined #ruby
[06:35:09] havenwood: has joined #ruby
[06:35:32] pragmatism: has joined #ruby
[06:36:02] xall: has joined #ruby
[06:36:46] aaronm04: has joined #ruby
[06:38:19] bocaneri: has joined #ruby
[06:38:38] govg: has joined #ruby
[06:47:24] CloCkWeRX: has joined #ruby
[06:51:25] ThereIsNoYeti: has joined #ruby
[06:53:05] last_staff: has joined #ruby
[07:02:02] hotpancakes: has joined #ruby
[07:02:25] Suslov: has joined #ruby
[07:07:32] nOwz: has joined #ruby
[07:07:34] deweysdecimal: has joined #ruby
[07:07:37] byte512: has joined #ruby
[07:07:51] pawnbox: has joined #ruby
[07:09:40] naftilos76: has joined #ruby
[07:11:20] hutch34: has joined #ruby
[07:17:47] morfin: blocks are not even functions
[07:17:57] tildes: has joined #ruby
[07:18:59] DaniG2k: has joined #ruby
[07:20:45] matthewd: morfin: Okay, here you go: https://github.com/ruby/ruby/blob/22d842ded0109fdcc4961a81db2d7557dc3e76ef/vm_eval.c#L1716
[07:20:49] djbkd: has joined #ruby
[07:21:14] morfin: but still can do myobject.instance_eval do ... end
[07:23:37] bear13yte: has joined #ruby
[07:24:02] justinmcp: has joined #ruby
[07:24:04] charliesome: has joined #ruby
[07:24:23] ahuman: has joined #ruby
[07:24:23] gbailey: has joined #ruby
[07:26:42] nOwz: has joined #ruby
[07:26:56] Voxxit: has joined #ruby
[07:29:25] xall: has joined #ruby
[07:31:11] morfin: interseting
[07:32:28] ledestin: has joined #ruby
[07:33:34] xall: has joined #ruby
[07:35:03] conta: has joined #ruby
[07:35:25] manjaro-kde5--: has joined #ruby
[07:36:14] norbertka: has joined #ruby
[07:37:05] morfin: typedef VALUE (*vm_call_handler)(struct rb_thread_struct *th, struct rb_control_frame_struct *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc);
[07:37:44] tonini: has joined #ruby
[07:39:57] patarr: has joined #ruby
[07:40:01] Arpanet69: has joined #ruby
[07:40:41] certainty: has joined #ruby
[07:40:41] jgnagy: has joined #ruby
[07:40:59] conta: has joined #ruby
[07:44:17] morfin: and VALUE is uintptr_t so you literally pass it around?
[07:44:32] knight_: has joined #ruby
[07:44:37] dminuoso: morfin: C++ gotten too boring?
[07:44:40] dminuoso: morfin: and yes.
[07:45:02] pulkit4tech: has joined #ruby
[07:45:04] morfin: no, still reading something about C++ stuff
[07:45:19] morfin: but at work we use Ruby and PHP(hate it)
[07:45:26] ekem: has joined #ruby
[07:46:52] dminuoso: morfin: essentially the idea is that (void *) is passed around left and right, and it's the callees responsibility to treat it correctly
[07:50:27] solocshaw: has joined #ruby
[07:51:18] djbkd: has joined #ruby
[07:53:51] rhyselsmore: has joined #ruby
[07:54:40] andikr: has joined #ruby
[08:01:23] morfin: i see usage depends on context - somewhere it's self, somewhere that function pointer
[08:02:04] aganov: has joined #ruby
[08:02:42] okdas: has joined #ruby
[08:02:42] okdas: has joined #ruby
[08:03:13] nocco: has joined #ruby
[08:06:35] morfin: dminuoso, C++ is bottomless pit
[08:07:10] zenguy_pc: has joined #ruby
[08:08:22] xall: has joined #ruby
[08:09:24] hotpancakes: has joined #ruby
[08:10:20] aufi: has joined #ruby
[08:12:08] hutch34: has joined #ruby
[08:12:33] dionysus69: has joined #ruby
[08:14:37] Suslov: has joined #ruby
[08:16:37] TomyWork: has joined #ruby
[08:17:58] brainslug: has joined #ruby
[08:19:16] okdas: has joined #ruby
[08:19:17] okdas: has joined #ruby
[08:20:42] KnownSyntax: has joined #ruby
[08:22:18] zenguy_pc: has joined #ruby
[08:22:47] xall: has joined #ruby
[08:25:02] certainty: has joined #ruby
[08:25:04] xcesariox: has joined #ruby
[08:26:08] bruce_lee: has joined #ruby
[08:27:45] tAn: has joined #ruby
[08:31:30] mark_66: has joined #ruby
[08:34:29] tildes: has joined #ruby
[08:34:33] antgel: has joined #ruby
[08:35:03] bearbyte: has joined #ruby
[08:35:09] pwnd_nsfw`: has joined #ruby
[08:38:56] nettoweb: has joined #ruby
[08:41:30] evie_hammond: has joined #ruby
[08:43:51] nowhere_man: has joined #ruby
[08:46:47] Mortomes|Work: has joined #ruby
[08:47:16] xcesariox: has joined #ruby
[08:48:14] xall: has joined #ruby
[08:48:35] Polysics: has joined #ruby
[08:50:40] pawnbox: has joined #ruby
[08:51:12] teclator: has joined #ruby
[08:51:14] okdas: has joined #ruby
[08:51:14] okdas: has joined #ruby
[08:53:28] Arpanet69: has joined #ruby
[08:54:31] burgestrand: has joined #ruby
[08:56:43] JeanCarloMachado: has joined #ruby
[08:57:48] blaxter: has joined #ruby
[08:57:57] Silthias: has joined #ruby
[08:58:37] Silthias2: has joined #ruby
[09:01:36] nocco: has joined #ruby
[09:06:12] nofxxx: has joined #ruby
[09:08:35] burgestrand: has joined #ruby
[09:09:18] charliesome: has joined #ruby
[09:09:23] mikecmpbll: has joined #ruby
[09:10:50] jsrn_: has joined #ruby
[09:11:54] stoffus1: has joined #ruby
[09:12:50] hutch34: has joined #ruby
[09:12:55] certainty: has joined #ruby
[09:15:28] Violentr: has joined #ruby
[09:16:53] nofxx: has joined #ruby
[09:17:13] pawnbox: has joined #ruby
[09:20:35] xen0fon: has joined #ruby
[09:20:53] tomphp: has joined #ruby
[09:21:21] hotpancakes: has joined #ruby
[09:24:28] tdy: has joined #ruby
[09:26:33] pandaant: has joined #ruby
[09:27:55] lxsameer: has joined #ruby
[09:28:14] Fridtjof: has joined #ruby
[09:28:40] bear13yte: has joined #ruby
[09:29:30] ResidentBiscuit: has joined #ruby
[09:29:31] ByronJohnson: has joined #ruby
[09:34:04] tubuliferous: has joined #ruby
[09:34:50] nettoweb: has joined #ruby
[09:35:40] M107262[m]: has joined #ruby
[09:35:40] TheBrayn: has joined #ruby
[09:38:05] nobitanobi: has joined #ruby
[09:38:21] charliesome: has joined #ruby
[09:39:05] Arpanet69: has joined #ruby
[09:39:10] nOwz: has joined #ruby
[09:40:56] patarr: has joined #ruby
[09:41:28] lenwood: has joined #ruby
[09:41:36] jaruga__________: has joined #ruby
[09:46:22] ThereIsNoYeti: has joined #ruby
[09:49:39] Terens: has joined #ruby
[09:49:58] catpelts: has joined #ruby
[09:50:07] perry: has joined #ruby
[09:50:07] perry: has joined #ruby
[09:50:13] GK___1wm____SU: has joined #ruby
[09:51:48] ncopa: has joined #ruby
[09:52:19] perryh: has joined #ruby
[09:52:19] perryh: has joined #ruby
[09:53:42] dstrunk: has joined #ruby
[09:54:00] KicStart: has joined #ruby
[09:55:24] catpelts_: has joined #ruby
[09:55:28] bear13yte: has joined #ruby
[09:55:52] pawnbox: has joined #ruby
[09:59:16] Beams: has joined #ruby
[10:02:03] aganov: has joined #ruby
[10:02:10] Beams_: has joined #ruby
[10:03:09] GK___1wm____SU: has joined #ruby
[10:03:17] dstrunk: has joined #ruby
[10:06:19] pawnbox: has joined #ruby
[10:08:26] certainty: has joined #ruby
[10:08:46] sid_fules: has joined #ruby
[10:10:27] nofxx: has joined #ruby
[10:11:56] toretore: has joined #ruby
[10:12:16] pawnbox: has joined #ruby
[10:12:22] arkaros: has joined #ruby
[10:13:31] marr: has joined #ruby
[10:14:00] hutch34: has joined #ruby
[10:14:24] arkaros: hello i have a question regarding classes. I am pretty new to ruby and accessing class fields with hash syntax confuses me. So you can do both class[:field] and class.field. Are there any requirements for on the class to allow for doing the hash syntax way or is this enabled by default?
[10:15:04] dminuoso: "So you can do both class[:field] and class.field."
[10:15:06] dminuoso: arkaros: no you cannot.
[10:15:17] dminuoso: >> hash = {"a" => 1"}; puts hash.a
[10:15:18] ruby[bot]: dminuoso: # => /tmp/execpad-809aba613e87/source-809aba613e87:2: syntax error, unexpected tSTRING_BEG, expecting '}' ...check link for more (https://eval.in/751282)
[10:15:24] dminuoso: >> hash = {"a" => 1}; puts hash.a
[10:15:25] ruby[bot]: dminuoso: # => undefined method `a' for {"a"=>1}:Hash (NoMethodError) ...check link for more (https://eval.in/751283)
[10:16:00] dminuoso: arkaros: So what you are talking about must be the behavior of some specific class. What class are you using?
[10:16:41] arkaros: No i dont mean on hashes i mean classes. I know for sure this works with rails ActiveRecords. You can do both user.id and user[:id]. Is this something that they build into the ActiveRecord class?
[10:17:04] arkaros: Or is this the behavior of classes in general in ruby?
[10:17:21] dminuoso: AKPWD: No it is not. This is just ActiveRecord specific.
[10:17:23] dminuoso: arkaros: ^-
[10:17:43] dminuoso: arkaros: Mind you, that user.id and user[:id] are not exactly the same either
[10:18:04] arkaros: dminuoso: Okay so I should probably not make the hash syntax a habit then
[10:18:16] dminuoso: arkaros: You could if you wanted to, it would be more consistent even.
[10:18:50] dminuoso: arkaros: Sometimes if there's name clashes you have to do this in fact. Imagine in a column is named "class", now Ruby cannot offer you a .class method for that, because there already is one.
[10:19:07] dminuoso: So the only way to access that attribute is through [:class]
[10:20:20] arkaros: dminuoso: Do you have any idea how they made the [:field] syntax work. Did they implement a to_hash method or something?
[10:20:46] dminuoso: arkaros: Something like that. :-)
[10:20:57] Polysics_: has joined #ruby
[10:21:18] arkaros: dminuoso: Thank you for your time. Cleared things up for me :)
[10:21:19] dminuoso: arkaros: The syntax is just a regular method
[10:21:23] dminuoso: I can show you:
[10:21:47] dminuoso: >> class Foo; def [](arg); puts "heey, you called the hash syntax passing #{arg}"; end; end; obj = Foo.new; obj[:foo]
[10:21:48] ruby[bot]: dminuoso: # => heey, you called the hash syntax passing foo ...check link for more (https://eval.in/751295)
[10:22:13] dminuoso: arkaros: So in the end foo[:arg] is actually just a syntactic sugar of: foo.[](:arg)
[10:22:14] elomatreb: You can even make that method take multiple arguments, which can be really nice for some call signatures
[10:22:34] dminuoso: arkaros: so it is just a regular method like .quux, except the invocation looks a bit different
[10:23:47] dminuoso: arkaros: So you can imagine this [:field] syntax to be a better looking version of: object.getAttribute(:field)
[10:24:47] arkaros: dminuoso: Hmmm really cool. I have started to take a liking to ruby actually. Cool things like that make me happy while programming. I come from a python background but the specific micro service im working on now required parsing of the greenbutton protocol and ruby had a way more sofisticated library for that so now im doing ruby on rails for this hehe
[10:25:35] morfin: that's called indiffirent access hash as i know
[10:26:21] elomatreb: No, that's something else. HashWithIndifferentAccess was/is a crutch to allow [:key] and ["key"] to be the same
[10:26:53] dminuoso: arkaros: Note that the [] method sometimes has different meanings though.
[10:26:55] dminuoso: For example:
[10:27:00] dminuoso: >> Array[1,2,3]
[10:27:02] ruby[bot]: dminuoso: # => [1, 2, 3] (https://eval.in/751304)
[10:27:06] morfin: i forgot i saw that in Hashie::Mash or something like that
[10:27:09] teclator: has joined #ruby
[10:27:28] elomatreb: >> Hash[ [:key, "value"] ]
[10:27:29] dminuoso: (It just is a method with peculiar looks, but *most* of the time its just for a "get attribute XYZ" semantics)
[10:27:29] ruby[bot]: elomatreb: # => /tmp/execpad-02aa9f9040b1/source-02aa9f9040b1:2: warning: wrong element type Symbol at 0 (expected a ...check link for more (https://eval.in/751306)
[10:27:41] workmad3: has joined #ruby
[10:27:58] morfin: could access like myhash.foo or myhash[:foo] or myhash["foo"]
[10:28:01] cibs: has joined #ruby
[10:28:06] dminuoso: >> Hash[ [:key, "value"] ]
[10:28:07] ruby[bot]: dminuoso: # => /tmp/execpad-62add967371b/source-62add967371b:2: warning: wrong element type Symbol at 0 (expected a ...check link for more (https://eval.in/751307)
[10:28:18] elomatreb: Oh, they inner ones need to be in another array.
[10:28:22] dminuoso: elomatreb: I can reproduce that locally.
[10:28:26] elomatreb: >> Hash[ [[:key, "value"]] ]
[10:28:27] ruby[bot]: elomatreb: # => {:key=>"value"} (https://eval.in/751308)
[10:28:42] dminuoso: Oh, thats just a deprecation warning
[10:28:43] dminuoso: nevermind :)
[10:29:25] elomatreb: Anyone got any spare [/], mine just ran out think
[10:29:28] SimpleIRC_VLBcT: has joined #ruby
[10:29:48] dminuoso: elomatreb: For a Model M?
[10:29:57] catpelts: has joined #ruby
[10:30:57] elomatreb: Oh, I was just joking about the amount of nested [] in my example
[10:31:09] conta: has joined #ruby
[10:31:20] dminuoso: elomatreb: Dont worry, you're not getting pieces off my Model M.
[10:32:07] elomatreb: I'm on a clicky blue cherry keyboard currently, but I wouldn't mind getting a Model M if they weren't so damn expensive
[10:34:29] dstrunk: has joined #ruby
[10:39:45] TheBrayn: elomatreb: unicomp makes model m reproduction keyboards
[10:40:20] SimpleIRC_VLBcT: has joined #ruby
[10:54:20] jenrzzz: has joined #ruby
[10:54:20] jenrzzz: has joined #ruby
[10:55:58] biberu: has joined #ruby
[10:57:17] jamesaxl: has joined #ruby
[10:57:26] dangerousdave: has joined #ruby
[10:59:11] Bish: can i somehow have the instance variables only set by one ancestor of a class
[10:59:17] Bish: guess not.. because ruby doesn't log this internally
[10:59:27] Terens: has joined #ruby
[11:01:57] CloCkWeRX: has joined #ruby
[11:08:55] cschneid_: has joined #ruby
[11:08:57] Paraxial: has joined #ruby
[11:14:23] pawnbox: has joined #ruby
[11:14:50] hutch34: has joined #ruby
[11:16:45] gregf_: has joined #ruby
[11:16:50] gnufied: has joined #ruby
[11:17:46] ferr1: has joined #ruby
[11:22:32] Derperperd: has joined #ruby
[11:23:57] tvw: has joined #ruby
[11:25:44] pawnbox: has joined #ruby
[11:25:56] hotpancakes: has joined #ruby
[11:29:32] charliesome: has joined #ruby
[11:30:24] ResidentBiscuit: has joined #ruby
[11:32:39] Beams: has joined #ruby
[11:35:05] JeanCarloMachado: has joined #ruby
[11:35:23] dstrunk: has joined #ruby
[11:36:37] ldnunes: has joined #ruby
[11:38:57] ddffg: has joined #ruby
[11:39:01] dstrunk: has joined #ruby
[11:41:12] Silthias: has joined #ruby
[11:41:29] apeiros: Bish: indeed no, you can't, for the reason you stated
[11:41:36] jshjsh: has joined #ruby
[11:41:44] patarr: has joined #ruby
[11:46:57] ThereIsNoYeti: has joined #ruby
[11:49:20] mikeiniowa: has joined #ruby
[11:50:03] tvw: has joined #ruby
[11:52:55] dstrunk: has joined #ruby
[11:54:07] jaiks: has joined #ruby
[11:57:28] Jameser: has joined #ruby
[11:58:15] conta: has joined #ruby
[12:02:17] Beams: has joined #ruby
[12:03:21] nOwz: has joined #ruby
[12:04:27] lenwood: has joined #ruby
[12:05:33] Garo_: has joined #ruby
[12:06:07] pawnbox: has joined #ruby
[12:06:42] Garo_: I'd like to get a Hash like object which behaves just like Hash, but in addition I could directly set a value into a deep location inside hash without having to create the intermediate hashes in each level. eg. a = {}; a["foo"]["bar"]["baz"] = "test" would just work. Any tips on how to do this?
[12:07:16] Garo_: I also don't want just monkey patch this feature into Hash itself as it could cause side-effects in other places
[12:07:37] certainty: has joined #ruby
[12:10:35] millerti: has joined #ruby
[12:11:43] woeb0t: has joined #ruby
[12:15:10] d0nn1e: has joined #ruby
[12:15:27] woeb0t: has left #ruby: ("ERC (IRC client for Emacs 25.1.1)")
[12:15:34] hutch34: has joined #ruby
[12:16:22] Gayathri_: has joined #ruby
[12:17:54] Silthias1: has joined #ruby
[12:18:00] tildes: has joined #ruby
[12:20:07] morfin: i broke my SSL :)
[12:20:13] tildes: Is it possible to ask a Ruby object for a list of ancestors and mixins?
[12:20:49] morfin: i remember you could check for includes
[12:21:19] morfin: or that's not what you want?
[12:21:53] matthewd: Garo_: That's not really practical; you'd be better off defining a Hash#deep_set
[12:22:00] toretore: >> p = ->(h,k){ h[k] = Hash.new(&p) }; h = Hash.new(&p); h[:foo][:bar] = 'baz'; h
[12:22:01] ruby[bot]: toretore: # => {:foo=>{:bar=>"baz"}} (https://eval.in/751407)
[12:22:18] matthewd: tildes: Class#ancestors ?
[12:22:24] tildes: morfin: well that would check for mixins that are included :)
[12:23:15] Garo_: matthewd: hmm that's also an option. thanks for the input =)
[12:23:23] Qchmqs: has joined #ruby
[12:23:33] toretore: >> module Mod; end; class Klass < Array; include Mod; end; Klass.ancestors
[12:23:34] ruby[bot]: toretore: # => [Klass, Mod, Array, Enumerable, Object, Kernel, BasicObject] (https://eval.in/751409)
[12:23:53] matthewd: Garo_: The impracticality is in how different from Hash your object will feel, because unknown keys always return a new child "hash" instead of nil
[12:23:54] Garo_: matthewd: I was thinking creating a class based on Hash and then overwriting the [] method to return a new hash if the key is not found
[12:23:56] morfin: !included_modules
[12:24:15] Garo_: matthewd: very trye
[12:25:06] morfin: included_modules gives also modules included from includes?
[12:25:27] tildes: matthewd: thanks! that seems to give a list which contains both inherited classes and included modules
[12:25:43] Silthias: has joined #ruby
[12:26:03] RenatoSilva: has joined #ruby
[12:26:07] matthewd: Garo_: Right, you can do that as toretore did, using the builtin hash default feature.. but when I've tried, it just ended up feeling weird -- the fact you want an autovivified hash seems to correlate with wanting to be able to detect when things aren't there, and it seems you can really only get one or the other
[12:26:10] tildes: http://stackoverflow.com/questions/5197166/ruby-get-a-list-of-extended-modules here's for extended modules
[12:26:58] Garo_: matthewd: yeah. maybe I'll just refactor and write some kind of deep_set
[12:29:54] ^Denis: has joined #ruby
[12:30:16] tomphp: has joined #ruby
[12:30:53] matthewd: Garo_: https://github.com/ManageIQ/more_core_extensions/blob/master/lib/more_core_extensions/core_ext/shared/nested.rb#L62 (and friends) may be of interest
[12:32:49] esObe_: has joined #ruby
[12:35:24] catphish: has joined #ruby
[12:37:13] t-recx: has joined #ruby
[12:39:29] habitullence: has joined #ruby
[12:39:33] tvw: has joined #ruby
[12:41:03] Jameser`: has joined #ruby
[12:42:53] ddffg: has joined #ruby
[12:45:30] tildes: I'd like some Object#try style of method that would return an empty array instead of nil
[12:47:46] dminuoso: I think that the whole idea of #try is just Ruby trying desperately to hide the lack of Monads
[12:48:04] dminuoso: What do you folks think?
[12:48:51] apeiros: Garo_: write a refinement, implement it like Hash#dig/Array#dig with an additional argument (call it #bury :-p)
[12:49:33] apeiros: question is: bury(value, *path) or bury(*path, value)
[12:49:38] morfin: i am not sure when it's really required to check included modules in Ruby
[12:50:18] dminuoso: morfin: Ignore stuff like included_modules and just look at #ancestors
[12:50:35] dminuoso: morfin: #ancestors is an accurate representation of a) how it works internally and b) how Ruby behaves
[12:51:49] morfin: but why check that?
[12:53:19] certainty: has joined #ruby
[12:53:37] dminuoso: morfin: Technically Ruby has only single inheritance. It achieves the effect of composition by manipulating that inheritance chain
[12:54:11] dminuoso: i.e. class Base < Derived; include Mod; end; will actually give you an inheritance chain that looks like Derived < Mod < Base
[12:55:20] dminuoso: And even though Mod is not derived from Base, it will act like it is.
[12:55:31] morfin: hmmm magic
[12:55:32] tildes: morfin: if you want to see what any object is made of, or in which order a method will be looked up
[12:55:49] dminuoso: morfin: The real magic is Module#prepend, which is like include
[12:56:00] dminuoso: except that it does not insert the module between Derived and Base, but in front of derived
[12:56:00] pawnbox: has joined #ruby
[12:56:29] dminuoso: So: class Base < Derived; prepend Mod; end; #=> Mod < Derived < Base
[12:56:39] csk: has joined #ruby
[12:57:26] dminuoso: >> module M; end; class C; include M; end; C.new.is_a?(M)
[12:57:27] ruby[bot]: dminuoso: # => true (https://eval.in/751427)
[12:58:41] nobitanobi: has joined #ruby
[12:58:45] sleetdrop: has joined #ruby
[12:58:48] aupadhye: has joined #ruby
[12:59:02] Beams: has joined #ruby
[12:59:12] hotpancakes: has joined #ruby
[13:00:36] GinoManWorks: has joined #ruby
[13:03:44] Jameser: has joined #ruby
[13:04:46] xall: has joined #ruby
[13:05:19] lenwood: has joined #ruby
[13:06:16] morfin: too bad i don't have Ruby because broke SSL :(
[13:06:26] dminuoso: Let me guess, you're on Windows?
[13:06:39] morfin: it happened on FreeBSD :)
[13:06:53] dminuoso: It's almost the same.
[13:07:01] morfin: it's Unix )
[13:07:09] dminuoso: Close enough.
[13:08:02] morfin: that's what you get for playing with LibreSSL
[13:08:38] dminuoso: morfin: http://i.imgur.com/04Mlrwp.png << modules just get injected between two super connection of classes
[13:08:45] tyang: has joined #ruby
[13:09:31] tubuliferous: has joined #ruby
[13:09:44] dminuoso: morfin: Let me guess, are you Russian?
[13:10:11] morfin: i did not hide that
[13:10:51] morfin: i remember even told that in #c++-general :)
[13:11:24] dminuoso: That smiley you just was the hint. :)
[13:11:27] morfin: i am wondering why everybody say that Ruby is not pretty scalable
[13:12:08] shinnya: has joined #ruby
[13:12:11] TvL2386: has joined #ruby
[13:12:52] morfin: i know they love Java or even Scala but there was some high load serviceses using Ruby, Memcached, Redis etc
[13:12:54] kent\n: has joined #ruby
[13:13:56] dminuoso: morfin: Ruby has 2 main performance problems currently. A) the bytecode is not JITed (not in MRI at least), which means there's very little internal optimization happening
[13:14:24] dminuoso: morfin: And the other is the so called Global VM Lock, which basically prevents any two threads from concurrently using Ruby basically.
[13:14:49] dminuoso: morfin: JRuby addresses both however.
[13:15:08] cfec0b8d: has joined #ruby
[13:15:28] morfin: something like Python use
[13:15:34] dminuoso: morfin: The "GIL" is the old term that stems from when Ruby did not have VM.
[13:15:54] pawnbox: has joined #ruby
[13:16:20] hutch34: has joined #ruby
[13:16:21] morfin: maybe, anyway Python guys use some global lock as well so concurrent things are not so concurrent
[13:16:42] dminuoso: morfin: Multithreading mostly only brings benefits if you're using it for blocking I/O, so Ruby is just fine for writing scalable wbe servers for example.
[13:16:53] morfin: only way to has real concurrency is forking?
[13:17:13] ^Denis: has joined #ruby
[13:17:14] dminuoso: morfin: For things that contest Ruby functionality, yes.
[13:17:30] dminuoso: The second you spend time with any syscall the lock is released though.
[13:17:41] dminuoso: So there's partial applications for threads in Ruby
[13:17:48] skweek: has joined #ruby
[13:17:51] Bish: apeiros: too bad!
[13:17:52] pawnbox_: has joined #ruby
[13:17:53] dminuoso: Webservers being one of them.
[13:18:02] Silthias: has joined #ruby
[13:18:17] dminuoso: morfin: Or use JRuby.
[13:18:17] morfin: ah yes - Windows is much worse
[13:18:36] dminuoso: morfin: With JRuby you don't have either issue, but even the JIT compilation is limited unless you use jruby-truffle
[13:18:40] morfin: JRuby just make JVM instructions from Ruby code
[13:19:10] Bish: google just finds strings in a big string
[13:19:12] morfin: but what happens to exceptions?
[13:19:55] Bish: morfin: java has exceptions too, and even if it didn't, you could implement them
[13:20:16] dminuoso: morfin: So, these points are mostly just about MRI, but if you pick JRuby you can actually write fairly scalable applications.
[13:20:34] morfin: when i was playing with bytecode i saw how they are implemented in JVM - they wrap whole block in exception an then next block is "catch"
[13:20:39] dminuoso: But jruby without truffle is still not particularly fast in CPU bound applications, because the JVM cant aggressively optimize rubys dynamic features.
[13:20:57] Bish: morfin: and then you go to #ruby and ask "what happens to exceptions" :D
[13:20:58] dminuoso: and graal/truffle is still just a research project I think
[13:21:35] pawnbox: has joined #ruby
[13:23:00] morfin: Bish, i asked because don't know how they're implemented on Ruby
[13:23:07] dminuoso: morfin: http://jruby.org/bench9000/ #=> there's some benchmarks comparison all the various Ruby implementations using a comprehensive benchmark that focuses on just raw Ruby execution
[13:23:42] morfin: and JRuby can run on something like JBoss/Tomcat etc right?
[13:23:49] Silthias1: has joined #ruby
[13:23:50] morfin: i.e in Java environment
[13:24:06] morfin: *in Java environment
[13:24:27] dminuoso: 14:22 < morfin> Bish, i asked because don't know how they're implemented on Ruby
[13:24:31] dminuoso: morfin: setjmp/longjmp
[13:24:37] Qchmqs: has joined #ruby
[13:24:46] dminuoso: morfin: and superficially they are just catch/throw
[13:24:46] gnufied: has joined #ruby
[13:24:53] dminuoso: (which uses setjmp/longjmp underneath)
[13:25:00] dminuoso: morfin: You can see this fact in assembly too:
[13:25:15] dminuoso: asm>> def foo; code; rescue; puts "foo"; end
[13:25:15] ruby[bot]: dminuoso: I have disassembled your code, the result is at https://eval.in/751451
[13:25:39] dminuoso: morfin: As you can see there's catch sections as soon as there's an exception handler
[13:25:45] morfin: so big difference between perfomance of VMs
[13:25:50] Silthias: has joined #ruby
[13:25:58] dminuoso: morfin: Yes, at the cost of warmup.
[13:26:16] dminuoso: (Which is probably why JRuby hasnt gained that much traction yet)
[13:26:38] itsautomatisch: has joined #ruby
[13:26:45] conta: has joined #ruby
[13:26:52] morfin: do you remember how big warmup has LLVM?
[13:26:59] polyidus: has joined #ruby
[13:27:04] dminuoso: No, I don't do LLVM jit compilation.
[13:27:30] morfin: Facebook developed HHVM just because of long LLVM warmup times
[13:27:47] dminuoso: morfin: Ah.
[13:27:55] morfin: and they needed lower times
[13:28:00] Bish: ACTION heard llvm should be used for static code, not for jit
[13:28:12] dminuoso: Bish: Right.
[13:28:39] Silthias1: has joined #ruby
[13:28:41] morfin: but you will pay every time you compile anyway =)
[13:29:09] dminuoso: morfin: Honestly that's what we have compile farms for ;p
[13:29:10] chrisseaton: I don't think it's anything about LLVM that limits it for JIT, but it just doesn't solve the problems you have with a JIT. LLVM helps you emit great low-level code, but if you don't know what code you want to emit it won't help you do that.
[13:29:47] dminuoso: chrisseaton: I'm genuinely curious. You have a highlight on "truffle" or "graal", don't you?
[13:29:48] chrisseaton: Rubinius for example emitted LLVM pretty directly 1-for-1 from Ruby code, and LLVM is just never going to optimise that. It doesn't know enough, the code is too low level already, and it wasn't designed to do that at all.
[13:30:12] chrisseaton: Not stalking, just interested in any discussions on JITing Ruby
[13:31:34] morfin: dminuoso, mmm compile farms nice
[13:31:45] dminuoso: chrisseaton: So the issue is that a JIT compiler has to understand what the low level code means?
[13:32:09] hotpanca_: has joined #ruby
[13:32:09] dminuoso: (Which if the JIT received "random" llvm code it could not do)
[13:32:25] chrisseaton: I mean if you emit an LLVM call to malloc, and then read and write a field in that object, LLVM is never going to be able to realise it could just link the read to the write directly and never call malloc.
[13:32:43] chrisseaton: It will always just do exactly what you told it to do - call malloc - and can't make decisions to do things like remove that call
[13:33:04] nettoweb: has joined #ruby
[13:33:39] teddysmoker: has joined #ruby
[13:33:49] dminuoso: So what kind of optimizations is LLVM good for then? Is it just limited to strength reduction, register allocation, instruction scheduling, etc?
[13:34:23] chrisseaton: I wouldn't say 'just limited to' because it's still extremely good for it, but yes that's what it does
[13:34:42] chrisseaton: You need to already have optimised your language to the point where you could emit machine code yourself, and then LLVM just helps you emit good machine code
[13:35:33] chrisseaton: You can see lots of examples of people realising this - the FTL backend in Safari had a JS IR and then emitted LLVM instead of their own machine code, the MIR for Rust where before I think they just used LLVM directly, etc
[13:35:36] hotpancakes: has joined #ruby
[13:36:48] griffindy: has joined #ruby
[13:37:07] troulouliou_div2: has joined #ruby
[13:37:54] Derperperd: has joined #ruby
[13:39:26] teddysmoker: has joined #ruby
[13:40:52] morfin: as example in C/C++ compiler try to optimize code then LLVM do rest
[13:41:43] chrisseaton: C and C++ are already low level though
[13:42:01] chrisseaton: Transforming Ruby code to the point where it's like C is the problem
[13:42:37] patarr: has joined #ruby
[13:44:21] morfin: chrisseaton, but compilers still can do many things to optimize it
[13:44:39] chrisseaton: morfin: yes, and those things are in the domain where LLVM does well
[13:45:16] chrisseaton: And actually Rubinius doesn't even use LLVM for its JIT any more
[13:46:16] Bish: it doesn't`
[13:48:00] ThereIsNoYeti: has joined #ruby
[13:48:32] chrisseaton: Not for the past year or so, no
[13:48:34] pawnbox: has joined #ruby
[13:49:07] chrisseaton: They were talking about possibly using OMR (which is a tiny bit like IBM's version of something like Graal)
[13:49:47] EV3RYDAYPR0GRESS: has joined #ruby
[13:50:24] stoffus: has joined #ruby
[13:50:26] ghoti: has joined #ruby
[13:50:39] Jameser: has joined #ruby
[13:53:02] schickung: has joined #ruby
[13:53:45] xall: is it possible to catch `binding.pry` when running a local server using foreman?
[13:53:59] chouhoulis: has joined #ruby
[13:54:04] xall: as in, get into an interactive pry session
[13:55:31] anonymus: has joined #ruby
[13:55:36] patarr: has joined #ruby
[13:55:43] anonymus: please explain this
[13:55:44] anonymus: http://pastebin.com/cv3PyXMP
[13:55:44] ruby[bot]: anonymus: as I told you already, please use https://gist.github.com
[13:56:02] conta: has joined #ruby
[13:56:03] anonymus: why isn't "res" colorized ???
[13:57:17] anonymus: could anybody have a look please
[13:58:16] Jameser: has joined #ruby
[13:58:24] toretore: not unless you post somewhere other than pastebin
[13:59:25] tyang_: has joined #ruby
[13:59:33] anonymus: toretore: I cant
[13:59:56] anonymus: I do not know how
[14:00:06] dminuoso: 14:53 < xall> is it possible to catch `binding.pry` when running a local server using foreman?
[14:00:38] hutch34: has joined #ruby
[14:00:39] dminuoso: xall: I ended up replacing foreman with a simple tmux script that gave me much more sensible output and controlled stdin.
[14:00:44] toretore: anonymus: you were already told to use https://gist.github.com
[14:00:55] dminuoso: (By having the tmux script automatically draw windows for each process)
[14:00:57] anonymus: that was another anon
[14:01:10] anonymus: everybody knows!
[14:01:23] toretore: it was 6 minutes ago, directed at you
[14:01:26] antgel: has joined #ruby
[14:01:33] xall: dminuoso: it looks like pry-remote works
[14:01:41] dminuoso: xall: Indeed, that is another solution if you are happy with it.
[14:02:51] anonymus: pastebinit says unknown site
[14:03:31] yqt: has joined #ruby
[14:04:09] pawnbox: has joined #ruby
[14:04:59] esObe_: has joined #ruby
[14:08:51] bmurt: has joined #ruby
[14:12:10] polyidus: has joined #ruby
[14:15:00] tyang__: has joined #ruby
[14:15:31] anonymus: https://gist.github.com/yaatest/3d80bcc418ab9b4d564e724e44503e37 here
[14:16:28] anonymus: https://gist.github.com/yaatest/4a1c0bd2a6b261823bd2ea621080a178 this one i mean
[14:16:59] ramortegui: has joined #ruby
[14:18:09] polyidus: has joined #ruby
[14:18:16] chouhoulis: has joined #ruby
[14:18:37] twoninefive: has joined #ruby
[14:28:33] anonymus: does anyone know some ruby in this chat?
[14:29:22] certainty: has joined #ruby
[14:29:26] tobiasvl: probably everyone, but the question is who has used the colorize gem
[14:31:59] anonymus: maybe the problem is in incorrect use of Prox object
[14:32:17] anonymus: could anybody have a look?
[14:32:51] Derperperd: has joined #ruby
[14:32:55] anonymus: Im afraid my experience isn't good enough :(
[14:32:57] DLSteve: has joined #ruby
[14:33:08] matthewd: anonymus: You haven't really described what's happening or what you expect
[14:33:15] sid_fules: has joined #ruby
[14:33:34] anonymus: * pool.ntp.org:123 reachable
[14:33:37] matthewd: You're using a 3rd party gem.. are you sure you're using it correctly? What documentation are you following?
[14:33:42] anonymus: i got white output
[14:33:52] anonymus: but want red or green
[14:34:07] anonymus: green if reachable and red if not
[14:34:32] GSilva: has joined #ruby
[14:34:35] matthewd: What command line are you using to run it?
[14:34:50] matthewd: Are you sure your terminal supports ANSI color codes?
[14:35:20] anonymus: uby check_ntp.rb
[14:35:23] anonymus: ruby check_ntp.rb
[14:35:45] anonymus: if i put .green instead of colorize(col) I m getting color
[14:35:50] anonymus: correct one i mean
[14:35:53] anonymus: green or red
[14:36:39] baked__beans: has joined #ruby
[14:36:50] matthewd: Okay, that seems like useful information
[14:37:14] matthewd: So the problem is definitely specifically in how you're calling .colorize
[14:37:27] matthewd: How does your call compare to the documented usage?
[14:38:44] ahrs: has joined #ruby
[14:39:21] anonymus: if I do the same outside of Prox it works well
[14:39:43] anonymus: so I m sure I do something wrong inside Proc
[14:41:45] anonymus: printf "%-50s %30s\n", "* #{@host}:#{$port}", res.green makes green right part of the output
[14:43:25] KicStart: anonymus: This should get you started, https://gist.github.com/dsowsy/66e15af3028d549a56b71e08f16019f7
[14:46:09] Tau: has joined #ruby
[14:46:22] anonymus: KicStart: that is what I wanted to avoid
[14:47:36] matthewd: anonymus: That's calling .green, which is a different method
[14:47:54] KicStart: Cleaning it up is left as an exercise to the student. I've proven that it'll work and the correct usage of the colorize gem as matthewd was curious about.
[14:48:02] polyidus: has joined #ruby
[14:48:33] matthewd: anonymus: I'm asking you about how the .colorize method is intended to be called, and you're telling me you've already decided what the problem is
[14:48:57] cpruitt: has joined #ruby
[14:49:36] anonymus: 'qwe'.colorize('green')
[14:49:36] anonymus: => "\e[0;39;49mqwe\e[0m"
[14:49:42] sid_fules: has joined #ruby
[14:49:56] polyidus: has joined #ruby
[14:50:44] rfoust: has joined #ruby
[14:50:52] ogurk: has joined #ruby
[14:53:15] Jameser: has joined #ruby
[14:54:05] matthewd: I don't know what that is. It doesn't look like documentation.
[14:54:41] matthewd: KicStart has given you a working example, anyway
[14:54:41] anonymus: 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")
[14:55:02] synthroid: has joined #ruby
[14:55:28] govg: has joined #ruby
[14:57:07] ogurk: trying to set to array variables with ib subnets - and using IPAddr function - basically http://pastebin.com/Cp2M1Hmj
[14:57:10] ruby[bot]: ogurk: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/1c95f98520ba264356a9237720bc7fbe
[14:57:10] ruby[bot]: ogurk: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[14:57:34] ogurk: https://gist.github.com/anonymous/1c95f98520ba264356a9237720bc7fbe
[14:58:21] Takumo: has joined #ruby
[14:58:21] Takumo: has joined #ruby
[14:59:16] matthewd: ogurk: What have you tried? What problem are you running into?
[14:59:56] rippa: has joined #ruby
[15:00:10] ujjain: has joined #ruby
[15:00:10] ujjain: has joined #ruby
[15:01:43] allisio: ogurk: You realize that your desired array will contain 65,530 elements?
[15:02:36] matthewd: allisio: Network segments, not IP addresses
[15:04:57] brent__: has joined #ruby
[15:06:24] ThereIsNoYeti: has joined #ruby
[15:08:16] flying: has joined #ruby
[15:09:22] xangria: has joined #ruby
[15:09:54] xangria: has joined #ruby
[15:12:03] anonymus: has joined #ruby
[15:13:16] anonymus: guys I've found what i need
[15:13:37] SteenJobs: has joined #ruby
[15:13:46] anonymus: thanks to you
[15:14:05] ogurk: allisio basically i want to set a negative match
[15:14:31] allisio: ogurk: What's wrong with negating the result of a call to `#include?`?
[15:15:27] toretore: ogurk: your question doesn't really have anything to do with ruby, it has to do with networking and the tool you're using
[15:16:50] pawnbox: has joined #ruby
[15:17:21] matthewd: It's a perfectly ruby-solvable problem
[15:18:06] matthewd: ogurk: I can help fix an attempt at doing so; I'm not interested in just writing it for you from a problem description
[15:18:19] toretore: that depends entirely on what the actual problem is and what the desired outcome is
[15:19:15] nettoweb: has joined #ruby
[15:20:05] matthewd: Doesn't seem that ambiguous to me. But homework club is down the hall, so it also doesn't really matter.
[15:22:11] polyidus: has joined #ruby
[15:23:49] SteenJobs: has joined #ruby
[15:27:14] ^Denis: has joined #ruby
[15:28:16] __Yiota: has joined #ruby
[15:30:23] certainty: has joined #ruby
[15:30:58] ResidentBiscuit: has joined #ruby
[15:33:40] agent_white: has joined #ruby
[15:34:02] TomyLobo: has joined #ruby
[15:34:39] conta: has joined #ruby
[15:35:52] SteenJobs: has joined #ruby
[15:36:51] polyidus: has joined #ruby
[15:37:10] brent__: has joined #ruby
[15:38:19] agent_white: Mornin' folks
[15:38:52] LBRapid: has joined #ruby
[15:39:53] yusrideb: has joined #ruby
[15:40:49] palms: has joined #ruby
[15:41:49] SteenJobs: has joined #ruby
[15:42:53] pwnd_nsfw: has joined #ruby
[15:43:28] ogurk: matthewd don't ask for someone to fix this just want confirmation this is viable
[15:44:06] gizmore: has joined #ruby
[15:44:18] xzhao: has joined #ruby
[15:44:28] matthewd: ogurk: Well you actually didn't ask anything. But yes, it's computers, so it's achievable.
[15:45:02] tAn: has joined #ruby
[15:47:42] Mr_Pancake: has joined #ruby
[15:51:04] polyidus: has joined #ruby
[15:52:51] Derperperd: has joined #ruby
[15:54:39] Ruby_Rocks_007: has joined #ruby
[15:55:38] skweek: has joined #ruby
[15:55:56] SteenJobs: has joined #ruby
[15:56:09] dangerousdave: has joined #ruby
[15:58:37] Derperperd: has joined #ruby
[16:00:28] Tatey: has joined #ruby
[16:03:45] morfin: i tested prepend
[16:04:12] morfin: and Derived started calling prepended mod methods instead Oo
[16:05:13] resin: has joined #ruby
[16:05:16] allisio: As is perfectly reasonable?
[16:05:53] SteenJobs: has joined #ruby
[16:12:17] dangerousdave: has joined #ruby
[16:13:10] choke: has joined #ruby
[16:13:19] dminuoso: morfin: As I said.
[16:13:28] dminuoso: 13:56 < dminuoso> So: class Base < Derived; prepend Mod; end; #=> Mod < Derived < Base
[16:14:00] dminuoso: morfin: When you prepend, you basically say: "Despite the fact that I just create a Derived object, it's will act as if it was a Mod first, and a Derived second.
[16:14:24] SteenJobs: has joined #ruby
[16:14:40] csk: has joined #ruby
[16:15:49] Bish: has joined #ruby
[16:16:02] dminuoso: morfin: "ancestors" is the actual inheritance chain (and thus used for method dispatch), use it after you include and prepend modules into a class.
[16:16:20] nadir: has joined #ruby
[16:16:20] dminuoso: morfin: Note: there's virtually no difference between a module and a class, so you can view them as the same thing.
[16:17:00] cschneid_: has joined #ruby
[16:17:33] dminuoso: The only differences are that modules dont have .allocate and .new, and that classes can't be included/prepended/extended #=> but these restrictions are completely arbitrary.
[16:18:11] dminuoso: (i.e. you could modify the ruby interpreter to remove these restrictions and then use them completely interchangably)
[16:20:52] ozcanesen: has joined #ruby
[16:22:15] dminuoso: For example when you write: class Foo < Bar; end; it's pretty much the same as: class Foo; include Bar; end;
[16:24:10] mustmodify: has joined #ruby
[16:24:17] mustmodify: anyone know why yaml files start with three dashes?
[16:24:30] SteenJobs: has joined #ruby
[16:26:05] allisio: They don't have to, but it's because one .yml file can contain many disparate "documents".
[16:26:13] igniting: has joined #ruby
[16:26:13] allisio: And that's the separator.
[16:28:07] brent__: has joined #ruby
[16:29:15] bmurt: has joined #ruby
[16:29:30] Bish: has joined #ruby
[16:30:00] hxegon: has joined #ruby
[16:30:28] brent__: has joined #ruby
[16:30:51] BlueDragons: has joined #ruby
[16:31:49] SteenJobs: has joined #ruby
[16:33:04] Suslov: has joined #ruby
[16:35:29] bmurt: has joined #ruby
[16:36:00] BlueDragons: has joined #ruby
[16:36:29] Lord_of_Life: has joined #ruby
[16:37:40] Suslov: has joined #ruby
[16:38:20] hxegon: has joined #ruby
[16:39:18] sepp2k: has joined #ruby
[16:39:32] hxegon: has joined #ruby
[16:41:54] chopin: has joined #ruby
[16:41:55] hxegon: has joined #ruby
[16:42:40] hxegon: has joined #ruby
[16:43:00] hxegon: has joined #ruby
[16:43:10] skweeke: has joined #ruby
[16:43:34] Derperperd: has joined #ruby
[16:47:36] ThereIsNoYeti: has joined #ruby
[16:47:52] tubuliferous: has joined #ruby
[16:47:56] ThereIsNoYeti: has joined #ruby
[16:50:10] xen0fon: has joined #ruby
[16:52:23] hotpanca_: has joined #ruby
[16:55:49] cdg: has joined #ruby
[16:55:51] ferr1: has joined #ruby
[16:57:56] Gayathri_: has joined #ruby
[16:59:08] Gayathri_: has left #ruby: ()
[17:01:01] amclain: has joined #ruby
[17:03:21] szulak_: has joined #ruby
[17:04:13] s2013: has joined #ruby
[17:05:00] hyuvkr: has joined #ruby
[17:12:59] Lord_of_Life: has joined #ruby
[17:14:27] esObe_: has joined #ruby
[17:15:09] esObe__: has joined #ruby
[17:19:09] Arpanet69: has joined #ruby
[17:20:35] BackEndCoder: has joined #ruby
[17:22:24] pawnbox: has joined #ruby
[17:23:24] Derperperd: has joined #ruby
[17:26:41] nowhere_man: has joined #ruby
[17:28:31] VladGh: has joined #ruby
[17:29:23] gusrub: has joined #ruby
[17:30:13] jyaworski: has joined #ruby
[17:31:06] Cohedrin: has joined #ruby
[17:31:24] username1: has joined #ruby
[17:32:58] VladGh: has joined #ruby
[17:41:20] antoniobeyah: has joined #ruby
[17:41:37] marchelzo: has joined #ruby
[17:43:27] raspado: has joined #ruby
[17:43:47] cfec0b8d: has joined #ruby
[17:44:10] Rodya_: has joined #ruby
[17:44:20] pawnbox: has joined #ruby
[17:44:37] marchelzo: this is really scare
[17:44:39] marchelzo: http://norswap.com/ruby-dark-corners/
[17:44:57] jyaworski: has joined #ruby
[17:45:06] iceden: has joined #ruby
[17:46:10] certainty: has joined #ruby
[17:48:28] hotpanca_: has joined #ruby
[17:48:52] dionysus69: has joined #ruby
[17:49:03] pilne: has joined #ruby
[17:51:57] cibs: has joined #ruby
[17:53:33] Cohedrin: has joined #ruby
[17:53:51] Macrobiotic: has joined #ruby
[17:54:57] tildes_: has joined #ruby
[17:55:00] esObe_: has joined #ruby
[17:57:55] ahrs: has joined #ruby
[17:58:35] jyaworski: has joined #ruby
[18:00:59] Coldblackice: has joined #ruby
[18:01:51] greenbird: has joined #ruby
[18:01:56] hahuang61: has joined #ruby
[18:03:11] hooper: has joined #ruby
[18:05:09] marchelzo: leah2: i had flashbacks to C++ while reading it
[18:05:31] enterprisey: has joined #ruby
[18:05:42] leah2: except that c++ has a spec :P
[18:05:50] marchelzo: the rules for linearization, name lookup, assigning arguments to parameters are just insanely complicated
[18:06:06] leah2: yes, and you never need them for non contrived code
[18:06:20] leah2: and the parameters are quite intuitive...
[18:06:23] marchelzo: still it's worrying
[18:07:08] marchelzo: all of the complexity just lurking in the background of the language is unsettling
[18:07:21] marchelzo: i like to understand the language i'm writing in
[18:09:04] Derperperd: has joined #ruby
[18:09:33] djbkd: has joined #ruby
[18:11:01] matthewd: Seems more like complicated descriptions to me
[18:11:48] allisio: leah2: Ruby has a spec.
[18:11:54] xen0fon: has joined #ruby
[18:12:21] matthewd: It seems to be providing a fairly exhaustive exploration of how the various simple, not-complex, rules interact to produce complex-looking behaviours
[18:12:37] pawnbox: has joined #ruby
[18:12:44] montanonic: has joined #ruby
[18:13:00] marchelzo: allisio: does it? he mentioned in the article that 1.8 has a spec, but e.g., 2.4 is not specified anywhere
[18:13:06] leah2: allisio: you mean the ansi standard?
[18:13:59] Artarian: has left #ruby: ("adiosss")
[18:14:23] allisio: leah2: That's the one that's 1.8-only, but http://ruby.github.io/rubyspec.github.io/ is kept (more or less) in sync with development on trunk.
[18:14:34] leah2: that's just a random test suite tho?
[18:14:46] allisio: "Random" is a little harsh?
[18:14:56] leah2: i mean, its written after the fact
[18:15:04] leah2: by people who don't the the main interpreter?
[18:15:04] mikecmpbll: has joined #ruby
[18:15:10] leah2: correct me if i'm wrong :P
[18:15:22] marchelzo: "executable specification" is not that useful lol
[18:15:24] allisio: JRuby tries to conform to it, at any rate.
[18:15:25] matthewd: "spec" seems pretty strong
[18:15:36] SteenJobs_: has joined #ruby
[18:15:39] zeroDi: has joined #ruby
[18:16:21] ramfjord: has joined #ruby
[18:16:31] matthewd: Strictly speaking, ruby has a spec in the form of the MRI source - but that's also less than entirely helpful in practice
[18:16:54] allisio: What does "less than entirely helpful" mean?
[18:17:15] leah2: you never know if its a bug in mri or a language feature
[18:17:19] matthewd: Depends what you want the spec for
[18:17:38] matthewd: If you want to prove that a given implementation is conforming, then rubyspec can help you
[18:18:08] havenwood: leah2: CRuby incorporated a fork of RubySpec. The original RubySpec went internal to Rubinius.
[18:18:14] leah2: yeah, but if you want to be a language lawyer, you need to read the source anyway :)
[18:18:28] allisio: And so all is well.
[18:18:30] matthewd: If you want something coherent to read to better understand partially-emergent behaviours, reading rubyspec doesn't seem much easier than just reading ruby/ruby
[18:18:39] Ruby_Rocks_007: has joined #ruby
[18:18:51] marchelzo: matthewd: "[...] how the various simple, not-complex, rules interact [...]"
[18:19:01] marchelzo: they really don't seem to be simple
[18:19:07] leah2: i didnt read much mri since 1.9, but back then it was quite straight-forward to find things
[18:19:10] allisio: They're... intricate.
[18:19:19] allisio: It's still pretty straightforward.
[18:19:27] leah2: and obviously some rules are just sideeffects of implementation
[18:20:41] matthewd: The module linearization article, particularly, seemed like a lot of words (which I heavily glossed over) for an implementation that's really pretty straightforward and consistently predictable
[18:21:30] AndBobsYourUncle: has joined #ruby
[18:21:37] marchelzo: matthewd: "For seemingly no good reason, you cannot have an array decomposition parameter, a splat parameter and a keyword parameter in the same method."
[18:21:49] marchelzo: how do you explain that as an interaction of simple rules?
[18:21:53] allisio: marchelzo: Nobody uses array decomposition parameters.
[18:21:57] marchelzo: it seems like just an arbitrary limitation
[18:22:17] marchelzo: allisio: that doesn't change my concern
[18:22:31] allisio: Find your inner utilitarian.
[18:22:37] matthewd: Yeah, that sounds like an implementation quirk -- or possibly a bug
[18:22:57] allisio: It's an oversight that has no cause to be addressed.
[18:23:23] SteenJobs_: has joined #ruby
[18:23:38] gusrub: has joined #ruby
[18:23:41] matthewd: But "complexity" doesn't feel like the right way to describe it -- it's not a special rule to be remembered (as it would be if there *was* a seeming reason)
[18:24:43] allisio: marchelzo: For what it's worth, the article is flat-out lying/mistaken: https://eval.in/751655
[18:24:43] gusrub: has joined #ruby
[18:27:04] last_staff1: has joined #ruby
[18:30:09] hotpancakes: has joined #ruby
[18:30:17] duderonomy: has joined #ruby
[18:31:45] vuoto: has joined #ruby
[18:31:50] rfoust: has joined #ruby
[18:32:09] futilegames: has joined #ruby
[18:36:47] SteenJobs: has joined #ruby
[18:41:12] ddffg: has joined #ruby
[18:45:56] marxarelli: has joined #ruby
[18:51:37] RenatoSilva: has joined #ruby
[18:52:27] tubuliferous: has joined #ruby
[18:54:16] skweeke: has joined #ruby
[18:54:18] chouhoulis: has joined #ruby
[18:56:44] SteenJobs: has joined #ruby
[18:56:59] csk: has joined #ruby
[18:57:47] kirun: has joined #ruby
[18:59:11] csk: has joined #ruby
[18:59:42] chouhoul_: has joined #ruby
[19:02:21] csk: has joined #ruby
[19:02:21] aesthetik: has joined #ruby
[19:03:24] aesthetik: has joined #ruby
[19:06:58] tjvc: has joined #ruby
[19:06:58] tjvc: has joined #ruby
[19:12:46] montanonic: has joined #ruby
[19:13:59] Tau: has joined #ruby
[19:15:56] csk: has left #ruby: ()
[19:16:02] csk: has joined #ruby
[19:16:16] DominicBurford: has joined #ruby
[19:16:36] certainty: has joined #ruby
[19:17:04] tomphp: has joined #ruby
[19:17:26] GodFather: has joined #ruby
[19:18:14] Ruby_Rocks_007: has joined #ruby
[19:18:32] sid_fules: has joined #ruby
[19:19:23] DominicBurford: has left #ruby: ()
[19:23:32] marchelzo: has joined #ruby
[19:23:33] blackwind_123: has joined #ruby
[19:25:28] cek: has joined #ruby
[19:27:14] csk: has joined #ruby
[19:27:27] cek: looking for a good condition substitute for my ruby dsl proj. if?( cond ){ blk } else? { blk } sounds good but is nasty
[19:27:43] cek: ideas welcome.
[19:28:00] mustmodify: has left #ruby: ()
[19:28:07] koneko: has joined #ruby
[19:28:09] marchelzo: cek: sorry?
[19:28:15] marchelzo: what are you asking
[19:29:43] pulkit4tech: has left #ruby: ()
[19:29:56] montanonic: has joined #ruby
[19:30:55] pulkit4tech: has joined #ruby
[19:33:22] ramfjord: has joined #ruby
[19:38:02] hxegon: cek: It's a bit hard to recommend something when we don't know what the domain is. Could you elaborate?
[19:38:45] cek: looking for if else close substitute. I wish I could overload/redefine them for a given context.
[19:39:06] cek: I don't like how if requires a non brace block
[19:39:27] cek: that ruins my braced dsl methods
[19:40:43] skweeke: has joined #ruby
[19:42:26] marchelzo: cek: elaborate more
[19:42:44] marchelzo: if doesn't require a non brace block
[19:43:02] marchelzo: if isn't a method. it doesn't require a block at all.
[19:43:22] hxegon: speaking of conditionals; I present to the fine people of #ruby, This piece of code I found. I'll let you make your own conclusions: https://github.com/akretion/ooor/blob/master/lib/ooor/autosave_association.rb#L161-L194
[19:43:22] marchelzo: how does it "ruin" your "braced dsl methods"
[19:44:19] hxegon: cek: it might be best to gist us a psuedocode example for your dsl
[19:46:00] gusrub: has joined #ruby
[19:46:21] snickers: has joined #ruby
[19:46:33] hxegon: 175-187 is particularly gruesome IMO
[19:47:39] cek: he learned ruby the hard way
[19:47:59] cek: or it was a python to ruby autoconverter
[19:48:04] marchelzo: hxegon: what's so bad about it
[19:48:25] __Yiota: has joined #ruby
[19:48:44] cek: it starts with an unused local var, and continues down to epilepsy
[19:48:48] nullsign: has left #ruby: ("Leaving")
[19:49:25] hxegon: marchelzo: 175-187 is a nested conditional that basically checks the same thing for 3 different paths, and all paths do the same thing, which is run what I believe to be an ActiveRecord callback
[19:49:55] hxegon: if autosave ... > if autosave ... < elsif autosave
[19:49:57] hotpancakes: has joined #ruby
[19:50:02] marchelzo: hxegon: they don't do the same thing though
[19:50:20] marchelzo: if autosave != false is not the same as if autosave
[19:50:21] hxegon: marchelzo: ah I see that now, :create vs :update
[19:50:31] hotpancakes: has joined #ruby
[19:50:35] SeepingN: has joined #ruby
[19:51:38] hxegon: but it's the same effect because the only thing it does is run if autosave after that right?
[19:53:27] hxegon: cek: Didn't know there were python -> ruby translators, very possible since what this project deals with, OpenERP, is in python
[19:53:27] SteenJobs_: has joined #ruby
[19:53:30] AndBobsYourUncle: has joined #ruby
[19:54:07] jackjackdripper: has joined #ruby
[19:55:42] dminuoso: 20:50 < marchelzo> if autosave != false is not the same as if autosave
[19:55:46] dminuoso: marchelzo: that's what makes it so horrible
[19:56:24] chouhoulis: has joined #ruby
[19:56:36] dminuoso: This means to say: if autosave.nil? ... elsif autosave
[19:57:22] toretore: that's not the same
[19:58:31] matthewd: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/autosave_association.rb#L401-L409 😅
[19:58:55] Arpanet69: has joined #ruby
[19:59:00] matthewd: Oh, right, but these bodies have been made much more consistent
[19:59:13] toretore: what they're doing is check if options[:autosave] has been explicitly set to false
[19:59:25] dminuoso: toretore: no they dont
[19:59:31] dminuoso: toretore: they effectively test against nil? implicitly too
[19:59:43] Pumukel: has joined #ruby
[19:59:43] hxegon: matthewd: what in the...
[19:59:44] dminuoso: toretore: https://gist.github.com/dminuoso/21c04c7d9224b8392f309e087886655a
[20:00:05] dminuoso: toretore: mine.rb is the simplified version and carries the same semantics
[20:00:29] dminuoso: if autosave is false, it will return. if its nil, it will return.
[20:01:00] dminuoso: well okay, it should be next actually
[20:01:10] toretore: you are missing a record.run_callbacks(:update) {false}
[20:02:35] dminuoso: let me fix and refactor more
[20:03:39] dminuoso: toretore: refresh
[20:04:00] allisio: cek: There's simply no way to pass multiple "braced blocks" to a method, and all of the ways to "chain" Procs are fairly gruesome.
[20:04:42] dminuoso: Chaining procs is easy. just turn them into HOF and return new lambdas? :P
[20:05:19] hxegon: Trying to use procs too much kind of gets to me. They are like 0.999999 class citizens
[20:07:47] ResidentBiscuit: has joined #ruby
[20:09:59] ResidentBiscuit: I've got a vagrant box with rvm installed for my vagrant user. I like to have multiple ssh sessions so I can run a rails server, do git things, rake tests, etc all at once. Multiplexers have been not friendly towards conemu. RVM doesn't like to work very well in this situation, though. Each session seems to operate with its own gemset, bundle insta
[20:09:59] ResidentBiscuit: ll/updates will fail on all but the first session. Is there something extra I need to do to make this work?
[20:10:43] ResidentBiscuit: When working on my mac and just splitting iterm, I don't have this issue. I'm guessing it's something to do with how I'm ssh-ing into the vagrant box
[20:11:30] allisio: cek: https://eval.in/751681
[20:11:34] allisio: But, really, don't breathe this.
[20:12:00] allisio: You can do away with the parentheses on 2.4+ in case that's relevant.
[20:13:03] cek: that was the question, whether new versions have more support in regards to syntax mangling
[20:13:08] pawnbox: has joined #ruby
[20:13:34] allisio: That you're unironically calling it "mangling" should give you pause.
[20:14:50] SteenJobs_: has joined #ruby
[20:19:06] gloscombe: has joined #ruby
[20:19:31] banisterfiend: has joined #ruby
[20:19:41] jenrzzz: has joined #ruby
[20:19:41] jenrzzz: has joined #ruby
[20:20:58] MasterRex: has joined #ruby
[20:21:23] MasterRex: Hi folks, can anyone explain how Bundler enforces scripts to use gems installed for a given bundle?
[20:21:24] mula: has joined #ruby
[20:21:56] MasterRex: I.e. if I `bundle install --gemfile Gemfile` and it puts a .bundle/config in place... what makes any ruby code execute respect that config?
[20:22:18] matthewd: MasterRex: It overrides rubygems internals
[20:22:29] matthewd: So, nothing unless bundler is loaded
[20:23:22] cout: cek: this is how I did something similar: https://github.com/cout/ruby-libjit/blob/master/lib/jit/function.rb
[20:23:23] MasterRex: matthewd: so as long as "bundler" is required within a project that has a sibling .bundle/config or Gemfile.lock.... it'll respect the .bundle/config ?
[20:23:50] MasterRex: I am failing to find any documentation that states how it actually works or what it enforces, just a lot of fluff
[20:24:12] hxegon: ResidentBiscuit: Just speculation, but I imagine most people here use rbenv or chruby, which might be why you aren't getting help.
[20:24:12] matthewd: "how it actually works" is documented in the implementation ¯\_(ツ)_/¯
[20:25:03] cek: cout: yeah, that's some crazy shit. I'd better stick with regular if then else drama
[20:25:12] ResidentBiscuit: hxegon: That could be, I never know which is the flavor of the month
[20:25:41] cout: cek: it's basically the same as what you wanted to do, but with an explicit receiver, so f.if instead of if?
[20:26:36] solocshaw: has joined #ruby
[20:27:35] hxegon: ResidentBiscuit: If it's not possible (or you just don't want) to switch, I'd suggest taking another crack at getting a multiplexer to work.
[20:27:44] itsautomatisch: has joined #ruby
[20:28:20] govg: has joined #ruby
[20:28:28] ResidentBiscuit: It _works_, just lots of graphical bugs with conemu
[20:28:45] ResidentBiscuit: For example, just going into vim totally breaks the status bar and screws up the cursor position in all of the panes somehow
[20:30:57] ResidentBiscuit: Maybe I'll just switch to rbenv. I've always found rvm to be easier to use, but only being able to run one shell at a time is silly
[20:31:28] hotpanca_: has joined #ruby
[20:32:22] SteenJobs_: has joined #ruby
[20:36:31] nobitanobi: has joined #ruby
[20:37:00] enterprisey: has joined #ruby
[20:37:09] tomphp: has joined #ruby
[20:38:20] xzhao: has joined #ruby
[20:39:12] SteenJobs_: has joined #ruby
[20:39:27] pawnbox: has joined #ruby
[20:42:53] ozcanesen: has joined #ruby
[20:47:03] rhyselsmore: has joined #ruby
[20:47:09] certainty: has joined #ruby
[20:47:11] bg: has joined #ruby
[20:47:38] nowhere_man: has joined #ruby
[20:48:58] __Yiota: has joined #ruby
[20:50:12] SteenJobs_: has joined #ruby
[20:51:42] hutch34: has joined #ruby
[20:51:44] montanonic: has joined #ruby
[20:52:12] nebben: has joined #ruby
[20:54:43] Rodya_: has joined #ruby
[20:55:57] ozcanesen: has joined #ruby
[20:59:19] anjen: has joined #ruby
[21:00:38] catphish: has joined #ruby
[21:01:14] SteenJobs_: has joined #ruby
[21:03:24] loechel: has joined #ruby
[21:05:54] szulak: has joined #ruby
[21:06:08] jenrzzz: has joined #ruby
[21:06:21] hutch34: has joined #ruby
[21:07:01] SteenJobs_: has joined #ruby
[21:07:41] catpelts: has joined #ruby
[21:08:23] workmad3: has joined #ruby
[21:11:12] conta: has joined #ruby
[21:11:18] chopin: has joined #ruby
[21:14:54] fns: has joined #ruby
[21:15:13] fns: anyone running on windows, able to tell me what ENV['PATH'] looks like?
[21:15:16] chopin_: has joined #ruby
[21:17:14] Limix: has joined #ruby
[21:18:30] Limix: Hi all, anyone ever get a “Too many open files” error? Just started randomly happening after about a month of not touching the running app. Wondering if I am not properly closing a file after creating. Do I need to manually close? Currently I am just: File.delete(path)
[21:19:07] fns: that tells the OS to delete the path
[21:19:17] ElDoggo: has joined #ruby
[21:19:34] skweeke: has joined #ruby
[21:19:39] fns: i would still close the file descriptor, though i have not tested if it is necessary
[21:20:13] fns: keep in mind most OS hold files around if there is an open reference
[21:21:17] Limix: I see, thank you that must be it.
[21:23:30] Limix: How would you do the following so that it could be closed after: ERB.new(File.open("app/views/emails/#{erb}.erb").read).result(binding)
[21:23:45] Limix: Thinking this is the culprit, how would I close this?
[21:24:09] lupine: has joined #ruby
[21:25:55] Limix: Is there a way to see how many files are currently open in the ruby process? Also, how could I close all the old connections? Will a restart be the only way?
[21:27:02] ujjain: has joined #ruby
[21:27:02] ujjain: has joined #ruby
[21:28:46] fns: what OS?
[21:28:54] allisio: Limix: Just use `File.read` there.
[21:28:58] fns: i am not sure if what ruby thinks, matters
[21:29:07] fns: unix-y, try lsof
[21:30:38] Limix: allisio: so ERB.new(File.read("app/views/emails/#{erb}.erb")).result(binding) will work?
[21:31:27] SteenJobs_: has joined #ruby
[21:31:35] postmodern: has joined #ruby
[21:31:53] allisio: Limix: `File.read(foo)` is `File.open(foo).read` without the dangling descriptor, yes.
[21:32:36] dionysus69: has joined #ruby
[21:32:45] bg: does ruby have RAII
[21:32:53] catphish: has left #ruby: ("Leaving")
[21:33:16] bg: does ruby have scope-based resource management, is what i mean
[21:33:25] allisio: Not in the general case.
[21:33:28] Limix: allisio, ok cool, and I’m assuming it will handle cleanup?
[21:33:37] allisio: But, for instance, `File.open` with a block will indeed close the file once the block exits.
[21:33:55] bg: and what if the block raises an exception
[21:34:01] allisio: Bad things.
[21:34:08] allisio: For that there's `ensure`.
[21:34:14] bg: File.ensure?
[21:34:28] allisio: No, it's a keyword that forces the interpreter to execute its associated body.
[21:34:37] bg: like finally?
[21:34:43] hahuang61: has joined #ruby
[21:34:51] hxegon: has joined #ruby
[21:34:54] allisio: I think `File.open` does actually use it to ensure the file gets closed, though.
[21:35:04] bg: i would hope so
[21:35:54] bg: can i learn ruby on video
[21:36:13] bg: i love listening to videos
[21:36:14] Limix: allisio But the way I am doing it, outside a block is probably not closing it?
[21:36:15] hxegon: bg: like, by watching youtube videos?
[21:36:24] bg: hxegon: that's exactly tight
[21:36:24] allisio: Limix: Definitely not.
[21:36:39] kobain: has joined #ruby
[21:36:55] bg: exactly right*
[21:37:01] hxegon: bg: You can learn some stuff, but practice is the most important thing.
[21:37:14] bg: i mean i just want some video recommendations
[21:37:25] bg: i love listening -- hate practicing
[21:37:27] hxegon: bg: rubytapas is great, not free, but really good
[21:37:36] SteenJobs_: has joined #ruby
[21:37:49] hxegon: bg: you have to practice. Figure out something you'd find useful and build it
[21:37:52] bg: i will learn through listening only and see where that gets me
[21:38:00] bg: we'll see where things stand in a month
[21:38:11] tildes_: has joined #ruby
[21:39:15] bg: $18/month for some fucking ruby videos?
[21:39:25] hxegon: they are really good.
[21:39:37] bg: "gourmet ruby"
[21:39:45] hxegon: and that's a library of about... 400+? episodes
[21:40:11] bg: i just don't have the means right now
[21:40:14] hxegon: that go in depth, are clear and concise, well produced.
[21:40:27] hxegon: Understandable, let me see what else I can pull up from my bookmarks...
[21:44:41] tyang_: has joined #ruby
[21:44:53] synthroid: has joined #ruby
[21:46:02] hxegon: bg: Are you just starting off, do you have any previous programming experience, have you learned the basics of ruby syntax yet?
[21:46:11] nowhere_man: has joined #ruby
[21:46:23] bg: i'm very experienced
[21:46:29] bg: and i know the basics
[21:46:29] Limix: fns, thank you. When I run lsof, I get about 2000+ of:
[21:46:35] Limix: util.rb:2 32436 4504 root txt unknown /proc/32436/task/4504/exe (readlink: Permission denied)
[21:46:36] Limix: util.rb:2 32436 4504 root NOFD /proc/32436/task/4504/fd (opendir: Permission denied)
[21:46:37] Limix: util.rb:2 32436 4579 root cwd unknown /proc/32436/task/4579/cwd (readlink: Permission denied)
[21:46:37] Limix: util.rb:2 32436 4579 root rtd unknown /proc/32436/task/4579/root (readlink: Permission denied)
[21:46:45] Limix: Any idea what that stuff could be?
[21:47:29] Lord_of_Life: has joined #ruby
[21:48:17] allisio: Limix: You can filter its output to just your Ruby process's PID.
[21:49:23] allisio: And here's a demonstration of if and when Files get closed automagically: https://eval.in/751695
[21:49:24] SteenJobs_: has joined #ruby
[21:49:33] Limix: allisio, seems like there are a bunch thorugh:
[21:49:40] Limix: ruby 1347 nginx cwd unknown /proc/1347/cwd (readlink: Permission denied)
[21:49:41] Limix: ruby 1347 nginx rtd unknown /proc/1347/root (readlink: Permission denied)
[21:49:42] Limix: ruby 1347 nginx txt unknown /proc/1347/exe (readlink: Permission denied)
[21:49:44] Limix: ruby 1347 nginx NOFD /proc/1347/fd (opendir: Permission denied)
[21:49:45] Limix: ruby-time 1347 1350 nginx cwd unknown /proc/1347/task/1350/cwd (readlink: Permission denied)
[21:49:46] allisio: Limix: Stop.
[21:49:47] Limix: ruby-time 1347 1350 nginx rtd unknown /proc/1347/task/1350/root (readlink: Permission denied)
[21:49:48] Limix: ruby-time 1347 1350 nginx txt unknown /proc/1347/task/1350/exe (readlink: Permission denied)
[21:49:50] Limix: ruby-time 1347 1350 nginx NOFD /proc/1347/task/1350/fd (opendir: Permission denied)
[21:49:51] Limix: utils.rb: 1347 1352 nginx cwd unknown /proc/1347/task/1352/cwd (readlink: Permission denied)
[21:49:53] Limix: utils.rb: 1347 1352 nginx rtd unknown /proc/1347/task/1352/root (readlink: Permission denied)
[21:49:54] allisio: What a fucking pleb.
[21:49:54] Limix: utils.rb: 1347 1352 nginx txt unknown /proc/1347/task/1352/exe (readlink: Permission denied)
[21:49:56] Limix: utils.rb: 1347 1352 nginx NOFD /proc/1347/task/1352/fd (opendir: Permission denied)
[21:49:57] Limix: utils.rb: 1347 1353 nginx cwd unknown /proc/1347/task/1353/cwd (readlink: Permission denied)
[21:49:59] Limix: utils.rb: 1347 1353 nginx rtd unknown /proc/1347/task/1353/root (readlink: Permission denied)
[21:50:00] Limix: utils.rb: 1347 1353 nginx txt unknown /proc/1347/task/1353/exe (readlink: Permission denied)
[21:50:02] Limix: utils.rb: 1347 1353 nginx NOFD /proc/1347/task/1353/fd (opendir: Permission denied)
[21:50:03] Limix: ruby 1355 nginx cwd unknown /proc/1355/cwd (readlink: Permission denied)
[21:50:05] Limix: ruby 1355 nginx rtd unknown /proc/1355/root (readlink: Permission denied)
[21:50:06] Limix: ruby 1355 nginx txt unknown /proc/1355/exe (readlink: Permission denied)
[21:50:08] Limix: ruby 1355 nginx NOFD /proc/1355/fd (opendir: Permission denied)
[21:50:09] Limix: whats a pleb
[21:50:10] ruby[bot]: +qqq $a:Limix Limix!*@* *!*@cpe-76-174-47-192.socal.res.rr.com
[21:50:17] bg: hahahahaha
[21:50:24] ruby[bot]: -qqq $a:Limix Limix!*@* *!*@cpe-76-174-47-192.socal.res.rr.com
[21:50:33] dminuoso: havenwood: I wanted to see all 2000+ files.
[21:50:42] hxegon: Don't paste a bunch of stuff into an IRC channel plz and thanks Limix
[21:50:45] JeanCarloMachado: has joined #ruby
[21:50:47] zeroDi: has joined #ruby
[21:50:51] hxegon: hold on bg, still looking
[21:50:56] bg: okie :3
[21:54:02] djbkd: has joined #ruby
[21:54:41] enterprisey: has joined #ruby
[21:55:03] Limix: Sorry guys, I didn’t mean that
[21:56:29] s2013: has joined #ruby
[21:56:47] hxegon: bg: Can't see much in the way of series besides railscast, but there are a TON of ruby conf talks
[21:56:48] bg: Limix i still <3 u
[21:57:03] Limix: alliso: that’s so sad: http://www.urbandictionary.com/define.php?term=pleb
[21:57:05] bg: good idea hxegon
[21:57:10] hxegon: bg: I'd suggest Sandi Metz's talks, which I'll link in a second
[21:58:12] Limix: But thanks for the help, will keep working on a cleanup solution, take care all
[21:58:14] allisio: Limix: I was using definition 2.1, if that's any consolation.
[21:58:30] hxegon: bg: Actually searching for that I just found a video series going over her book, Practical Object-Oriented Design in Ruby: https://www.youtube.com/watch?v=TGi0vT24Ens&list=PLECibIxMfd0dVOFbn7cbtvuiatC0XvINP
[21:59:00] Limix: 1)one who's inferior intelligence results in them making a complete titface out of themselves in public
[21:59:28] SteenJobs_: has joined #ruby
[21:59:29] hxegon: and if you search youtube for "sandi metz ruby" I see... about 4 hours of conf talks from her
[21:59:38] bg: very very nice
[21:59:53] bg: thank you
[22:00:00] bg: i will be a ruby god in short order
[22:00:06] hxegon: no problem. her book is really good too.
[22:05:08] moei: has joined #ruby
[22:07:25] Derperperd: has joined #ruby
[22:08:05] fns: limix lol please read man page or --help etc before getting all confused :)
[22:08:25] fns: i think it is -p PID but not certain without checking
[22:10:11] djbkd: has joined #ruby
[22:10:26] SeepingN: has joined #ruby
[22:10:44] mula: has joined #ruby
[22:12:25] Ruby_Rocks_007: has joined #ruby
[22:15:29] gigetoo: has joined #ruby
[22:16:13] bg: has joined #ruby
[22:18:52] pawnbox: has joined #ruby
[22:20:50] jenrzzz: has joined #ruby
[22:20:51] jenrzzz: has joined #ruby
[22:21:17] SteenJobs_: has joined #ruby
[22:21:25] tvw: has joined #ruby
[22:24:44] cschneid_: has joined #ruby
[22:25:04] ^Denis: has joined #ruby
[22:26:33] SteenJobs_: has joined #ruby
[22:26:47] fns: has left #ruby: ()
[22:27:52] __Yiota: has joined #ruby
[22:28:59] bmurt: has joined #ruby
[22:31:04] CloCkWeRX: has joined #ruby
[22:31:46] SeepingN_: has joined #ruby
[22:33:15] bheesham: has joined #ruby
[22:34:43] mula: has joined #ruby
[22:35:28] VladGh: has joined #ruby
[22:37:43] koneko: has joined #ruby
[22:40:08] Ruby_Rocks_007: has joined #ruby
[22:40:56] SteenJobs_: has joined #ruby
[22:41:06] ule: has joined #ruby
[22:46:12] SteenJobs_: has joined #ruby
[22:48:27] sid_fules: has joined #ruby
[22:52:02] SteenJobs_: has joined #ruby
[22:52:26] graft: ok i'm trying to write operators for my Vector class, I want to be able to do Vector / Vector and Numeric / Vector and Vector / Numeric
[22:52:59] graft: for the first and last i can just use def /(vec_or_number), but the latter requires me to patch Numeric
[22:53:54] graft: instead we're supposed to override 'coerce' in Vector, which will result in Numeric calling Vector#/(Numeric) if it can't figure out how to deal with Vector
[22:54:33] graft: but... division isn't commutative, so this won't work?
[22:55:00] graft: any idee how i can do 3 / vector and vector / 3?
[22:55:28] sneakers: has joined #ruby
[22:58:23] pawnbox: has joined #ruby
[23:00:54] SteenJobs_: has joined #ruby
[23:04:28] montanonic: has joined #ruby
[23:06:41] SteenJobs: has joined #ruby
[23:07:14] hutch34: has joined #ruby
[23:12:34] Silthias: has joined #ruby
[23:15:15] gilest: has joined #ruby
[23:17:47] certainty: has joined #ruby
[23:21:27] samdvr: has joined #ruby
[23:21:35] hahuang65: has joined #ruby
[23:24:13] SteenJobs_: has joined #ruby
[23:28:25] pawnbox: has joined #ruby
[23:28:44] jenrzzz_: has joined #ruby
[23:31:14] duderono_: has joined #ruby
[23:37:30] allisio: graft: Are you sure you have a well-defined definition of what `3 / Vector` should do?
[23:38:48] SteenJobs_: has joined #ruby
[23:39:51] dviola: has joined #ruby
[23:40:08] allisio: In any event, `def coerce other; [Vector.new(other, self]; end` is probably the sanest thing you can do in that situation.
[23:40:22] allisio: *(other), obviously.
[23:44:52] jackjackdripper1: has joined #ruby
[23:48:11] ResidentBiscuit: has joined #ruby
[23:51:59] xMopxShell: has joined #ruby
[23:53:13] minimalism: has joined #ruby
[23:54:44] charliesome: has joined #ruby