« Back to channel list

#ruby - 09 March 2018

« Back 1 day Forward 1 day »
[00:01:12] dmitriy_: has joined #ruby
[00:02:14] cthulchu|: has joined #ruby
[00:03:23] banisterfiend: has joined #ruby
[00:05:59] mikecmpbll: has joined #ruby
[00:06:01] arescorpio: has joined #ruby
[00:06:08] dmitriy_: has joined #ruby
[00:08:13] postmodern: has joined #ruby
[00:08:26] mroutis: has left #ruby: ()
[00:11:12] dmitriy_: has joined #ruby
[00:11:21] Matthew1: has joined #ruby
[00:13:48] jenrzzz: has joined #ruby
[00:13:48] jenrzzz: has joined #ruby
[00:16:10] dmitriy_: has joined #ruby
[00:16:18] x0F: has joined #ruby
[00:18:42] naprimer2: has joined #ruby
[00:21:10] dmitriy_: has joined #ruby
[00:22:31] sameerynho: has joined #ruby
[00:24:51] Psybur_: has joined #ruby
[00:26:07] dmitriy_: has joined #ruby
[00:26:26] cschneid: has joined #ruby
[00:28:29] eckhardt: has joined #ruby
[00:28:50] ResidentBiscuit: has joined #ruby
[00:30:00] yxhuvud: has joined #ruby
[00:32:21] banisterfiend: anyone here encountered ""warning: failed to load encoding (CP1250); use ASCII-8BIT instead"" on windows before?
[00:32:37] kliq: has joined #ruby
[00:33:26] alfiemax: has joined #ruby
[00:34:25] cagomez: has joined #ruby
[00:38:27] hahuang65: has joined #ruby
[00:39:32] ledestin: has joined #ruby
[00:42:14] dmitriy_: has joined #ruby
[00:47:14] dmitriy_: has joined #ruby
[00:49:50] GinoMan: has joined #ruby
[00:50:11] zenspider: banisterfiend: I have not... but that's eastern european, no? maybe something flubbed during compilation w/ the encoding tables?
[00:52:24] dmitriy_: has joined #ruby
[00:56:56] Psybur_: has joined #ruby
[00:57:13] dmitriy_: has joined #ruby
[00:58:34] Hanmac: has joined #ruby
[01:02:16] dmitriy_: has joined #ruby
[01:07:15] dmitriy_: has joined #ruby
[01:10:32] hahuang61: has joined #ruby
[01:10:49] ramfjord: has joined #ruby
[01:12:14] dmitriy_: has joined #ruby
[01:12:31] pilne: i haven't used windows outside of locked down machines at work in years, so i'm sorry but I can't help
[01:17:14] dmitriy_: has joined #ruby
[01:18:44] jeffreylevesque: has joined #ruby
[01:22:16] dmitriy_: has joined #ruby
[01:23:29] karapetyan: has joined #ruby
[01:27:13] dmitriy_: has joined #ruby
[01:30:18] schneider: has joined #ruby
[01:32:17] dmitriy_: has joined #ruby
[01:37:16] dmitriy_: has joined #ruby
[01:37:21] Jameser: has joined #ruby
[01:39:27] Mon_Ouie: has joined #ruby
[01:41:36] bigblind: has joined #ruby
[01:42:15] dmitriy_: has joined #ruby
[01:47:15] dmitriy_: has joined #ruby
[01:48:04] lroca: has joined #ruby
[01:52:14] dmitriy_: has joined #ruby
[01:53:24] kapil___: has joined #ruby
[01:54:20] alfiemax: has joined #ruby
[02:04:54] zautomata: has joined #ruby
[02:04:54] zautomata: has joined #ruby
[02:06:14] dmitriy_: has joined #ruby
[02:10:12] ramfjord: has joined #ruby
[02:10:18] bmurt: has joined #ruby
[02:11:14] dmitriy_: has joined #ruby
[02:14:20] hahuang61: has joined #ruby
[02:16:57] psychicist__: has joined #ruby
[02:20:42] ResidentBiscuit: has joined #ruby
[02:21:37] PresidentBiscuit: has joined #ruby
[02:22:42] JaredR: has joined #ruby
[02:23:49] Resident_: has joined #ruby
[02:24:59] Resident_: has joined #ruby
[02:25:56] ResidentBiscuit: has joined #ruby
[02:27:02] PresidentBiscuit: has joined #ruby
[02:27:53] dinfuehr: has joined #ruby
[02:28:13] JaredR: has joined #ruby
[02:28:56] gnufied: has joined #ruby
[02:29:20] Resident_: has joined #ruby
[02:30:25] Resident_: has joined #ruby
[02:30:44] nadir: has joined #ruby
[02:31:26] ResidentBiscuit: has joined #ruby
[02:32:34] PresidentBiscuit: has joined #ruby
[02:33:28] gizmore: has joined #ruby
[02:33:41] JaredR: has joined #ruby
[02:34:25] d^sh: has joined #ruby
[02:34:52] Resident_: has joined #ruby
[02:35:56] Resident_: has joined #ruby
[02:43:00] unreal_: has joined #ruby
[02:49:39] alfiemax: has joined #ruby
[02:51:29] stairmast0r: has joined #ruby
[02:51:30] ResidentBiscuit: has joined #ruby
[02:51:57] gizmore|2: has joined #ruby
[02:54:58] stairmast0r: has joined #ruby
[03:00:09] cadillac_: has joined #ruby
[03:01:54] alfiemax: has joined #ruby
[03:02:10] netherwolfe: has joined #ruby
[03:06:08] darkhanb: has joined #ruby
[03:09:38] hahuang61: has joined #ruby
[03:37:15] nicesignal: has joined #ruby
[03:54:56] alfiemax: has joined #ruby
[03:55:17] jrm: has joined #ruby
[03:56:17] cthulchu: has joined #ruby
[04:12:59] hahuang61: has joined #ruby
[04:15:54] zenspider_: has joined #ruby
[04:25:14] trautwein: has joined #ruby
[04:28:32] alfiemax_: has joined #ruby
[04:28:32] dstrunk: has joined #ruby
[04:30:20] mooser: has joined #ruby
[04:31:29] linuxdaemon: has joined #ruby
[04:36:44] cschneid: has joined #ruby
[04:37:36] hahuang61: has joined #ruby
[04:45:47] mooser: has joined #ruby
[04:50:48] cthulchu: has joined #ruby
[04:54:59] Puffball: has joined #ruby
[04:57:29] rippa: has joined #ruby
[04:58:08] anisha: has joined #ruby
[05:00:05] karapetyan: has joined #ruby
[05:08:16] hahuang61: has joined #ruby
[05:10:07] nielsk: has joined #ruby
[05:18:44] ghormoon: has joined #ruby
[05:21:33] AJA4350: has joined #ruby
[05:28:32] Puffball: has joined #ruby
[05:32:55] garyserj: has joined #ruby
[05:33:24] garyserj: what's the difference between doing require 'pry' vs require 'byebug', and then doing binding.pry ?
[05:35:35] havenwood: garyserj: You have to require pry either directly or through something that has it as a dependency in order to `binding.pry`.
[05:35:55] havenwood: garyserj: Byebug doesn't have Pry as a dep, so you'd have to require Pry if you aren't already.
[05:36:09] havenwood: garyserj: There's a pry-byebug gem: https://github.com/deivid-rodriguez/pry-byebug
[05:43:05] willmichael: has joined #ruby
[05:43:06] garyserj: thanks, i see the installation of gem pry-byebug adds some commands to pry.
[05:45:41] conta: has joined #ruby
[05:52:58] MarcWeber: has joined #ruby
[05:53:32] MarcWeber: When assigning a hash, how does ruby detertmine equality? I mean h[obj] -> is there a obj.to_hash like function to tell ruby when it overwrite existing entry?
[05:55:49] cthulchu: has joined #ruby
[06:01:10] caoraivoso: I like using binding.irb but I wish I had a way to add breakpoints and step/next/continue, etc
[06:01:12] edwardly: has joined #ruby
[06:01:12] edwardly: has joined #ruby
[06:01:56] sidx64: has joined #ruby
[06:07:38] aufi: has joined #ruby
[06:08:00] nowhereman_: has joined #ruby
[06:10:49] hahuang61: has joined #ruby
[06:14:04] garyserj: caoraivoso: so why don't you use binding.pry ?
[06:14:51] dmitriy_: has joined #ruby
[06:15:58] caoraivoso: I'm writing simple scripts and I'm a bit lazy to install pry
[06:16:06] caoraivoso: but I guess I'll do it
[06:16:30] garyserj: what about byebug , that might come as default?
[06:16:42] alfiemax: has joined #ruby
[06:16:54] AJA4350: has joined #ruby
[06:17:10] caoraivoso: it's the default in rails, not ruby
[06:17:13] caoraivoso: I'm not using rails
[06:17:50] cschneid: has joined #ruby
[06:19:59] PhoenixMage: has left #ruby: ()
[06:23:36] cschneid: has joined #ruby
[06:35:43] darkhanb: has joined #ruby
[06:36:16] edwardly: has joined #ruby
[06:36:16] edwardly: has joined #ruby
[06:37:13] LocaMocha: has joined #ruby
[06:39:42] sidx64_: has joined #ruby
[06:41:11] aufi: has joined #ruby
[06:42:17] sidx64: has joined #ruby
[06:44:51] jenrzzz: has joined #ruby
[06:44:51] jenrzzz: has joined #ruby
[06:48:06] Puffball: has joined #ruby
[06:50:06] Ryzokuken: has joined #ruby
[06:51:50] cthulchu: has joined #ruby
[06:52:53] claudiuinberlin: has joined #ruby
[07:02:30] kapil___: has joined #ruby
[07:03:36] dminuoso: ACTION calls havenwood by name
[07:03:50] dminuoso: You are not quite normal yet.
[07:04:12] eckhardt: has joined #ruby
[07:05:40] sidx64: has joined #ruby
[07:06:52] darkhanb: has joined #ruby
[07:07:23] hahuang61: has joined #ruby
[07:09:05] jamesaxl: has joined #ruby
[07:21:57] AJA4350: has joined #ruby
[07:22:16] solocshaw: has joined #ruby
[07:22:35] ramfjord: has joined #ruby
[07:33:28] guardianx: has joined #ruby
[07:39:31] mtkd: has joined #ruby
[07:39:52] alfiemax: has joined #ruby
[07:41:06] alfiemax_: has joined #ruby
[07:42:49] dionysus69: has joined #ruby
[07:45:58] alfiemax: has joined #ruby
[07:46:09] Jameser: has joined #ruby
[07:49:54] govg: has joined #ruby
[07:57:20] alfiemax: has joined #ruby
[07:57:43] tAn: has joined #ruby
[07:58:41] anisha: has joined #ruby
[07:58:52] cthulchu: has joined #ruby
[07:59:50] andikr: has joined #ruby
[08:02:15] chmurifree: has joined #ruby
[08:05:24] aufi: has joined #ruby
[08:07:11] Jameser: has joined #ruby
[08:07:26] phaul: has joined #ruby
[08:08:43] hahuang61: has joined #ruby
[08:08:44] vondruch: has joined #ruby
[08:15:48] clemens3: has joined #ruby
[08:16:30] tvw: has joined #ruby
[08:16:48] dmitriy_: has joined #ruby
[08:17:04] willmichael: has joined #ruby
[08:17:36] TomyWork: has joined #ruby
[08:19:27] burgestrand: has joined #ruby
[08:24:12] vutral|kali: has joined #ruby
[08:24:12] vutral|kali: has joined #ruby
[08:25:40] yohji: has joined #ruby
[08:30:35] za1b1tsu: has joined #ruby
[08:31:37] willmichael: has joined #ruby
[08:35:44] willmichael: has joined #ruby
[08:36:20] karapetyan: has joined #ruby
[08:37:39] ams__: has joined #ruby
[08:38:18] alfiemax: has joined #ruby
[08:42:13] amatas: has joined #ruby
[08:44:27] aupadhye: has joined #ruby
[08:47:09] Beams: has joined #ruby
[08:51:04] sidx64: has joined #ruby
[08:52:51] cthulchu: has joined #ruby
[08:58:39] ltt: has joined #ruby
[09:07:01] hahuang61: has joined #ruby
[09:07:33] aupadhye: has joined #ruby
[09:11:04] c0ncealed: has joined #ruby
[09:15:36] dviola: has joined #ruby
[09:16:39] caoraivoso: are there any specific cases when I should be using procs/lambdas/blocks instead of methods?
[09:16:40] RougeR: has joined #ruby
[09:17:00] ltt: has joined #ruby
[09:17:31] dmitriy_: has joined #ruby
[09:17:36] dminuoso: caoraivoso: procs/lambdas/blocks are a bit cleaner when doing HOFs.
[09:18:04] dminuoso: caoraivoso: Actually, no it kind of depends.
[09:18:06] dminuoso: For example
[09:18:14] dminuoso: >> [1,2,3,4,5,6].select(&:even)
[09:18:15] ruby[bot]: dminuoso: # => undefined method `even' for 1:Fixnum ...check link for more (https://eval.in/969158)
[09:18:17] dminuoso: >> [1,2,3,4,5,6].select(&:even?)
[09:18:30] ruby[bot]: dminuoso: # => [2, 4, 6] (https://eval.in/969159)
[09:18:45] dminuoso: caoraivoso: Semantically this passes a method (name), though you use a block if you look close enough.
[09:19:38] alfiemax: has joined #ruby
[09:21:07] dminuoso: caoraivoso: Also I frequently like to use lambdas when I just need a combinator
[09:21:14] dminuoso: for example this has become a common idiom for me:
[09:21:32] dminuoso: at -> i, e { e[i] }; foo.map(&at["blah"])
[09:21:38] dminuoso: at -> i, e { e[i] }.curry; foo.map(&at["blah"])
[09:22:40] sanscoeur: has joined #ruby
[09:22:42] willmichael: has joined #ruby
[09:22:47] dminuoso: (I usually tuck that `at` away, so I dont need to redefine it all over the place)
[09:24:02] caoraivoso: I see, makes sense
[09:24:30] dminuoso: agent_white: https://eval.in/969165
[09:25:01] dminuoso: caoraivoso: There's lots of cool tricks you can do if you simply use lambda and curry.
[09:25:08] MatrixBridge: has joined #ruby
[09:25:10] MatrixBridge: has left #ruby: ("User left")
[09:25:17] dminuoso: Whole "design patterns" disappear into simple functions.
[09:26:13] dminuoso: *caoraivoso
[09:26:27] klaas: has joined #ruby
[09:27:53] caoraivoso: I'll look more into it, thanks
[09:28:01] caoraivoso: what does HOF stands for?
[09:28:22] dminuoso: caoraivoso: higher order function. its a function that itself either takes a function (i.e. proc/lambda/block) as an argument and/or returns a function as a result.
[09:28:43] dminuoso: basically it admits that functions themselves are values.
[09:30:41] caoraivoso: that makes sense, most functions return a value quite often
[09:30:44] marr: has joined #ruby
[09:30:46] dminuoso: caoraivoso: No.
[09:30:53] dminuoso: caoraivoso: A function that returns a function as a value!
[09:31:07] dminuoso: caoraivoso: For example with currying _every_ function with more than one argument is a higher order function.
[09:31:13] dminuoso: caoraivoso: my `at` is a higher order function.
[09:31:39] dminuoso: why? if you invoke it with `at[:name]`, it returns a function that takes one argument and produces some result.
[09:32:13] dminuoso: so `at` is a function that returns a function.
[09:32:39] dminuoso: and conversely a function that takes a function as an argument is also a HOF
[09:32:47] dminuoso: (in Ruby this usually means any method that takes a block)
[09:33:40] dminuoso: caoraivoso: so there's some cool perspectives
[09:33:51] dminuoso: add = -> a, b { a + b }.curry
[09:34:01] dminuoso: if `add` is a function that returns a function, then what does it do?
[09:34:19] dminuoso: well `add` creates adders. add[5] creates an "adder, that simply adds 5 to any value"
[09:35:11] guille-moe: has joined #ruby
[09:36:31] dminuoso: caoraivoso: Then you can have a fun HOF: ap = -> f, v { f[v] }.curry
[09:38:19] kke: could there be some clever way to make unknown_local_variable_or_method || "hello" to return hello instead of raising NameError?
[09:38:51] caoraivoso: dminuoso: nice
[09:40:47] caoraivoso: I'll play a bit more with lambdas
[09:41:00] dminuoso: caoraivoso: Be sure to curry them, you gain so much more power with no costs..
[09:41:32] Beams_: has joined #ruby
[09:41:54] xco: has joined #ruby
[09:42:04] dminuoso: caoraivoso: (if currying makes sense to you, if not I recommend it)
[09:42:15] dminuoso: caoraivoso: Its not idiomatic ruby, but with things like `at` you can write so much more concise code.
[09:43:19] dminuoso: I think foo.map(&at[:name]) tells me much better what this does, compared to `foo.map { |e| e[:name }` because it forces you to think in terms of operations, rather than denotation.
[09:44:07] mtkd: has joined #ruby
[09:45:45] caoraivoso: I'm not familiar with curry yet, but I'll check it out
[09:47:47] nowhereman_: has joined #ruby
[09:50:41] dminuoso: caoraivoso: https://eval.in/969183
[09:50:47] dminuoso: so many shenanigans you can do.
[09:52:17] cthulchu: has joined #ruby
[09:52:24] dminuoso: https://eval.in/969187 slightly rewritten
[10:00:55] gix: has joined #ruby
[10:01:25] xco: has joined #ruby
[10:02:12] agent_white: has joined #ruby
[10:05:00] kke: hmm actually i just want an instance of NilClass that has to_s that raises
[10:05:24] kke: and i know there's several things wrong in the whole concept of that :D
[10:05:47] solocshaw: has joined #ruby
[10:06:24] kke: but is this doable? could i do the equivalent of foo = nil; foo.extend(NotStringable)
[10:07:01] dminuoso: kke: Can you explain the context?
[10:07:24] dminuoso: kke: You could generally check for responds_to? first, but it could be an anti pattern depending on what you are doing
[10:08:29] kke: dminuoso: i'm trying to create a sort of a Namespace for erb binding. I would like to have something like <%= some_var || "default_value" %> and <% some_var ||= 'default_value' %> working, but raise a NameError, "unknown local variable or method X" for something like <%= some_var %> if it's not defined
[10:09:35] Mia: has joined #ruby
[10:09:40] Mia: has joined #ruby
[10:09:54] kke: so in essence, i think, having a nil that is not to_s:able
[10:11:12] kke: currently i have something like def method_missing(meth, *args) NilObject.new(meth) end and that works for everything except for the <%= some_var || "default_value" %> (of course there may be some other non working cases i haven't thought of yet)
[10:11:53] kke: where nilobject is a class that has def nil? { true } and def to_s { raise NameError }
[10:12:33] fribmendes: has joined #ruby
[10:12:35] kke: and the namespace thing is kind of derived from the answer in https://stackoverflow.com/a/5462069/681520
[10:13:15] hahuang61: has joined #ruby
[10:14:23] schneider: has joined #ruby
[10:18:20] dmitriy_: has joined #ruby
[10:19:48] AJA4350: has joined #ruby
[10:23:46] sanscoeur: has joined #ruby
[10:29:34] cadillac_: has joined #ruby
[10:32:43] sidx64: has joined #ruby
[10:37:01] burgestrand: has joined #ruby
[10:45:52] cthulchu: has joined #ruby
[10:49:50] xco: has joined #ruby
[10:50:26] kliq: has joined #ruby
[10:56:00] lenci: has joined #ruby
[10:56:22] lenci: ACTION KLIKONI http://beratilive.com hyni ne chat me djem dhe takime klikoni direkt START dhe kerkoni ne privat jo main se ju presin djem te bukur
[10:56:25] lenci: ACTION KLIKONI http://beratilive.com hyni ne chat me djem dhe takime klikoni direkt START dhe kerkoni ne privat jo main se ju presin djem te bukur
[10:56:30] lenci: has left #ruby: ()
[10:57:55] dminuoso: kke | and i know there's several things wrong in the whole concept of that :D
[10:58:00] dminuoso: kke: No I think that's a very sane thing.
[10:58:32] dminuoso: kke: nil should make things explode left and right.
[10:59:12] claudiuinberlin: has joined #ruby
[11:01:01] apeiros: has joined #ruby
[11:04:42] Sylario: has joined #ruby
[11:05:40] willmichael: has joined #ruby
[11:06:21] ltt: has joined #ruby
[11:06:24] shinnya: has joined #ruby
[11:08:06] hahuang61: has joined #ruby
[11:10:24] Ryzokuken: has joined #ruby
[11:11:41] mtkd: has joined #ruby
[11:12:55] devil_tux: has joined #ruby
[11:15:09] kke: mostly refering to things like "an instance of NilClass"
[11:19:06] dmitriy_: has joined #ruby
[11:21:52] ramfjord: has joined #ruby
[11:22:54] Cavallari: has joined #ruby
[11:24:03] ltt: has joined #ruby
[11:28:53] willmichael: has joined #ruby
[11:29:35] Psybur_: has joined #ruby
[11:31:40] cadillac_: has joined #ruby
[11:34:10] ldnunes: has joined #ruby
[11:35:59] fribmendes: has joined #ruby
[11:36:08] willmichael: has joined #ruby
[11:36:53] anisha: has joined #ruby
[11:38:32] vutral|kali: has joined #ruby
[11:38:32] vutral|kali: has joined #ruby
[11:40:07] cadillac_: has joined #ruby
[11:51:51] cthulchu: has joined #ruby
[12:01:05] suukim: has joined #ruby
[12:07:32] hahuang61: has joined #ruby
[12:11:49] luminous: has joined #ruby
[12:12:15] John_Ivan: has joined #ruby
[12:12:16] John_Ivan: has joined #ruby
[12:12:54] karapetyan: has joined #ruby
[12:16:28] alex``: has joined #ruby
[12:16:44] wojnar: has joined #ruby
[12:17:36] ferr1: has joined #ruby
[12:19:55] dmitriy_: has joined #ruby
[12:21:19] meadmoon: has joined #ruby
[12:25:49] sanscoeur: has joined #ruby
[12:26:20] ferr1: has left #ruby: ("WeeChat 2.0.1")
[12:27:56] cschneid: has joined #ruby
[12:28:56] Psybur_: has joined #ruby
[12:28:58] ltt: has joined #ruby
[12:29:41] \void: has joined #ruby
[12:39:42] milardovich: has joined #ruby
[12:42:53] schneider: has joined #ruby
[12:50:00] DTZUZO: has joined #ruby
[12:50:41] schneider: has joined #ruby
[12:52:53] fribmendes: has joined #ruby
[12:53:51] cthulchu: has joined #ruby
[12:54:18] tcopeland: has joined #ruby
[12:55:02] rikkipitt: has joined #ruby
[12:57:17] alex``: has joined #ruby
[12:59:24] adlerdias: has joined #ruby
[13:03:10] jcalla: has joined #ruby
[13:07:22] hahuang61: has joined #ruby
[13:07:36] gnufied: has joined #ruby
[13:08:12] synthroid: has joined #ruby
[13:10:41] karapetyan: has joined #ruby
[13:11:06] psychicist__: has joined #ruby
[13:15:13] cschneid: has joined #ruby
[13:16:45] mtkd: has joined #ruby
[13:20:39] kliq: has joined #ruby
[13:20:57] dmitriy_: has joined #ruby
[13:22:59] pyther: has joined #ruby
[13:24:10] pyther: Hi. I'm hacking on some puppet code and I'm trynig to figure out what the significance of the underscore in the following line of code? raise Puppet::ParseError, _("modular_file: unable to lookup module_path.")
[13:26:39] nowhereman_: has joined #ruby
[13:27:33] rrutkowski: has joined #ruby
[13:28:44] Psybur_: has joined #ruby
[13:29:51] rrutkowski: has joined #ruby
[13:30:54] Papierkorb: has joined #ruby
[13:34:02] milardovich: has joined #ruby
[13:36:54] cschneid: has joined #ruby
[13:38:19] aufi: has joined #ruby
[13:38:38] aufi_: has joined #ruby
[13:40:48] memo1: has joined #ruby
[13:42:51] karapetyan: has joined #ruby
[13:45:37] oleo: has joined #ruby
[13:50:51] cthulchu: has joined #ruby
[13:52:36] ramfjord: has joined #ruby
[13:56:28] johnny56: has joined #ruby
[14:05:47] nowhere_man: has joined #ruby
[14:05:54] hahuang61: has joined #ruby
[14:06:07] desperek: has joined #ruby
[14:07:08] cdg: has joined #ruby
[14:08:34] larissa: has joined #ruby
[14:08:53] workmad3: has joined #ruby
[14:09:15] Bhootrk: has joined #ruby
[14:09:54] wojnar: has joined #ruby
[14:10:51] karapetyan: has joined #ruby
[14:13:52] chouhoulis: has joined #ruby
[14:15:58] conta: has joined #ruby
[14:16:17] apeiros: pyther: quite likely localization
[14:16:21] apeiros: also: #puppet
[14:17:49] Papierkorb: has left #ruby: ("Konversation terminated!")
[14:17:59] burgestrand: has joined #ruby
[14:21:26] Psybur: has joined #ruby
[14:21:26] Psybur: has joined #ruby
[14:25:32] bmurt: has joined #ruby
[14:26:31] sanscoeur: has joined #ruby
[14:27:29] bmurt: has joined #ruby
[14:29:15] DLSteve_: has joined #ruby
[14:33:26] gnufied: has joined #ruby
[14:34:39] desperek: how do i format array nicely in 1 liner
[14:35:23] apeiros: desperek: got an example?
[14:36:05] desperek: apeiros, i do, but i guess that's not a thing here. array_from_assoc.each or .map
[14:36:16] desperek: dunno, were there map!?
[14:36:25] ixti: has joined #ruby
[14:37:00] desperek: apeiros, i guess thats more ERB question
[14:37:02] apeiros: I have no idea what you're asking for then
[14:37:07] dionysus70: has joined #ruby
[14:37:09] roshanavand: has joined #ruby
[14:37:21] desperek: eh, i need to escape array somehow apeiros
[14:37:34] apeiros: for some reason it makes even less sense now
[14:38:08] apeiros: maybe think for a minute what information might be relevant to understand your question.
[14:38:17] apeiros: (and then provide it)
[14:38:19] desperek: mhm i brb anyways
[14:39:05] hinbody: has joined #ruby
[14:39:13] ltt: has joined #ruby
[14:44:45] ltem: has joined #ruby
[14:51:20] larcara: has joined #ruby
[14:51:40] howdoi: has joined #ruby
[14:51:57] cthulchu: has joined #ruby
[14:57:42] gnufied: has joined #ruby
[14:59:28] totalsecond: has joined #ruby
[15:02:40] chouhoulis: has joined #ruby
[15:03:54] chouhoulis: has joined #ruby
[15:05:52] milardovich: has joined #ruby
[15:09:29] Rapture: has joined #ruby
[15:11:18] desperek: apeiros, so, first things first. i have a view in html.erb. i have for each loop on some array and in this loop i want to proccess array with each/map!
[15:11:35] desperek: but it doesnt seem to work
[15:12:23] desperek: instead of executing for each loop it prints the information, like there would be no .each in the first place
[15:12:59] desperek: u.roles.where(division: @division).each {|n| ',@!!@321'}
[15:13:04] desperek: lets say this is the piece of code
[15:13:19] hahuang61: has joined #ruby
[15:13:21] apeiros: yeah, example please. ideally reproducible.
[15:13:43] apeiros: s/ideally/mandatory/ :-p
[15:14:01] desperek: apeiros, basically the line i pasted up there (u.roles...) is the example
[15:14:04] desperek: actual code :p
[15:14:06] desperek: let me launch pry
[15:14:12] ltt: has joined #ruby
[15:14:19] apeiros: desperek: no, the code above is *not* an example.
[15:14:28] apeiros: there is zero erb in your example. it's not reproducible.
[15:14:53] desperek: i suppose it is whatever?
[15:15:06] apeiros: I don't know what you want to say by that
[15:15:26] desperek: apeiros, i mean, ERB executes ruby code, doesnt it?
[15:15:36] desperek: hence i guess we can ommit ERB part
[15:15:43] apeiros: you guess wrong
[15:16:03] apeiros: if you write bad erb, there's no point in looking even at the ruby code
[15:16:04] desperek: apeiros, ruby does what erb does there tho
[15:16:10] fribmendes: has joined #ruby
[15:16:42] apeiros: ok. lets see. reduce your example to where erb does not come into play.
[15:17:27] desperek: apeiros, u.each {|n| n.something} where u is ActiveRecord_Associations_CollectionProxy
[15:17:42] apeiros: ok, you don't understand reproducible.
[15:17:48] apeiros: reproducible means I can copy your code and run it
[15:18:10] apeiros: ping me when you have a reproducible example
[15:19:51] cschneid: has joined #ruby
[15:19:55] desperek: apeiros, i still have no idea how to pass it to you :/
[15:19:56] netherwolfe: has joined #ruby
[15:20:25] Puffball: has joined #ruby
[15:20:45] apeiros: remove all the parts which don't matter. replace them with things which have no dependencies.
[15:21:31] apeiros: instead of `u.roles.where(division: @division).each { |role| role.some_attribute }` provide `["some", "attribute", "values"].each { |attr| attr }`
[15:21:50] apeiros: all the code has to do is still exhibit your problem
[15:24:04] desperek: apeiros, okay, whatever. i have an array now, how can i make it print with the style i want in ERB?
[15:24:37] apeiros: seriously, you lack like *all* relevant information. let me give you a similarly detailed answer:
[15:24:46] apeiros: by applying the style you want to the array and emitting it in the erb
[15:24:50] apeiros: there. did that help you?
[15:24:58] cagmz: has joined #ruby
[15:26:03] desperek: apeiros, okay okay... here is reproductible example: <%= ["0","1"] %>
[15:26:28] nadir: has joined #ruby
[15:26:37] apeiros: and what would you like your erb to emit? the "style" part…
[15:26:43] desperek: how do i display these 0, 1 instead of ["0","1"] apeiros
[15:26:52] desperek: like "0, 1"
[15:27:08] apeiros: you convert it to a string. with this example, join is a good choice.
[15:27:17] roshanavand: has joined #ruby
[15:27:18] apeiros: <%= ["0", "1"].join(", ") %>
[15:28:03] desperek: ...oh.... didn't think about it that way...
[15:28:11] apeiros: <%= (expression) %> calls to_s on the value (expression) evaluates to. and Array#to_s gives you '["0","1"]'
[15:28:13] desperek: thanks a lot apeir0s
[15:28:26] willmichael: has joined #ruby
[15:28:30] apeiros: ?tabnick desperek
[15:28:31] ruby[bot]: desperek: pro-tip - use tab completion for nicks. avoids typos in nicks.
[15:28:46] desperek: apeiros, i've done it on purpose
[15:30:11] desperek: apeiros, of not pinging you, well, nevermind
[15:30:48] Gnut_: has joined #ruby
[15:37:39] tomphp: has joined #ruby
[15:41:26] willmichael: has joined #ruby
[15:47:58] milardovich: has joined #ruby
[15:52:10] fribmendes: has joined #ruby
[15:53:25] willmichael: has joined #ruby
[15:58:00] cschneid: has joined #ruby
[15:59:31] vyorkin: has joined #ruby
[16:00:00] dionysus70: has joined #ruby
[16:00:29] yokel: has joined #ruby
[16:02:36] zacts: has joined #ruby
[16:03:11] [Butch]: has joined #ruby
[16:04:10] ldnunes: has joined #ruby
[16:06:13] darix: apeiros: you dont want to know how often i screwed up even with tabcompletion :P
[16:06:52] darix: also your nick would look better with the 0 instead of the o
[16:07:00] darix: please fix
[16:11:10] hahuang61: has joined #ruby
[16:11:28] alfiemax: has joined #ruby
[16:13:40] sanscoeur: has joined #ruby
[16:18:51] willmichael: has joined #ruby
[16:22:01] mtkd: has joined #ruby
[16:23:22] troys: has joined #ruby
[16:27:16] n008f4g_: has joined #ruby
[16:30:36] pyther: apeiros: thanks, I think it appears to be localization. I didn't realize you could define a function as '_'. I thought the underscore had some special meaning in ruby.
[16:32:59] ltt: has joined #ruby
[16:34:11] apeiros: pyther: it doesn't. it works like a lowercase character.
[16:34:29] GinoMan: has joined #ruby
[16:34:56] synthroid: has joined #ruby
[16:36:22] ramfjord: has joined #ruby
[16:36:56] yokel: has joined #ruby
[16:45:01] Cavallari: has joined #ruby
[16:45:46] bmurt: has joined #ruby
[16:52:51] cthulchu: has joined #ruby
[16:54:01] mtkd: has joined #ruby
[16:58:24] jenrzzz: has joined #ruby
[16:59:11] Zaab1t: has joined #ruby
[17:00:14] cdg: has joined #ruby
[17:06:11] tubbo: has joined #ruby
[17:10:49] cout: wow, instance_variable_set is really slow
[17:12:26] jcarl43: has joined #ruby
[17:12:51] havenwood: cout: They just added it to things that MJIT can optimize.
[17:13:23] hahuang61: has joined #ruby
[17:14:04] cout: havenwood: oh cool
[17:14:20] havenwood: cout: https://github.com/ruby/ruby/commit/0a2fb188e397d69a2b68d98b797fe0b68d4d11ee
[17:14:49] aufi: has joined #ruby
[17:14:49] cout: I wouldn't expect it to be optimizable in MRI since it's just a method call to C
[17:16:51] tubbo: has joined #ruby
[17:34:18] Xiti`: has joined #ruby
[17:34:56] alfiemax: has joined #ruby
[17:46:23] ldnunes: has joined #ruby
[17:50:09] sanscoeur: has joined #ruby
[17:51:07] alfiemax: has joined #ruby
[17:54:30] mrush: has joined #ruby
[17:55:07] mrush: anyone know of a ruby alternative to pandoc? i want to convert html -> md
[17:55:25] kanobt61: has joined #ruby
[17:55:47] mrush: i dont think i can justify the 13G of haskel libs required to use pandoc, lol
[18:00:53] mtkd: has joined #ruby
[18:02:52] schneider: has joined #ruby
[18:03:02] havenwood: mrush: it looks like reverse_markdown or upmark are options - i've used neither
[18:03:28] rgiscard: has joined #ruby
[18:03:48] havenwood: mmm, upmark uses parslet
[18:04:21] alfiemax: has joined #ruby
[18:06:04] bigblind: has joined #ruby
[18:07:58] nowhereman_: has joined #ruby
[18:09:17] mikecmpbll: has joined #ruby
[18:12:51] John_Ivan: has joined #ruby
[18:12:51] John_Ivan: has joined #ruby
[18:17:03] alfiemax: has joined #ruby
[18:18:25] dwcraig: has joined #ruby
[18:33:43] psychicist__: has joined #ruby
[18:34:05] alfiemax: has joined #ruby
[18:34:19] ramfjord: has joined #ruby
[18:35:29] tolerablyjake: has joined #ruby
[18:35:36] jeffreylevesque: has joined #ruby
[18:35:57] eckhardt_: has joined #ruby
[18:35:58] tolerablyjake: has joined #ruby
[18:42:22] tolerablyjake: has joined #ruby
[18:45:43] claudiuinberlin: has joined #ruby
[18:46:16] pilne: has joined #ruby
[18:53:23] drewmcmillan: has joined #ruby
[18:59:25] kliq: has joined #ruby
[19:02:31] mooser: has joined #ruby
[19:07:24] Dimik: has joined #ruby
[19:10:16] clemens3: has joined #ruby
[19:12:08] alfiemax: has joined #ruby
[19:13:14] ramfjord: has joined #ruby
[19:17:57] ltt: has joined #ruby
[19:23:42] kies: has joined #ruby
[19:23:54] ldepandis: has joined #ruby
[19:25:22] alfiemax: has joined #ruby
[19:29:59] gnufied: has joined #ruby
[19:30:03] segy_: has joined #ruby
[19:31:01] rrutkowski: has joined #ruby
[19:31:37] orbyt_: has joined #ruby
[19:32:53] mooser: has joined #ruby
[19:35:07] shinnya: has joined #ruby
[19:35:15] ltem: has joined #ruby
[19:35:58] ryandv: has joined #ruby
[19:38:15] alfiemax: has joined #ruby
[19:38:17] tolerablyjake: has joined #ruby
[19:43:28] amatas: has joined #ruby
[19:47:59] amatas: has joined #ruby
[19:50:14] tolerablyjake: has joined #ruby
[19:53:07] speakingcode: has joined #ruby
[19:56:38] sameerynho: has joined #ruby
[19:57:32] ramfjord: has joined #ruby
[19:59:20] alfiemax: has joined #ruby
[19:59:21] mooser: has joined #ruby
[19:59:59] segy: has joined #ruby
[20:01:29] tubbo: has joined #ruby
[20:01:43] willmichael: has joined #ruby
[20:01:56] claudiuinberlin: has joined #ruby
[20:04:52] tvw: has joined #ruby
[20:10:24] CalimeroTeknik: has joined #ruby
[20:10:38] tubbo`: has joined #ruby
[20:11:25] memo1: has joined #ruby
[20:11:36] Code4Dopamine: has joined #ruby
[20:12:42] riotjoe: has joined #ruby
[20:12:55] tvw: has joined #ruby
[20:13:13] CalimeroTeknik: `puts foo` outputs {:bar=>"baz"} in some program. how to access the field foo.bar? `puts foo.bar` says Listener error: undefined method `bar' for #<Hash:0x007f80636e33f0>
[20:13:14] tubbo: has joined #ruby
[20:14:32] phaul: CalimeroTeknik: catch call with method_missing, check if name is key, return value
[20:14:49] phaul: it's all dirty hacking, but I guess it's fine here
[20:14:52] milardovich: has joined #ruby
[20:15:16] CalimeroTeknik: uh, how do I access a "key"?
[20:15:33] CalimeroTeknik: foo["bar"] produced the same effect
[20:16:00] phaul: you need to open up the Hash class for monkey patching. define a method_missing function in there
[20:16:24] alfiemax: has joined #ruby
[20:16:37] CalimeroTeknik: I stand corrected, foo["bar"] seems to output an empty string instead
[20:17:51] CalimeroTeknik: I don't think I need any hacking, just how to access fields in parsed yaml
[20:18:03] CalimeroTeknik: super basic basics but I don't even know the syntax
[20:18:13] memo1: has joined #ruby
[20:18:26] phaul: I read too much into your question sorry. Ingore what I said
[20:18:35] dviola: has joined #ruby
[20:19:16] CalimeroTeknik: no worries, I understand it, I just lack syntax basics in ruby; how could I access a key?
[20:19:19] phaul: to access :foo in h = { :foo => "bar" } use h[:foo]
[20:19:47] phaul: >> h = { :foo => "bar"} ; h[:foo]
[20:19:48] ruby[bot]: phaul: # => "bar" (https://eval.in/969545)
[20:21:09] CalimeroTeknik: I was becoming afraid of having a bad case of https://xkcd.com/1912/
[20:21:44] CalimeroTeknik: when I ask for a field in a data structure and it errors out saying undefined method, you gotta admit…
[20:22:23] phaul: "." in ruby always denotes a method call
[20:22:41] phaul: that's what lead the interpreter ( and me :D ) on the wrong path
[20:23:54] rrutkowski: has joined #ruby
[20:28:40] rrutkowski: has joined #ruby
[20:33:12] alfiemax: has joined #ruby
[20:34:16] nowhereman_: has joined #ruby
[20:37:28] dionysus69: has joined #ruby
[20:39:11] memo1: has joined #ruby
[20:39:22] imode: has joined #ruby
[20:40:39] sidx64: has joined #ruby
[20:43:03] riotjones: has joined #ruby
[20:43:24] tvw: has joined #ruby
[20:46:07] tubbo`: has joined #ruby
[20:46:55] mcr1: has joined #ruby
[20:49:19] sidx64_: has joined #ruby
[20:49:26] eckhardt_: has joined #ruby
[20:49:50] caoraivoso: has left #ruby: ()
[20:51:42] workmad3: has joined #ruby
[20:53:57] tvw: has joined #ruby
[20:56:12] ramfjord: has joined #ruby
[20:57:27] mooser: has joined #ruby
[21:00:41] bigblind: has joined #ruby
[21:01:11] segy_: has joined #ruby
[21:03:45] nowhere_man: has joined #ruby
[21:03:50] zapata: has joined #ruby
[21:06:19] troulouliou_dev: has joined #ruby
[21:06:44] tcopeland: has joined #ruby
[21:08:08] ramfjord: has joined #ruby
[21:13:25] milardovich: has joined #ruby
[21:14:40] eckhardt_: has joined #ruby
[21:15:11] SeepingN: has joined #ruby
[21:22:13] darkhanb: has joined #ruby
[21:28:53] alfiemax: has joined #ruby
[21:29:53] gizmore: why everyone is copying active record... and rails .... it sucks
[21:30:13] gizmore: i made way better DBA in a couple of hours
[21:30:50] bmurt: has joined #ruby
[21:30:52] gizmore: Rule of thumb: everything is a string
[21:30:58] Lytol: has joined #ruby
[21:32:20] ramfjord: has joined #ruby
[21:32:58] segy_: has joined #ruby
[21:33:16] eckhardt_: has joined #ruby
[21:37:46] schneider: has joined #ruby
[21:38:50] darix: gizmore: using DB datatypes instead of strings can have many advantages
[21:39:12] gizmore: in my GDO DBA
[21:39:18] gizmore: i have own types
[21:39:37] gizmore: like GDT_Timestamp, GDT_Date, GDT_DateTime, GDT_GeoPosition
[21:39:54] gizmore: all make use of the mysql below/up
[21:40:01] gizmore: they know how to behave
[21:40:20] gizmore: the DBA, the html, the json, all is handled by each GDT
[21:41:52] alfiemax: has joined #ruby
[21:42:58] darkhanb: has joined #ruby
[21:45:36] tAn: has joined #ruby
[21:45:57] jenrzzz: has joined #ruby
[21:48:46] ledestin: has joined #ruby
[21:49:43] aufi: has joined #ruby
[21:51:42] dmitriy_: has joined #ruby
[21:57:40] bmurt: has joined #ruby
[21:57:56] ramfjord: has joined #ruby
[21:59:25] segy_: has joined #ruby
[22:00:12] tcopeland: has joined #ruby
[22:08:16] icarus: has joined #ruby
[22:13:14] guardianx: has joined #ruby
[22:14:08] donkey_boy: has joined #ruby
[22:14:52] donkey_boy: urine is pillaging innocent children
[22:15:59] darkhanb_: has joined #ruby
[22:16:08] bigblind: has joined #ruby
[22:17:13] coderphive: has joined #ruby
[22:17:24] segy_: has joined #ruby
[22:19:25] thinkpad: has joined #ruby
[22:19:58] alfiemax: has joined #ruby
[22:20:31] drakko: has joined #ruby
[22:23:36] wnd: has joined #ruby
[22:23:57] erlend: has joined #ruby
[22:23:57] donkey_boy: has left #ruby: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[22:24:48] marr: has joined #ruby
[22:25:08] ryandv: has joined #ruby
[22:27:00] pilne: would anyone in here happen to know what is going on with ruboto? or would that be more of a jruby thing?
[22:27:23] gizmore: pilne: just ask
[22:27:36] pilne: it it still being maintained?
[22:28:02] dwcraig_: has joined #ruby
[22:28:03] dmitriy_: has joined #ruby
[22:28:37] pwillard_: has joined #ruby
[22:28:57] andywojo: has joined #ruby
[22:29:14] fmccann: has joined #ruby
[22:29:15] jmhmccr: has joined #ruby
[22:29:41] justinweiss: has joined #ruby
[22:30:06] foamz: has joined #ruby
[22:30:50] stephenh: has joined #ruby
[22:31:08] jabreity: has joined #ruby
[22:31:14] maciuszek: has joined #ruby
[22:32:58] alfiemax: has joined #ruby
[22:33:04] dmitriy_: has joined #ruby
[22:33:23] eckhardt_: has joined #ruby
[22:33:48] redondos: has joined #ruby
[22:38:06] dmitriy_: has joined #ruby
[22:38:21] banisterfiend: has joined #ruby
[22:41:50] mooser: has joined #ruby
[22:43:06] dmitriy_: has joined #ruby
[22:43:20] jcarl43: has joined #ruby
[22:45:24] mniip: has joined #ruby
[22:45:38] ryandv: has joined #ruby
[22:48:08] dmitriy_: has joined #ruby
[22:49:52] Dimik: has joined #ruby
[22:50:00] alfiemax: has joined #ruby
[22:52:14] workmad3: has joined #ruby
[22:53:08] dmitriy_: has joined #ruby
[22:53:28] chouhoul_: has joined #ruby
[22:55:49] mlehrer: has joined #ruby
[22:55:52] zacts: has joined #ruby
[22:58:05] dmitriy_: has joined #ruby
[22:59:50] jenrzzz: has joined #ruby
[22:59:50] jenrzzz: has joined #ruby
[23:02:25] alfiemax: has joined #ruby
[23:03:08] dmitriy_: has joined #ruby
[23:06:51] zenspider: has joined #ruby
[23:07:55] ramfjord: has joined #ruby
[23:08:08] dmitriy_: has joined #ruby
[23:11:22] tcopeland: has joined #ruby
[23:13:08] dmitriy_: has joined #ruby
[23:13:29] Paraxial: has joined #ruby
[23:15:21] alfiemax: has joined #ruby
[23:15:42] baweaver: ohai miah, zenspider
[23:16:48] slde_track: has joined #ruby
[23:18:05] dmitriy_: has joined #ruby
[23:19:45] miah: whats up?
[23:21:14] Vapez: has joined #ruby
[23:23:25] dmitriy_: has joined #ruby
[23:25:39] willmichael: has joined #ruby
[23:28:09] dmitriy_: has joined #ruby
[23:28:31] alfiemax: has joined #ruby
[23:28:54] kapil___: has joined #ruby
[23:30:47] baweaver: Making popovers in JS
[23:31:13] shinnya: has joined #ruby
[23:31:46] sanscoeur: has joined #ruby
[23:32:41] wlarip: has joined #ruby
[23:33:08] dmitriy_: has joined #ruby
[23:33:31] darkhanb: has joined #ruby
[23:38:07] dmitriy_: has joined #ruby
[23:42:15] cadillac_: has joined #ruby
[23:46:50] dmitriy_: has joined #ruby
[23:51:46] dmitriy_: has joined #ruby
[23:54:24] segy: has joined #ruby
[23:56:49] dmitriy_: has joined #ruby