« Back to channel list

#ruby - 19 February 2018

« Back 1 day Forward 1 day »
[00:02:14] alfiemax: has joined #ruby
[00:04:21] nowhere_man: has joined #ruby
[00:04:33] tAn: has joined #ruby
[00:08:49] eckhardt: has joined #ruby
[00:08:57] john__: has joined #ruby
[00:09:32] john__: has joined #ruby
[00:10:23] drewmcmillan: has joined #ruby
[00:12:11] John_Ivan: has joined #ruby
[00:12:12] John_Ivan: has joined #ruby
[00:15:23] randyn: has joined #ruby
[00:15:49] jnyw: has joined #ruby
[00:17:01] arescorpio: has joined #ruby
[00:18:23] randyn: hi there, is there anyone here familiar with TarWRiter and TarReader? My question can be seen here: https://stackoverflow.com/questions/48856240/appending-files-to-a-stringio-tar-archive-one-at-a-time
[00:19:21] alfiemax: has joined #ruby
[00:19:30] ineb: has joined #ruby
[00:36:26] alfiemax: has joined #ruby
[00:48:46] tAn: has joined #ruby
[00:50:57] cagomez: has joined #ruby
[00:55:13] s3nd1v0g1us: has joined #ruby
[00:57:32] alfiemax: has joined #ruby
[01:02:11] jenrzzz: has joined #ruby
[01:02:11] jenrzzz: has joined #ruby
[01:03:41] eckhardt: has joined #ruby
[01:05:13] war_pigs: has joined #ruby
[01:09:29] jordanm: has joined #ruby
[01:16:47] skweek: has joined #ruby
[01:18:32] ptx0: has joined #ruby
[01:31:56] alfiemax: has joined #ruby
[01:43:57] lavamind: has joined #ruby
[01:44:19] tAn: has joined #ruby
[01:44:39] lavamind: hello, I'd like to know, in a Gemfile, how to require a gem condtionally based on the (latest) version of another gem
[01:44:59] torin_: has joined #ruby
[01:45:05] lavamind: go if gem A version > 2.0, then gem B should have :require => false
[01:45:43] lavamind: I already use groups in my Gemfile but I'm wondering if there's a way to solve this without using groups
[01:48:16] gary: has joined #ruby
[01:49:01] alfiemax: has joined #ruby
[01:50:00] nadir: has joined #ruby
[01:55:24] konsolebox: has joined #ruby
[02:09:55] alfiemax: has joined #ruby
[02:11:02] drewmcmillan: has joined #ruby
[02:14:40] vutral|kali: has joined #ruby
[02:14:40] vutral|kali: has joined #ruby
[02:22:12] tAn: has joined #ruby
[02:22:51] gary: has joined #ruby
[02:22:53] alfiemax: has joined #ruby
[02:24:04] erlend: has joined #ruby
[02:28:46] schneide_: has joined #ruby
[02:29:37] hndk: has joined #ruby
[02:33:33] hfp_work: has joined #ruby
[02:35:29] gary_: has joined #ruby
[02:36:57] gizmore: has joined #ruby
[02:38:02] aguestuser: has joined #ruby
[02:40:06] alfiemax: has joined #ruby
[02:42:55] aintno_sunshine: has joined #ruby
[02:46:38] braderhart: has joined #ruby
[02:46:45] Gary_B: has joined #ruby
[02:46:58] schneide_: has joined #ruby
[02:49:36] war_pigs: has joined #ruby
[02:53:14] alfiemax: has joined #ruby
[02:55:31] Gary_B: has joined #ruby
[02:59:36] cdg: has joined #ruby
[03:01:13] yxhuvud: has joined #ruby
[03:01:13] hfp_work: has joined #ruby
[03:04:00] eblip: has joined #ruby
[03:04:13] def_jam: has joined #ruby
[03:06:42] tAn: has joined #ruby
[03:09:53] orbyt_: has joined #ruby
[03:14:48] alfiemax: has joined #ruby
[03:17:53] memo1: has joined #ruby
[03:19:02] memo1: hi. I need to use a regex this way /test/ but my test have quotes "test". How i remove the quotes to use the regex?
[03:20:23] Vashy: try this /\"test\"/
[03:24:16] memo1: Vashy: thank you. Is not working
[03:26:49] Vashy: can you show the code?
[03:29:26] memo1: Vashy: https://gist.github.com/anonymous/777df249315a576fa2dfb421e26702e3
[03:30:14] Vashy: what is argv[0]
[03:30:15] memo1: Vashy: is a simple code to find word in a webpage. i run the code ruby webscrapping.rb word, and it must find the word in the webpage
[03:30:41] memo1: Vashy: im trying to capture the varible on console
[03:31:06] govg: has joined #ruby
[03:31:27] memo1: Vashy: the regex /test/ dont works with " "
[03:35:32] Vashy: memo1, what's the exact thing you pass in? "word" ??
[03:37:36] memo1: Vashy: ruby test.rb test. But when i get a = ARGV[0] i get a String "test". When i use /"test"/ is not the same as /test/. The last one works
[03:38:09] memo1: Vashy: i need to convert "test" to test
[03:39:08] Vashy: hm, I don't think that's what you want
[03:40:05] cdg: has joined #ruby
[03:40:35] Vashy: I don't think the word "test" is in the html document
[03:42:12] memo1: Vashy: oh, sure, you can use the word tras
[03:42:23] memo1: Vashy: a spanish word
[03:43:05] memo1: Vashy: i just try to explain with an example. But if you remove the AARV[0] form the regext and use tras, it works
[03:43:34] memo1: Vashy: but, if you use "tras" it fails
[03:45:14] Vashy: ah ok I see what you're saying now
[03:45:52] Vashy: hm one sec let me check
[03:46:13] Vashy: I think you have to use a regex object if I remember correctly
[03:46:14] memo1: Vashy: thank you
[03:46:48] memo1: Vashy: Im searching on google, but regex is really confusing to me.
[03:47:02] Vashy: no worries, this is a pretty common task, we can solve it
[03:47:10] memo1: Vashy: i just try to remove the "
[03:48:37] Vashy: ok memo1 figured it out
[03:48:55] Vashy: you want to do: Regexp.new(ARGV[0]) instead of /ARGV[0]/
[03:49:13] lunarkitty7: has joined #ruby
[03:49:22] Vashy: let me know if that doesn't work
[03:51:14] tAn: has joined #ruby
[03:51:34] memo1: Vashy: Wow, it works!. Thank you. Regexp is a class?
[03:51:50] Vashy: yeah it's part of standard Ruby
[03:53:08] memo1: Vashy: im pretty new to Ruby. if a want to learn about Regexp, how i use ri or the local docs to learn?,
[03:53:32] aguestuser: has joined #ruby
[03:53:57] memo1: Vashy: ri Regexp, "nothing known about Regexp
[03:54:08] Vashy: oh neat I didn't know about "ri" that's cool! =)
[03:54:52] Vashy: so most languages have support for Regex so I think you'll be okay with just googling mostly
[03:55:09] Vashy: but learning regex in general might help you
[03:55:32] Vashy: https://www.regexone.com/ here's an interactive tutorial
[03:56:05] gary: has joined #ruby
[03:56:26] alfiemax: has joined #ruby
[03:56:41] Vashy: you can use the "Lesson Notes" section on the right side to choose the topic you're interested in
[03:57:25] memo1: Vashy: Thank you friend!.
[03:57:34] Vashy: no problem, happy to help
[04:11:03] howdoi: has joined #ruby
[04:25:15] trautwein: has joined #ruby
[04:27:16] tAn: has joined #ruby
[04:35:03] gary: has joined #ruby
[04:36:28] havenwood: require 'matrix'; [*4.times.map { |n| n.succ ** 4 % 19 + 96 }, *20.times.map { |n| 100 + (Matrix[[0, 1], [1, 1]] ** n)[1, 1] % 10 + 10 }.last(3)].pack('C*')
[04:40:15] gary_: has joined #ruby
[04:51:53] moeSizlak: has left #ruby: ("Leaving")
[04:54:36] brandedcandy: has joined #ruby
[04:59:39] gix: has joined #ruby
[05:04:33] tAn: has joined #ruby
[05:04:46] ephemera__: has joined #ruby
[05:06:25] Gary_B: has joined #ruby
[05:08:23] alfiemax: has joined #ruby
[05:17:53] Matthew1: has joined #ruby
[05:18:08] zkv: has joined #ruby
[05:18:51] zkv: has joined #ruby
[05:24:12] darkhanb: has joined #ruby
[05:34:35] jnollette_: has joined #ruby
[05:37:32] vondruch: has joined #ruby
[05:39:58] b100s: has left #ruby: ("Leaving")
[05:43:52] jeffreylevesque: has joined #ruby
[05:45:22] eckhardt: has joined #ruby
[05:45:31] gary: has joined #ruby
[05:46:23] pabs: has joined #ruby
[05:51:08] sanscoeur: has joined #ruby
[05:51:32] darkhanb: has joined #ruby
[05:59:15] tAn: has joined #ruby
[06:04:51] cdg: has joined #ruby
[06:11:57] dionysus69: has joined #ruby
[06:16:13] anisha: has joined #ruby
[06:16:14] darkhanb: has joined #ruby
[06:17:33] gary_: has joined #ruby
[06:21:17] alfiemax: has joined #ruby
[06:34:02] alfiemax: has joined #ruby
[06:35:45] dminuoso: havenwood: Use lambdas.
[06:35:50] dminuoso: ACTION spanks havenwood with a stabby lambda
[06:40:15] alfiemax: has joined #ruby
[06:43:09] tAn: has joined #ruby
[06:47:18] cliq: has joined #ruby
[06:50:01] gary: has joined #ruby
[07:00:12] roshanavand: has joined #ruby
[07:06:57] kliq: has joined #ruby
[07:13:52] KeyJoo: has joined #ruby
[07:16:35] darkhanb: has joined #ruby
[07:23:08] alfiemax_: has joined #ruby
[07:23:33] guardianx: has joined #ruby
[07:23:47] gary_: has joined #ruby
[07:27:25] guardianx: has joined #ruby
[07:30:34] conta: has joined #ruby
[07:32:37] minimalism: has joined #ruby
[07:35:27] maum: has joined #ruby
[07:35:47] rabajaj: has joined #ruby
[07:38:16] mtkd: has joined #ruby
[07:47:54] n008f4g_: has joined #ruby
[07:49:28] Dimik: has joined #ruby
[07:55:09] gary: has joined #ruby
[07:56:57] andikr: has joined #ruby
[07:57:27] despai: has joined #ruby
[07:58:23] gr33n7007h: has joined #ruby
[07:58:47] schneide_: has joined #ruby
[08:05:15] guardianxx: has joined #ruby
[08:08:31] alfiemax: has joined #ruby
[08:09:47] tvw: has joined #ruby
[08:11:10] schneide_: has joined #ruby
[08:11:43] b0nn: has joined #ruby
[08:11:45] x0F: has joined #ruby
[08:12:24] b0nn: has left #ruby: ()
[08:16:10] LocaMocha: has joined #ruby
[08:16:33] alfiemax: has joined #ruby
[08:17:52] tAn: has joined #ruby
[08:18:12] gary_: has joined #ruby
[08:18:43] x0F: has joined #ruby
[08:20:00] LocaMocha: has joined #ruby
[08:25:54] aufi: has joined #ruby
[08:26:32] vondruch: has joined #ruby
[08:27:37] LocaMocha: has joined #ruby
[08:30:04] vondruch: has joined #ruby
[08:31:00] mtkd: has joined #ruby
[08:33:53] apeiros: has joined #ruby
[08:34:08] vutral|kali: can someone fix my regex ? /:(\w|\.|\!|\@+) PRIVMSG (\w|\#+) :(.*)/.match(line)
[08:35:22] iceskins[m]: has joined #ruby
[08:35:37] dminuoso: vutral|kali: How about zou tell us whats wrong with it.
[08:35:46] dminuoso: Make a testcase.
[08:35:57] dminuoso: Surely you can reduce the regex to the single portion you cant make sense of.
[08:36:33] vutral|kali: it shoudl match :user!ident@host PRIVMSG #channel :bla
[08:36:53] dminuoso: vutral|kali: So reduce the regex to the portion that doesn't work?
[08:37:07] vutral|kali: matching multiple cases doesnt work
[08:37:23] dminuoso: I dont like "Here's a big regex - something doesn't match" because it implies you have not tried to split it into small testable pieces.
[08:38:14] dminuoso: vutral|kali: There's multiple mistakes in your regex, so just reduce it to
[08:38:31] dminuoso: "#channel" being matched by /(\w|\#+)/
[08:39:16] dminuoso: / /(\w|\#+)/ means "a single word character _OR_ (1 or more '#')"
[08:39:26] dminuoso: This probably is not what you intended.
[08:42:20] aupadhye: has joined #ruby
[08:43:54] vutral|kali: rubular.com says my expression should work
[08:44:49] apeiros: vutral|kali: it's unlikely that you'll come up with a correct regex for irc messages.
[08:45:21] vutral|kali: :([\w|\.|\!|\@]+) PRIVMSG ([\w|\#]+) :(.*)
[08:45:23] apeiros: one reason being that the correctness depends on server settings communicated during connecting to the server
[08:45:52] vutral|kali: what do you mean
[08:45:55] apeiros: [\w|\#] <-- in a character class, the | is a literal pipe, not an "or"
[08:46:02] apeiros: [ab] already is "a" or "b"
[08:46:03] dminuoso: vutral|kali: So you allow for a##aaa# as a channel name
[08:46:08] apeiros: and [a|b] is "a", "b" or "|"
[08:46:18] vutral|kali: i know its not perfect
[08:46:27] dminuoso: vutral|kali: No its not just "not perfect" its just "wrong"
[08:46:31] apeiros: vutral|kali: I mean that irc messages only seem simple. they are not.
[08:46:55] vutral|kali: apeiros, i still can match channels for correctness later
[08:47:46] dminuoso: vutral|kali: Wrong regular expressions mean you accept wrong input. Accepting wrong input means your program has a good basis for misbehaving.
[08:48:05] dminuoso: vutral|kali: Either you intend to pattern match, then do it right, or dont do it at all and just split on whitespace.
[08:48:08] apeiros: vutral|kali: channelnames are actually one thing where you can't use a generic expression, as max channel name length is one of the things communicated when you first connect
[08:48:19] apeiros: also iirc valid channelname prefixes
[08:48:45] apeiros: let me see whether I find my set of expressions…
[08:48:56] dminuoso: apeiros: In all fairness it's not inherently wrong to separate tokenization and semantic checking
[08:49:09] claudiuinberlin: has joined #ruby
[08:50:00] apeiros: dminuoso: yeah, sure, but then not even # would be a part
[08:50:14] vutral|kali: thats correct
[08:50:22] vutral|kali: its a nick sometimes not a channel
[08:50:23] apeiros: as in, your "allow for a##aaa#" would be part of semantic checking too
[08:51:15] apeiros: fun fact: freenode sometimes has users with invalid nicknames (in case of collisions, their ircd sometimes uses invalid replacement nicks)
[08:52:30] dminuoso: vutral|kali: So just do something along the lines of /(?<source>\w+) PRIVMSG (?<target>\w+) (?<message>\w+)/
[08:52:41] apeiros: vutral|kali: https://gist.github.com/apeiros/9dd2fde5bfec926e5e92b2f9faa80697#file-butler_irc_parser-rb-L78-L90
[08:53:06] dminuoso: What is that.
[08:53:20] RougeR: has joined #ruby
[08:53:28] apeiros: the thing powering ruby[bot]
[08:53:48] apeiros: it's irc v3.2 capable (not that freenode would support that already :< )
[08:53:53] clemens3: has joined #ruby
[08:54:00] dminuoso: apeiros: I wonder, are there any monadic parser combinators?
[08:54:26] apeiros: note the "HURRAY" statements
[08:54:31] dminuoso: https://github.com/gosukiwi/parser-combinator
[08:54:38] marr: has joined #ruby
[08:55:20] dminuoso: apeiros: Heh
[08:55:36] apeiros: that seems to be doable with plain regex in ruby? as they're perfectly composable.
[08:55:46] dminuoso: apeiros: not exactly
[08:56:02] apeiros: an example of what doesn't work?
[08:56:34] dminuoso: apeiros: You could do something like..
[08:57:04] dminuoso: apeiros: `token p = p <* spaces`
[08:57:15] apeiros: yeah, in words, not in cryptic
[08:57:26] apeiros: I can't know what '<*' means in that context.
[08:57:31] dminuoso: apeiros: sec
[08:57:47] apeiros: but yeah, recursive is difficult / requires creativity :D
[08:58:01] dminuoso: apeiros: So lets say you have a regex that knows how to extract an "identifier", and you have a regex that knows how to extract spaces - how do you combine them into a regex that extracts an identifier _and_ spaces, but disregards the spaces?
[08:58:44] apeiros: /#{spaces}(#{identifier})#{spaces}/
[08:59:00] apeiros: if by extract you mean "advances the cursor"
[08:59:05] dminuoso: apeiros: Except that just matches - but doesn't build.
[08:59:11] dminuoso: apeiros: It doesnt produce results
[08:59:24] apeiros: um, yes? of course?
[08:59:53] apeiros: a regex never will produce results on its own. so kinda stating the obvious?
[09:00:01] dminuoso: apeiros: That's my point. ;-)
[09:00:11] apeiros: neither will a parser?
[09:00:27] dminuoso: apeiros: parser combinators do
[09:00:27] apeiros: you have to "use" it at some point
[09:00:45] dminuoso: apeiros: That's the thing, you can talk about results without having to use it
[09:00:53] dminuoso: let me show you how it would look in ruby
[09:01:04] TvL2386: has joined #ruby
[09:08:10] tAn: has joined #ruby
[09:11:51] guille-moe: has joined #ruby
[09:12:27] amatas: has joined #ruby
[09:19:10] tAn: has joined #ruby
[09:19:21] beauby: has joined #ruby
[09:22:42] cdg: has joined #ruby
[09:24:06] cdg_: has joined #ruby
[09:27:02] ams__: has joined #ruby
[09:30:06] tAn: has joined #ruby
[09:30:49] aupadhye: has joined #ruby
[09:31:28] n13z: has joined #ruby
[09:38:00] gary: has joined #ruby
[09:39:11] gregf_: has joined #ruby
[09:43:04] gary_: has joined #ruby
[09:46:16] dminuoso: apeiros: Haha. I need to think about how to do mutual recursion in Ruby.
[09:46:31] dminuoso: Im missing the most crucial combinator
[09:47:33] tAn: has joined #ruby
[09:48:11] alfiemax: has joined #ruby
[09:48:13] apeiros: more complex than expected? :)
[09:48:43] dminuoso: apeiros: well let me show you what I have already
[09:51:23] dminuoso: apeiros: This is the basic idea: https://gist.github.com/dminuoso/71a4ed1e7c4e01501fa1739724001d2e
[09:51:46] dminuoso: https://gist.github.com/dminuoso/8d1f34fcb679941efdd47efa9ff4d11f
[09:52:44] dminuoso: apeiros: Lets assume for a second that some/many worked, then you could incrementally build up parsers like: number = many.(digit)
[09:53:08] dminuoso: or space = satisfy.(-> e { e =~ /\s/ })
[09:53:28] dminuoso: and a parser that consumes many spaces: spaces = many.(spaces)
[09:56:02] apeiros: and what's your advantage over /\d+/ (consuming) and /(?=\d+)/ (non-consuming)?
[09:56:50] dminuoso: apeiros: Let me build a few more combinators, and then reimplement your parser
[09:57:17] apeiros: I wish I had as much time as you seem to have for such things :D
[09:58:02] dminuoso: apeiros: I wanted a parser combinator library for one of our ruby things anyway. :D
[09:59:30] Serpent7776: has joined #ruby
[10:03:44] Gary_B: has joined #ruby
[10:07:24] jenrzzz: has joined #ruby
[10:10:34] tomlukeywood: has joined #ruby
[10:13:13] Gary_B: has joined #ruby
[10:16:14] jaruga: has joined #ruby
[10:16:39] tomlukeywood: has joined #ruby
[10:17:14] dionysus69: has joined #ruby
[10:24:25] milardovich: has joined #ruby
[10:29:10] Chuguniy: has joined #ruby
[10:29:35] GodFather: has joined #ruby
[10:29:54] Megamosaren: has joined #ruby
[10:39:36] Skoom: has joined #ruby
[10:43:39] gary: has joined #ruby
[10:46:29] mtkd: has joined #ruby
[10:48:58] gary_: has joined #ruby
[10:53:02] amatas_: has joined #ruby
[11:00:36] dvdingus: has joined #ruby
[11:02:08] amatas_: has joined #ruby
[11:02:34] drewmcmillan: has joined #ruby
[11:08:50] apparition: has joined #ruby
[11:11:32] pabs: has joined #ruby
[11:14:23] Chuguniy: has joined #ruby
[11:18:47] Cavallari: has joined #ruby
[11:19:43] Cavallari1: has joined #ruby
[11:23:06] Gary_B: has joined #ruby
[11:23:34] Matthew1: has joined #ruby
[11:29:01] Cavallari1: has joined #ruby
[11:34:35] zapata: has joined #ruby
[11:36:42] ldnunes: has joined #ruby
[11:39:33] Cavallari: has joined #ruby
[11:39:38] cdg: has joined #ruby
[11:39:51] tAn: has joined #ruby
[11:42:56] ldnunes: has joined #ruby
[11:43:19] gary: has joined #ruby
[11:47:32] drewmcmillan: has joined #ruby
[11:51:28] AJA4350: has joined #ruby
[11:52:22] jenrzzz: has joined #ruby
[11:52:23] milardovich: has joined #ruby
[11:55:04] chocoelho: has joined #ruby
[11:58:45] John_Ivan: has joined #ruby
[11:58:45] John_Ivan: has joined #ruby
[12:01:03] jenrzzz: has joined #ruby
[12:01:55] workmad3: has joined #ruby
[12:02:19] gary_: has joined #ruby
[12:02:46] drewmcmillan: has joined #ruby
[12:04:06] nowhereman_: has joined #ruby
[12:09:37] nadir: has joined #ruby
[12:12:11] OyoKooN: has joined #ruby
[12:13:29] apeiros_: has joined #ruby
[12:13:46] jenrzzz: has joined #ruby
[12:19:20] Cavallari1: has joined #ruby
[12:19:43] beauby: has joined #ruby
[12:22:03] drewmcmillan: has joined #ruby
[12:22:18] arne_: has joined #ruby
[12:22:22] arne_: hello fellow rubiest
[12:22:25] jenrzzz: has joined #ruby
[12:22:25] jenrzzz: has joined #ruby
[12:22:41] arne_: im really unhappy with all existing ways to handle websockets in ruby
[12:22:51] arne_: would it be in any way stupid to build a c extensionf or thath?
[12:24:40] apeiros_: arne_: it seems unnecessary
[12:24:47] apeiros_: what benefit to you expect from a C extension?
[12:25:48] Cavallari1: has joined #ruby
[12:27:08] arne_: apeiros: performance... and nicer way to do it?
[12:27:21] arne_: because existing ones require weird rack session hijacking?
[12:28:27] arne_: and i am guessing those would not be rack-implementation agnostic, meaning i can't switch from one webserver to another
[12:29:29] apeiros: arne_: you'll almost certainly not have any notable performance benefit
[12:30:24] apeiros: I suspect the issue is more with how it's forced through an infrastructure which isn't built for websockets (rack in your example)
[12:30:57] apeiros: and building a native extension won't magically make those problems go away. you're still on the same architecture there.
[12:32:18] dminuoso: apeiros: This is freaking hard without a type checker..
[12:33:11] havenwood: arne_: Have you checked out AnyCable?: http://anycable.io/
[12:35:02] shinnya: has joined #ruby
[12:35:17] gary: has joined #ruby
[12:35:21] apeiros: dminuoso: you mean the parser project?
[12:39:33] arne_: uhhh cool havenwood
[12:39:43] arne_: well, there is this webframework i really like
[12:39:48] arne_: and it uses rack
[12:39:55] arne_: i would love it so much if it had websockets
[12:40:26] havenwood: arne_: What framework?
[12:40:45] arne_: i mean it has websockets, using faye
[12:40:48] arne_: but that sucks
[12:40:52] havenwood: arne_: Roda is probably my favorite.
[12:41:42] havenwood: arne_: You can use AnyCable with Roda.
[12:41:47] arne_: just as sequel, i love jeremyevans
[12:42:04] arne_: havenwood: as i understood it, anycable is just a way to "route" websockets?
[12:42:08] havenwood: Here's a Sinatra example with AnyCable: https://github.com/palkan/litecable/tree/master/examples/sinatra
[12:42:09] arne_: what would be at the end of that route?
[12:43:16] havenwood: arne_: https://github.com/palkan/litecable#readme
[12:43:59] arne_: havenwood: sound reasonable, thanks
[12:45:26] dminuoso: apeiros, havenwood https://eval.in/958885
[12:45:31] dminuoso: Monadic parser combinators in Ruby.
[12:45:42] havenwood: arne_: See also: https://github.com/jeremyevans/roda-message_bus
[12:45:46] dminuoso: A monadic non-deterministic parser combinator.
[12:45:57] dminuoso: Fully capable of describing LL(1) grammars
[12:46:16] havenwood: arne_: Discourse uses MessageBus.
[12:46:28] havenwood: arne_: https://github.com/SamSaffron/message_bus#readme
[12:46:29] dminuoso: Should now include some examples how to use this.
[12:46:48] dminuoso: And `some`/`many` can probably rewritten much more easily, but meh I dont know how to do loops in Ruby anymore.
[12:47:29] arne_: i don't know messagebuse :(
[12:48:11] havenwood: arne_: If I recall correctly, it was created for Discourse after frustration with other options.
[12:48:30] arne_: i don't know Discourse :(
[12:48:52] havenwood: It's a popular, large Rails app.
[12:49:12] havenwood: arne_: https://www.discourse.org/
[12:49:38] arne_: and they use websockets alot and abstracted over it?
[12:51:00] jenrzzz: has joined #ruby
[12:51:00] jenrzzz: has joined #ruby
[12:51:14] havenwood: arne_: WebSockets are an optional transport, but I don't think they're actually favored. I can't recall where I found it, but there's an interesting piece where Sam discusses why.
[12:51:50] havenwood: arne_: Elixir with Phoenix Channels starts to look appealing at some point. ;-)
[12:52:14] arne_: context is that i am writing my own framework, which i am happy with, and i'd like a SPA-app that only communicates with ruby over websockets with normal-http as fallback
[12:52:36] arne_: and optional usage of http
[12:52:51] havenwood: arne_: HTTP/2 is nice.
[12:53:06] havenwood: I like that Phoenix supports H2 now. Cowboy 2 ftw.
[12:53:16] arne_: i never looked at elixir
[12:53:24] havenwood: it's quite nice
[12:53:49] havenwood: arne_: I'm waiting for someone to make a nice Ruby framework using the http-2 gem - speaking of quite nice: https://github.com/igrigorik/http-2
[12:53:59] gary_: has joined #ruby
[12:54:08] arne_: yeah last time i aked the exact same question in there
[12:54:21] arne_: i was brought to http-2, too
[12:54:56] arne_: do you think, if you wrote an app with that, you would get a problem with incompatible clients
[12:54:58] arne_: like some IE
[12:55:21] havenwood: arne_: https://caniuse.com/#feat=http2
[12:55:34] workmad3: havenwood: did http2 support ever make it into rack 2?
[12:55:41] havenwood: workmad3: nope
[12:55:54] workmad3: didn't think so... I guess that's half the problem with ruby frameworks still :/
[12:55:59] arne_: havenwood: well, maybe i will do that
[12:56:03] arne_: i keep you updated
[12:56:11] havenwood: workmad3: they managed to support push, but no h2 beyond thqt
[12:56:18] arne_: the fuck is uc browser for android
[12:56:53] havenwood: arne_: the california universities roll their own browser ¯\_(ツ)_/¯
[12:57:17] havenwood: actually, looks like that one is Alibaba Group of China
[12:57:42] arne_: who gives a shit about the chinese, amiright?
[12:58:26] arne_: havenwood: why doesn't racl just support http2?
[12:58:29] arne_: what's the issue?
[12:58:35] arne_: i figure i could reach a bunch of github issues
[12:58:49] mtkd: has joined #ruby
[12:59:04] arne_: and while we're at it
[12:59:15] arne_: why does rack not just support websocket in the first place
[13:04:45] Psybur: has joined #ruby
[13:04:45] Psybur: has joined #ruby
[13:04:47] arne_: havenwood: after reading some about http2, what would be different to rack except for server push
[13:05:40] ghormoon: has joined #ruby
[13:06:33] k0mpa: has joined #ruby
[13:06:33] RougeR: has joined #ruby
[13:06:33] RougeR: has joined #ruby
[13:06:52] havenwood: arne_: https://github.com/tenderlove/the_metal/issues/5
[13:06:53] havenwood: arne_: https://github.com/rack/rack/pull/1107
[13:07:08] havenwood: arne_: Basically everything would be different, and that's the problem. Rack is built for request/response.
[13:07:58] havenwood: HTTP/2 the request/response is always streaming--persistent, message-oriented and bi-directional.
[13:08:31] arne_: sounds like exactly what i would love about a webframework
[13:08:55] mikeiniowa: has joined #ruby
[13:09:06] arne_: always message-oriented? but.. would a answer to a request not still be a reponse?
[13:09:10] arne_: what's the problem, i don.t follow
[13:09:31] workmad3: arne_: it's a response, but the response doesn't have a fixed end knowable in advance
[13:09:54] arne_: that's od
[13:10:03] arne_: and that's required for rack?
[13:10:09] havenwood: arne_: You can't handle H2 with Rack's expected inputs and outputs. They can change Rack to support H2, but it'd break all the existing apps that expect the Rack spec.
[13:10:15] workmad3: arne_: no, that's the change that http2 made (and websockets)
[13:10:23] arne_: that's also the reason streaming isn't default in rack, i get it
[13:10:46] arne_: workmad3: are websockets still needed considering the asynchron nature of http2?
[13:10:53] havenwood: andersh: no
[13:10:58] workmad3: arne_: depends on who you ask
[13:11:14] arne_: workmad3: if i ask someone who says websockets are still needed, why?
[13:11:29] arne_: is the http2 gem a server already, or just a protocol implementation?
[13:11:54] workmad3: arne_: if you ask someone with a lot of deep knowledge who thinks they're still needed, you'll probably get a lot of technical details that goes into the weeds about why websockets are better or how http2 messed up X, Y or Z
[13:12:21] arne_: i will play around with it, thanks alot, http2 might be want i want
[13:12:22] Gary_B: has joined #ruby
[13:12:30] arne_: the http-2 gem looks weird
[13:12:39] arne_: is ruby really good at stuff like stream.on(:event_name)
[13:12:53] arne_: i mean, is ruby performing well in those asynchron-style code?
[13:13:01] workmad3: but yeah, I'd mostly go with http2 nowadays if you're not tying yourself to an existing framework that only supports http1 + websockets
[13:13:22] arne_: there is no full featured http2 server for ruby i guess?
[13:13:48] clemens3: has joined #ruby
[13:14:11] arne_: evented ruby code looks weird
[13:14:15] havenwood: arne_: Someone was working on one based off the http-2 gem. I haven't seen it lately.
[13:14:54] dionysus69: has joined #ruby
[13:15:02] synthroid: has joined #ruby
[13:15:13] havenwood: arne_: The Elixir/Phoenix folk are well ahead on that front. There are lots of opportunities in Ruby to blaze the trail related to H2.
[13:15:47] surrounder: has left #ruby: ("WeeChat 2.0.1")
[13:16:09] arne_: i am not willing to learn a language that looks like ruby but isn't, would really confuse me
[13:16:52] havenwood: arne_: Elixir doesn't really look like Ruby.
[13:16:59] arne_: def hello do
[13:16:59] arne_: IO.puts "Hello World"
[13:17:04] havenwood: arne_: Not that that stop me from trying to make it! https://github.com/havenwood/elixir.rb
[13:17:22] arne_: havenwood: you monster
[13:17:23] havenwood: arne_: Okay, I see what you mean. But I don't get confused.
[13:17:27] workmad3: arne_: you should probably get used to it if you're going to have a career in software development... you'll end up going through lots of languages that look like other languages but aren't
[13:17:51] dminuoso: arne_: It does not look like ruby.
[13:17:57] arne_: workmad3: im programming quite a while now, it's more like a "i don't want to"
[13:18:04] arne_: than a "i can't
[13:18:05] dminuoso: Like almost every language on this planet they merely took some syntax inspiration.
[13:18:13] havenwood: arne_: https://dockyard.com/blog/2018/02/12/what-s-new-in-phoenix-development-february-2018
[13:18:16] dminuoso: If elixir looks like ruby, your ruby code is non-idiomatic.
[13:18:46] arne_: havenwood: okay fine :D i look at elixir
[13:19:22] workmad3: I need to get back to learning elixir and phoenix... keep on getting started on that route and getting distracted
[13:19:40] arne_: if i read this, i already lost motivation
[13:19:41] arne_: redirect(conn, to: article_path(conn, :index))
[13:19:53] arne_: i want it like roda does it or not at all
[13:20:17] havenwood: arne_: In Elixir land, Plug is similar to Ruby's Rack.
[13:20:23] havenwood: arne_: You can make a pure Plug app.
[13:20:24] dminuoso: My main beef with Elixir is just the heavy use of macros.
[13:20:51] havenwood: arne_: But it turns out, Phoenix isn't much on top of plug. it's nice conventions.
[13:20:53] havenwood: dminuoso: Phoenix uses a ton of macros...
[13:20:53] dminuoso: havenwood: It's not similar. It's 10 times better.
[13:21:02] dminuoso: Writing efficient Rack middlewares is a PITA.
[13:21:09] dminuoso: They are mindtwisting.
[13:22:12] arne_: i'd love to write stuff in haskell but i am still to stoopid :(
[13:22:29] arne_: but i am confident i could write something good in/for ruby
[13:22:30] Gary_B: has joined #ruby
[13:22:33] conta: has joined #ruby
[13:22:39] Serpent: has joined #ruby
[13:28:52] havenwood: dminuoso: monadic parser combinators in... on my
[13:29:20] jenrzzz: has joined #ruby
[13:29:20] jenrzzz: has joined #ruby
[13:32:32] mtkd: has joined #ruby
[13:33:23] dinfuehr: has joined #ruby
[13:38:58] drewmcmillan: has joined #ruby
[13:46:09] gary: has joined #ruby
[13:48:41] drewmcmillan: has joined #ruby
[13:52:33] Puffball: has joined #ruby
[13:54:33] memo1: has joined #ruby
[14:06:10] dalitom: has joined #ruby
[14:06:41] memo1: Hi, in the following expression, what is the meaning of ".." if day == :mon .. day == :tues
[14:07:49] dalitom: hey guys.. please help!! So I have class1.rb amd class2.rb files, I want to use class2 functions in class1 so in class 2 I do require 'class1', right ?
[14:08:03] havenwood: memo1: look up flipflop operator
[14:08:14] dalitom: So now I do not know how to use it in class2, :/
[14:08:17] dalitom: please help
[14:10:08] jenrzzz: has joined #ruby
[14:11:19] Puffball: has joined #ruby
[14:12:09] jcalla: has joined #ruby
[14:12:47] dminuoso: dalitom: Top level functions are scoped to files.
[14:13:02] dminuoso: dalitom: The regular solution is to place them into the singleton class of a module if you just want to have "plain" functions.
[14:13:55] dalitom: right I just want to use some function from class1
[14:15:28] haylon: has joined #ruby
[14:17:26] dminuoso: dalitom: Just create some module
[14:17:43] dminuoso: >> module Foo; def self.bar; puts 42; end; end; puts Foo.bar()
[14:17:57] dminuoso: You can require the other file, and then refer to `Foo` to access that module.
[14:19:26] dalitom: Thank you guys
[14:21:25] gary_: has joined #ruby
[14:21:48] troys: has joined #ruby
[14:21:50] memo1: havenwood: ok, thank you
[14:27:16] ineb: has joined #ruby
[14:28:19] jcalla: has joined #ruby
[14:32:10] DLSteve_: has joined #ruby
[14:36:00] za1b1tsu: has joined #ruby
[14:37:42] tAn: has joined #ruby
[14:40:43] memo1: has joined #ruby
[14:44:25] alex``: has joined #ruby
[14:44:58] jenrzzz: has joined #ruby
[14:44:58] jenrzzz: has joined #ruby
[14:45:05] setchp: has joined #ruby
[14:45:25] setchp: has left #ruby: ()
[14:46:59] Cavallari1: has joined #ruby
[14:48:05] synthroid: has joined #ruby
[14:48:27] lxsameer: has joined #ruby
[14:51:48] alex```: has joined #ruby
[14:57:52] marr: has joined #ruby
[14:57:52] lavamind: has left #ruby: ()
[14:58:14] gary: has joined #ruby
[14:58:16] Rapture: has joined #ruby
[15:03:33] dionysus69: has joined #ruby
[15:04:26] Mike11: has joined #ruby
[15:07:25] delaz: has joined #ruby
[15:07:55] delaz: has left #ruby: ()
[15:08:33] delaz: has joined #ruby
[15:10:02] jnollette: has joined #ruby
[15:10:36] Gnut: has joined #ruby
[15:14:53] mostlybadfly: has joined #ruby
[15:16:00] jenrzzz: has joined #ruby
[15:16:00] jenrzzz: has joined #ruby
[15:19:22] GeorgesLeYeti: has joined #ruby
[15:19:36] InfinityFye: has joined #ruby
[15:19:49] havenwood: GeorgesLeYeti: hi
[15:20:04] GeorgesLeYeti: It is possible to associate values in array to variable. Like [a, b] = [1, 2] => a = 1 and b = 2
[15:20:27] despai: has joined #ruby
[15:20:29] workmad3: GeorgesLeYeti: you can do `a, b = [1,2]
[15:21:35] workmad3: GeorgesLeYeti: and if you want to catch 'all the rest', you can use a *... e.g. `a,b,*c = [1,2,3,4,5]` will assign [3,4,5] to c
[15:21:54] GeorgesLeYeti: Perfect ty a lot workmad3
[15:23:16] memo1: has joined #ruby
[15:23:25] schneide_: has joined #ruby
[15:25:19] Silthias: has joined #ruby
[15:25:29] gary_: has joined #ruby
[15:26:47] kapil___: has joined #ruby
[15:26:49] Mia: has joined #ruby
[15:26:49] Mia: has joined #ruby
[15:27:45] nowhereman_: has joined #ruby
[15:28:46] TomyWork: has joined #ruby
[15:36:07] gary: has joined #ruby
[15:37:48] mtkd: has joined #ruby
[15:38:26] sgen: has joined #ruby
[15:40:00] clemens3: has joined #ruby
[15:41:27] apeiros: GeorgesLeYeti: a,b = 1,2 # works fine too
[15:42:54] memo1: has joined #ruby
[15:48:28] sgen: has joined #ruby
[15:51:00] rippa: has joined #ruby
[15:51:37] Silthias1: has joined #ruby
[15:51:46] Silthias1: has left #ruby: ()
[15:54:03] Silthias: has joined #ruby
[15:54:36] jenrzzz: has joined #ruby
[15:54:43] jenrzzz: has joined #ruby
[15:58:11] zacts: has joined #ruby
[15:58:26] kspencer: I'm seeing alot of varied information about this, but if I want to write tests, what is it I should be doing in terms of gem files and vcs files, from what I read I should have a source_code_uri metadata entry, spec.files should exclude test-like directories, and I should be pushing tests to a vcs, but just the gem library itself + needed other files like Gemfile, LICENSE to rubygems.org or other gemcutter-compatible gem repository
[16:00:20] reber: has joined #ruby
[16:03:40] synthroid: has joined #ruby
[16:06:27] havenwood: kspencer: it sounds like you're on the right track. can you show code or do you have any more specific questions?
[16:07:40] apeiros: kspencer: into the repository belongs everything necessary to develop/work on the gem (except for credentials, like usernames/passwords/tokens)
[16:08:50] apeiros: kspencer: into the .gem file (which you build via `gem build your.gemspec` or potentially indirectly since you use gemcutter) belongs everything necessary to use the gem (again, except config/credentials)
[16:09:26] apeiros: (there is an argument to be made to include the tests into the .gem file, though)
[16:09:48] kspencer: well, I've also been looking, and my gem is a thor + highline CLI app, and I've also been wondering what the best course of action is with making tests, I see many different ways, although I'm currently trying out is https://github.com/dergachev/rspec-tutorial/tree/master/spec
[16:10:08] apeiros: ACTION prefers minitest
[16:10:15] apeiros: but that's a thing of personal taste
[16:10:25] kspencer: apeiros: yes but then there's also the https://github.com/rubygems/rubygems/issues/735
[16:11:03] kspencer: aka 'test files should not be installed'
[16:11:09] apeiros: that's a *shrug* issue IMO :D
[16:11:41] apeiros: I mean the only downside this "bug" has is that you load a ridiculously small amount of additional data to the users drives
[16:11:48] kspencer: I've not seen many minitest with cli's though so I can't say I'd have any luck with that out of the box
[16:11:49] apeiros: (unless you have massive fixture data)
[16:12:29] kspencer: I don't see many cli's with minitest testing, unless I'm looking in the wrong place
[16:12:30] apeiros: is your cli interactive? if not, then a well built cli is just an adapter to your library anyway.
[16:12:52] apeiros: so the distinction library/cli-app is largely meaningless
[16:14:23] apeiros: I think the cli<->lib connection is one of the rare cases where I'd do a whitebox test (ensure e.g. `foo bar` invokes `Foo::Cli.run(["bar"])`) and then rely on the unit tests for the lib.
[16:14:55] kspencer: My code may be a mess, but if I could properly make that distinction, I'll send you the gh repo if that's alright? apeiros
[16:14:56] gary_: has joined #ruby
[16:15:30] apeiros: kspencer: sure, feel free to paste the repo url in the channel
[16:15:42] apeiros: I'm not sure I'll get around to look at it today, though
[16:15:49] apeiros: but there's plenty of people here
[16:16:24] kspencer: https://github.com/IotaSpencer/mkmatter/tree/dev
[16:17:06] apeiros: https://github.com/IotaSpencer/mkmatter/blob/dev/bin/mkmatter#L13
[16:17:13] apeiros: seems to me like you can just write unit tests
[16:20:31] vondruch: has joined #ruby
[16:20:55] halt: has joined #ruby
[16:20:57] workmad3: apeiros: even if it is interactive, a well written CLI should be testable... make sure you're accepting an input source rather than hard-coding $stdin, and then you can test by passing in appropriate inputs as StringIO objects
[16:21:13] apeiros: workmad3: absolutely
[16:22:13] workmad3: but yeah, I'll typically take the actual bin-script as a 'too obvious to need a test' type thing, as it'll usually be a single invocation of a class passing in stdin, stdout and ARGV when I write them...
[16:22:24] apeiros: workmad3: I was more getting at "if you know unit testing, then you can unit test a CLI app without additional knowledge". but I guess that was actually somewhat pointless since you'll want to test the output anyway, no matter how well you separated the concerns.
[16:22:50] kspencer: workmad3: Thor (the gem I'm using for the #start method) allows you to create an instance of your 'App' without running it using #new, as #start will run everything
[16:22:50] workmad3: yeah, I'll pass in a StringIO for output too :)
[16:23:54] kspencer: so how should I go about creating a test for say the outputs or should I test for status on some and regex and success on others
[16:24:19] workmad3: https://github.com/erikhuda/thor/wiki/Integrating-with-Aruba-In-Process-Runs <-- maybe consider Aruba?
[16:24:34] mtkd: has joined #ruby
[16:25:40] mr_foto: has joined #ruby
[16:26:00] apeiros: gtg, toodles!
[16:26:04] workmad3: (also, annoyingly, it seems from that page that Thor doesn't allow you to inject stdin or stdout for other environments... I've not noticed that before as when I use Thor I tend to treat the steps as close to rake tasks, so I'll keep them single line and move the actual behaviour into testable objects, etc)
[16:26:07] chocoelho: has joined #ruby
[16:26:58] vdl: has joined #ruby
[16:27:42] Gary_B: has joined #ruby
[16:28:03] aguestuser: has joined #ruby
[16:30:21] kspencer: I'll see what I can do with this but I'm not too sure how to go from here
[16:31:25] synthroid: has joined #ruby
[16:32:45] jeffreylevesque: has joined #ruby
[16:34:20] Silthias: has left #ruby: ()
[16:34:43] jenrzzz: has joined #ruby
[16:35:22] drewmcmillan: has joined #ruby
[16:44:53] gary: has joined #ruby
[16:45:09] QCF: has joined #ruby
[16:46:31] schneide_: has joined #ruby
[16:46:39] Chuguniy: has joined #ruby
[16:48:25] regedit_: has joined #ruby
[16:49:39] aufi: has joined #ruby
[16:50:32] gary_: has joined #ruby
[16:51:39] elcontrastador: has joined #ruby
[16:52:51] memo1: has joined #ruby
[16:55:11] despai: has joined #ruby
[16:55:32] Gary_B: has joined #ruby
[16:56:21] snath: has joined #ruby
[16:57:44] apeiros_: has joined #ruby
[17:05:35] mtkd: has joined #ruby
[17:06:28] Gary_B: has joined #ruby
[17:07:27] troys: has joined #ruby
[17:07:28] alfiemax: has joined #ruby
[17:08:33] Azure: has joined #ruby
[17:10:11] jenrzzz: has joined #ruby
[17:10:11] jenrzzz: has joined #ruby
[17:16:59] raynold: has joined #ruby
[17:17:39] hoylemd: has joined #ruby
[17:19:18] hoylemd: has joined #ruby
[17:19:48] dviola: has joined #ruby
[17:21:36] biberu: has joined #ruby
[17:22:12] ldepandis: has joined #ruby
[17:22:44] s3nd1v0g1us: has joined #ruby
[17:23:20] s3nd1v0g1us: has joined #ruby
[17:23:35] Gary_B: has joined #ruby
[17:24:12] Sembei: has joined #ruby
[17:26:51] mcr1: has joined #ruby
[17:26:54] leitz: has joined #ruby
[17:26:57] schneide_: has joined #ruby
[17:27:15] jcarl43: has joined #ruby
[17:27:35] hoylemd: has joined #ruby
[17:30:19] leitz: Enjoying the book "Mastering Ruby Closures"
[17:30:31] leitz: Learning stuff.
[17:32:43] darkhanb: has joined #ruby
[17:35:39] hoylemd: has joined #ruby
[17:36:20] fyrril: has joined #ruby
[17:41:07] jamesaxl: has joined #ruby
[17:41:19] mtkd: has joined #ruby
[17:42:26] orbyt_: has joined #ruby
[17:42:47] desperek: has joined #ruby
[17:43:11] dminuoso: ACTION pokes havenwood
[17:43:22] dminuoso: Functional assistance is required!
[17:43:49] dminuoso: How does one write ruby for this to not suck? https://gist.github.com/dminuoso/6fa6f02132b0c95a5cc7178146608a1b
[17:45:02] karapetyan: has joined #ruby
[17:45:48] dminuoso: The obvious solution: cons = -> (e, a) { [e, *a] }; some = -> v { v.fmap(cons).ap(many[v]) }; many = -> v { some v | pure([]) } kind of blows up any call stack in existence.
[17:46:24] hoylemd: has joined #ruby
[17:48:39] kapil___: has joined #ruby
[17:50:58] n008f4g_: has joined #ruby
[17:51:39] hoylemd: has joined #ruby
[17:52:26] conta: has joined #ruby
[17:54:11] n0m4d1c: has joined #ruby
[17:54:50] jaruga: has joined #ruby
[17:54:51] hoylemd: has joined #ruby
[18:02:00] hahuang65: has joined #ruby
[18:02:19] gary: has joined #ruby
[18:04:20] PaulCapestany: has joined #ruby
[18:08:01] Psybur_: has joined #ruby
[18:11:11] ledestin: has joined #ruby
[18:14:23] RougeR: has joined #ruby
[18:14:28] leitz: Have things really gone quiet?
[18:15:25] alfiemax: has joined #ruby
[18:19:18] leitz: ACTION 's head makes a loud popping sound as it explodes. He was trying to comprehend block to proc conversion.
[18:19:31] _aeris_: has joined #ruby
[18:19:41] jenrzzz: has joined #ruby
[18:19:41] jenrzzz: has joined #ruby
[18:19:46] hahuang65: has joined #ruby
[18:20:21] rexan: has joined #ruby
[18:20:49] raynold: Ahh it's a wonderful day
[18:22:08] levifig: has joined #ruby
[18:22:10] dminuoso: leitz: blocks are procs are lambdas
[18:22:20] dminuoso: leitz: They only differ in subtle, annoying but largely irrelevant semantics.
[18:22:28] mcr1: has joined #ruby
[18:22:33] jnollette: has joined #ruby
[18:23:22] claudiuinberlin: has joined #ruby
[18:23:31] gary_: has joined #ruby
[18:25:57] leitz: dminuoso, I'm still newbie enough to get confused by it. I think this is the third time I've read this chapter and am still grokking "yield".
[18:28:28] sumobob: has joined #ruby
[18:28:43] sumobob: can anyone think of a better way to do something like this? Module::Client.new.get_all.map(&method(:new))
[18:29:41] mkroman: has joined #ruby
[18:30:59] dminuoso: sumobob: What is that supposed to do?
[18:31:15] dminuoso: And what are you trying to do?
[18:31:28] sumobob: all those models inherit from faraday middleware
[18:31:42] sumobob: it fetches data from external, and saves it
[18:32:55] xenops: has joined #ruby
[18:33:23] jenrzzz: has joined #ruby
[18:33:23] jenrzzz: has joined #ruby
[18:33:46] quobo: has joined #ruby
[18:35:29] havenwood: jamesaxl: hi
[18:35:48] Gary_B: has joined #ruby
[18:35:50] dminuoso: leitz: Is the notion of passing functions as values strange to you?
[18:36:02] dminuoso: leitz: like passing callbacks to functions.
[18:37:10] leitz: dminuoso, not strange as in "bad", just getting my head around it. Ruby makes it easier in a way, since everything is an object.
[18:37:22] dminuoso: leitz: Except that's the thing about blocks.
[18:37:34] leitz: I just read about "send".
[18:37:44] dminuoso: leitz: A block is basically a proc.. except without the object shell.
[18:37:56] dminuoso: leitz: And because it's not an object, you cant ever see it directly.
[18:38:23] dminuoso: But Ruby gives you primitives to somehow use these "invisible" functions. `yield` is basically Proc#call =)
[18:38:28] leitz: dminuoso, hence using the "&" for conversion?
[18:38:38] dminuoso: leitz: Right. & turns either a block into a proc or vice versa.
[18:38:47] dminuoso: leitz: it simply just reifies or strips the object shell.
[18:39:14] dminuoso: def foo(&m) basically means "take the hidden parameter, put it inside an object and name it `m`"
[18:39:28] dminuoso: And when I say object I mean Proc.
[18:40:35] dminuoso: And likewise foo(&f) means "take the proc f, throw the Object shell away, and pass it as a block"
[18:41:35] leitz: The book actually explained that bit well. I'm not sure I have it memorized yet, but it gave a pretty simple explination similar to yours.
[18:41:56] leitz: I'm on chapter 3, after 3 weeks. :P
[18:42:01] type1team: Do you know if Jekyll has any channels?
[18:42:05] n0m4d1c_: has joined #ruby
[18:42:12] dminuoso: leitz: Basically if blocks throw you off, just rewrite into lambdas.
[18:42:35] leitz: ACTION is more comfortable with blocks.
[18:42:40] dminuoso: leitz: The main quirky thing is just that visually it does not look like a block is a real parameter, although it kind of is - but it doesn't appear inside params.
[18:42:54] dminuoso: leitz: The reason we have this quirky block syntax that actually just passes another argument has two roots: a) it tends to be a bit cleaner for DSLs and b) its a miniscule performance optimization because no object creation is involved
[18:43:36] dminuoso: I rarely write blocks anymore because they hamper the reading flow
[18:44:16] mtkd: has joined #ruby
[18:44:26] leitz: The quirkiness doesn't bother me in its existance, just takes me a bit to learn. I mis-stated above; went back to redo chapter 2 because I didn't really get it. Procs and lambdas are in chapter 3. :)
[18:44:54] dminuoso: leitz: If it was up to me I'd throw away Procs. =P
[18:45:47] leitz: I have this mental fantasy of getting a job as a coder one day. Will have to understand other people's code. :/
[18:46:51] gary: has joined #ruby
[18:46:52] tAn: has joined #ruby
[18:50:24] sumobob: has joined #ruby
[18:52:33] suhdood: has joined #ruby
[18:56:57] jenrzzz: has joined #ruby
[19:01:23] guille-moe: has joined #ruby
[19:02:03] rcs: has joined #ruby
[19:03:08] kenichi: has joined #ruby
[19:09:21] conta: has joined #ruby
[19:09:52] karapetyan: has joined #ruby
[19:10:28] mostlybadfly: has joined #ruby
[19:21:02] mtkd: has joined #ruby
[19:24:15] leitz: ACTION thinks he needs a guidance counselor.
[19:29:58] memo1: has joined #ruby
[19:30:20] jenrzzz: has joined #ruby
[19:30:20] jenrzzz: has joined #ruby
[19:30:49] gary_: has joined #ruby
[19:35:47] ogres: has joined #ruby
[19:39:55] al2o3-cr: leitz: why would you need a guidence thingymabob?
[19:40:48] al2o3-cr: leitz: the more you code the better you'll be
[19:41:18] sumobob: has joined #ruby
[19:41:58] leitz: al2o3-cr, the amount of learning I need is huge. The idea is to have someone look at my code and let me know what the next big learning "things" are for someone at my level.
[19:42:32] al2o3-cr: it's easy reading code, putting code into a perspective t actually function as it should is hard.
[19:43:35] leitz: I tried looking at the Tk stuff and wasn't able to "get" it. Pretty sure my skill level is less than a 2 on a 1 to 10 scale. Maybe even 1-100. ;)
[19:44:04] jcalla: learning to code takes time
[19:44:08] gary: has joined #ruby
[19:44:12] al2o3-cr: leitz: stop doubting yourself. pretty sure you understand the basics of ruby?
[19:44:28] jcalla: a lot of trying and failing along the way
[19:44:38] leitz: ACTION has the failing down pat...
[19:44:46] al2o3-cr: absolutley.
[19:44:47] jcalla: then you're on your way!
[19:45:14] leitz: Sorry if I seem depressed about it; moving to be a coder has been a long, bumpy, and not really successful journey.
[19:45:35] jcalla: what do you currently do?
[19:46:00] leitz: I like Ruby enough to *want* to code in it more than most other leisure activities.
[19:46:14] leitz: jcalla, I'm a linux weenie by trade.
[19:46:14] al2o3-cr: leitz: if you're not sure, just ask.
[19:46:29] jcalla: what do you mean "linux weenie"?
[19:47:04] leitz: jcalla, my RHCE is dated 2003 and I haven't really moved off that track sense.
[19:47:07] AJA4350: has joined #ruby
[19:47:40] jcalla: what did you do with your RHCE?
[19:47:43] leitz: I support Linux servers and make derogatory comments about Java programmers who consume all system resources.
[19:47:53] schneide_: has joined #ruby
[19:47:57] jcalla: ahh so you're a sysadmin?
[19:48:09] suhdood: has joined #ruby
[19:48:16] al2o3-cr: leitz: ruby should be a joy then =)
[19:48:54] jcalla: if so, then you should start by rewriting your bash scripts in ruby
[19:49:00] alfiemax: has joined #ruby
[19:49:16] jcalla: then make your own ruby scripts to automate some tasks you do regularly
[19:49:18] gary_: has joined #ruby
[19:49:19] al2o3-cr: try doing what ruby does in C my god ...
[19:49:26] jcalla: programming is a means, not an end
[19:49:31] al2o3-cr: ruby is simple
[19:50:06] sameerynho: has joined #ruby
[19:50:18] jcalla: that is how i got really good with programming, writing programs in my previous job to automate tasks that would normally take a while to complete
[19:51:12] leitz: jcalla, took the SAGE lists of tasks and the Red Hat objectives and built myself a learning plan. The Ruby certification layout seems a bit light on detail besides "Well-used built-in classes and modules"
[19:52:01] leitz: jcalla, that was the plan until last year. The issue is me getitng tired of people *cough* griping about using an old version of Ruby.
[19:52:19] al2o3-cr: leitz: speak up.
[19:52:23] jcalla: leitz: try the scripting approach first. once you're comfortable with that, try making your way into an upstream ruby-based project that you can also use in your job
[19:52:48] jcalla: i may be a bit biased, but this is a great community to learn in https://github.com/theforeman
[19:52:49] nowhere_man: has joined #ruby
[19:52:50] leitz: So I moved to coding a personal project. It holds my best work to date but there's still a lot to do in terms of more code as well as better.
[19:53:50] al2o3-cr: leitz: better coder comes with experience like anything else. practice makes perfect
[19:54:06] jcalla: great! then keep going. do another project and then even more
[19:54:07] al2o3-cr: and understanding
[19:55:00] al2o3-cr: put anyone in the deep end and they will sink.
[19:55:25] leitz: al2o3-cr, perfect practice makes perfect. My old basketball coach said that. I hate sports.
[19:55:38] al2o3-cr: leitz: but you love ruby
[19:55:45] leitz: Yeah, that's the thing; trying to figure out which bites to chew off next.
[19:55:58] jcalla: you aren't shooting for perfect yet. just good
[19:56:17] al2o3-cr: leitz: baby steps
[19:56:20] jcalla: hell... even working before good!
[19:56:32] leitz: al2o3-cr, yup, really enjoy Ruby. Can't install updated versions at work and many/most tools now don't work on Ruby 1.8.7.
[19:56:40] jcalla: everyone makes mistakes, which is why bugs exist
[19:57:13] al2o3-cr: leitz: you got a computer yourself, install upto date ruby and practice in you spare time.
[19:57:18] jcalla: i work with some amazing developers, but they make mistakes. this is why our bugzilla is always active!
[19:58:10] jcalla: also, don't limit yourself to ruby for the sake of it, if you can't use it at work
[19:58:11] phenom: has joined #ruby
[19:58:40] jcalla: though if your work allows you to run containers, then you can always isolate a project in one
[19:59:07] aufi: has joined #ruby
[19:59:14] dminuoso: An environment that forces Ruby 1.8.7 onto you is worth reconsidering.
[19:59:19] Dimik: has joined #ruby
[19:59:49] leitz: jcalla, my theory is to learn better coding (OOP/TDD) using Ruby. The idea is that the language that inspires me to code gets more code written, even if Python or C are more direclty job related.
[20:00:00] dminuoso: I mean it may be a different story if its some isolated system, but if that's what your IT landscape looks like..
[20:00:17] leitz: In theory possible to move to another language after getting "good enough".
[20:00:26] lupine: leitz: read practical object-oriented design in ruby
[20:00:42] leitz: dminuoso, work is 1.8.7 or bust. I told them to use Python. At home it's Ruby 2.6.
[20:00:47] al2o3-cr: leitz: 1.8.7 is older than me
[20:00:53] leitz: lupine, read it twice.
[20:00:58] dminuoso: Boy you are fast.
[20:01:00] jcalla: leitz: in my previous job, we had extremely restrictive environments! the only tool i had to use for programming was MS Office applications!
[20:01:09] lupine: sounds like you're all set then
[20:01:14] jcalla: so you bet i wrote a ton of programs for work in excel and access
[20:01:30] al2o3-cr: python is a cool language
[20:01:36] dminuoso: lupine: I stick to my point.
[20:01:56] dminuoso: If your IT landscape forces Ruby 1.8.7 onto you, it suggests that you are in an antiquated shop.
[20:01:59] al2o3-cr: just prefer ruby
[20:01:59] jcalla: i love python. my primary language. but ruby has some neat tricks and interesting quirks
[20:02:35] leitz: dminuoso, haven't had anyone tell me I'm on an old version in a while. ;)
[20:02:50] lupine: dminuoso: sure, but plenty of those shops exist
[20:03:03] jcalla: 10.times is much nicer than for _ in range(10):
[20:03:25] dminuoso: lupine: Any such shop is worth jumping.
[20:03:36] dminuoso: jcalla: Want to know whats even better?
[20:03:39] lupine: if you have the option, sure
[20:03:41] dminuoso: jcalla: 1.step.lazy
[20:03:44] RougeR: has joined #ruby
[20:03:45] jcalla: dminuoso: always
[20:03:55] dminuoso: jcalla: That's when the _real_ fun begins.
[20:04:15] dminuoso: Generate an infinite and gain loop fusion for free.
[20:04:17] leitz: dminuoso, this shop pays the bills and is stable.
[20:04:21] dminuoso: *infinite list
[20:04:31] leitz: We don't use Ruby so version is irrelevant.
[20:04:33] al2o3-cr: dminuoso: like a generator in python?
[20:04:39] dminuoso: al2o3-cr: Nope
[20:04:45] dminuoso: al2o3-cr: It's basically an infinite but lazy list.
[20:05:20] al2o3-cr: you never seem to amaze me mr dminuoso
[20:05:51] dminuoso: >> 1.step.lazy.map(&:to_s).map { |e| "Hi " + e }.take(10).map(&:reverse).force
[20:06:03] dminuoso: >> 1.step.lazy.map(&:to_s).map { |e| "Hi " + e }.map(&:reverse).take(5).force
[20:06:07] dminuoso: ACTION kicks ruby[bot]
[20:06:09] al2o3-cr: take and force?
[20:06:16] dminuoso: has joined #ruby
[20:06:19] dminuoso: >> 1.step.lazy.map(&:to_s).map { |e| "Hi " + e }.map(&:reverse).take(5).force
[20:06:21] ruby[bot]: dminuoso: # => ["1 iH", "2 iH", "3 iH", "4 iH", "5 iH"] (https://eval.in/959125)
[20:06:27] schneide_: has joined #ruby
[20:06:28] dminuoso: al2o3-cr: You dont have to .force usually
[20:06:43] sumobob: has joined #ruby
[20:06:43] dminuoso: The beauty is that this fuses the loops.
[20:06:44] al2o3-cr: i was gonna say
[20:07:02] al2o3-cr: so simple though
[20:07:42] al2o3-cr: simplicity is one of the greatest things you can do to food.
[20:07:49] al2o3-cr: simplicity is one of the greatest things you can do to food.
[20:08:25] al2o3-cr: like carbonara. simple.
[20:08:27] Gary_B: has joined #ruby
[20:08:44] dminuoso: al2o3-cr: You can do a lot of cool things with it
[20:09:19] al2o3-cr: believe me a played them all =)
[20:09:42] al2o3-cr: ACTION waits...
[20:09:52] jcalla: ACTION waits....
[20:09:54] jenrzzz: has joined #ruby
[20:10:32] leitz: al2o3-cr, jcalla here's a good example of where I struggle. I read dminuoso's code and have not the slightest clue what it does. Part of me assumes this is something for "much later" while another part says "well, do you really have what it takes?"
[20:10:53] nadir: has joined #ruby
[20:11:07] suhdood_: has joined #ruby
[20:11:09] jcalla: leitz: take it one step at a time. and actually say to yourself what each part does
[20:11:39] al2o3-cr: leitz: understand the basics first.
[20:12:15] dminuoso: leitz: 1.step.lazy generates an infinite list [1,2,3,4,5,6,7....]
[20:12:20] leitz: al2o3-cr, that's what I'm looking for; the definition of "the basics".
[20:12:44] dminuoso: >> to = -> (t, n) { (n / t).round * t }.curry; 1.step.lazy.map(&to[5]).take(20).zip(1.step.lazy).force # al2o3-cr / jcalla
[20:12:45] ruby[bot]: dminuoso: # => [[0, 1], [0, 2], [0, 3], [0, 4], [5, 5], [5, 6], [5, 7], [5, 8], [5, 9], [10, 10], [10, 11], [10, 12 ...check link for more (https://eval.in/959126)
[20:12:57] jcalla: leitz: have you done the codeacademy course for ruby? pretty decent intro
[20:13:08] dminuoso: zipping with an infinite series is a cleaner and more combinator way of doing .with_index
[20:13:52] al2o3-cr: dminuoso: you're doing to much haskell =)
[20:13:52] sumobob: has joined #ruby
[20:13:57] dminuoso: al2o3-cr: heh
[20:14:16] dminuoso: al2o3-cr: Did you see my https://eval.in/959123 ?
[20:14:19] leitz: jcalla, my code passed Travis-CI, how's that? :)
[20:14:27] al2o3-cr: dminuoso: yeah :p
[20:14:43] leitz: And I do better learning from books.
[20:14:46] jcalla: leitz: what do you mean?
[20:15:06] dminuoso: al2o3-cr: You should see my other library..
[20:15:11] jcalla: for an upstream project?
[20:15:14] al2o3-cr: but dminuoso ruby isn't haskell ;)
[20:15:32] dminuoso: al2o3-cr: Ruby has a fairly strong FP influence
[20:15:35] al2o3-cr: even how nice it is
[20:15:41] leitz: jcalla, I read a few TDD things and started writing tests before code. Sandi Metz's "99 Bottles of OOP" was a great help too.
[20:15:42] dminuoso: Im just turning on the knob a bit
[20:16:02] dminuoso: al2o3-cr: And honestly what Im doing is very basic FP stuff, nothing advanced.
[20:16:07] leitz: Big lesson is "change one line at a time". I really needed that as I often confused myself.
[20:16:08] jcalla: dminuoso: you should play around with brainf*ck
[20:16:24] dminuoso: al2o3-cr: The real crazy stuff is not possible because it mostly relies on a powerful type system.
[20:16:32] al2o3-cr: dminuoso: you can't even do `def foo; def bar; return :blah; end; end`
[20:16:32] leitz: jcalla, so I keep my project on github and linked it to Travis-CI to test on pushes.
[20:16:52] jcalla: leitz: and you write your own tests?
[20:16:53] dminuoso: al2o3-cr: Im an AMP proponent, so it's pure all the way.
[20:17:05] leitz: Though I need to figure out how to test for a bug I found a few days ago.
[20:17:12] leitz: jcalla, yep.
[20:17:18] alfiemax: has joined #ruby
[20:17:35] dminuoso: al2o3-cr: If I had used my Q library some of it would have been cleaner because it monkey patches half of ruby core to curry properly and accept lambdas everywhere.
[20:17:36] jcalla: leitz: then you're further along than you think
[20:17:50] leitz: jcalla: https://github.com/makhidkarun/2d6_ogl_chargen/tree/master/test
[20:18:18] dminuoso: al2o3-cr: I even have fully polymorphic functions like.. fmap or pure work for any Functor/Monad/Applicative.
[20:18:46] al2o3-cr: fp in is not
[20:19:03] al2o3-cr: python lua maybe
[20:19:05] dminuoso: al2o3-cr: Reality begs to differ, FP is coming back more and more. :)
[20:19:12] leitz: I have, but haven't comprehedned, Binder's "Testing OO systems", Have read Beck's TDD book.
[20:19:31] leitz: Set Binder aside for a little bit as I moved from 1.8.7 to 2.6.
[20:19:52] dminuoso: al2o3-cr: Even if you look at the most popular languages, the FP influence is high. C++ type system takes a lot of inspiration, they got optional types, lambdas, higher kinded types..
[20:20:00] dviola: has joined #ruby
[20:20:10] dminuoso: Java - same stuff (no HKTs though), they even have interfaces (which are kind of like C++ concepts or Haskell typeclasses)
[20:20:27] dminuoso: A lot of the core libraries in those languages have been transformed into HOFs
[20:20:49] dminuoso: C++ is slowly moving away from iterator pattern to more <algorithm> heavy stuff using lambdas
[20:20:53] al2o3-cr: dminuoso: yeah, ruby is based on message sending and no way in fp paradigm whatsoever.
[20:21:00] dminuoso: al2o3-cr: It absolutely is.
[20:21:03] dminuoso: Every time you use a block
[20:21:08] dminuoso: It's a higher order function.
[20:21:14] al2o3-cr: a closure in fp
[20:21:19] weaksauce: leitz eloquent ruby is a great book if you are looking for something that touches on the basics and good practices
[20:21:33] dminuoso: al2o3-cr: The closure is not the important part.
[20:21:35] dminuoso: The HOF part is.
[20:21:52] dminuoso: The fact that you pass functions as values is one of the main driving ideas of FP.
[20:22:08] dminuoso: and foo.map { |e| e * 2 } passes a function to map.
[20:22:20] Xeago: has joined #ruby
[20:22:44] al2o3-cr: dminuoso: you're probably right =)
[20:22:49] dminuoso: The fact that we have Proc with #curry gives you the remaining power to use this
[20:22:57] dminuoso: >> to = -> (t, n) { (n / t).round * t }.curry; 1.step.lazy.map(&to[5]).take(20).zip(1.step.lazy).force
[20:22:59] ruby[bot]: dminuoso: # => [[0, 1], [0, 2], [0, 3], [0, 4], [5, 5], [5, 6], [5, 7], [5, 8], [5, 9], [10, 10], [10, 11], [10, 12 ...check link for more (https://eval.in/959127)
[20:23:02] dminuoso: Is pure ruby and FP centric.
[20:23:07] Gary_B: has joined #ruby
[20:23:27] locsmif: has joined #ruby
[20:23:31] dminuoso: The main problem is just purity in that Ruby allows referentially intransparent functions, mutation of arguments
[20:24:03] dminuoso: You can think of Ruby as an amalgation of Smalltalks message sending and FP ideas.
[20:24:31] dminuoso: Its just that most ruby developers dont dive deep into the latter
[20:24:54] al2o3-cr: i understand your ideas
[20:25:01] drewmcmillan: has joined #ruby
[20:25:29] clemens3: has joined #ruby
[20:26:00] leitz: weaksauce, I had a short but pleasent e-mail chat with Russ Olsen. Have both ER and his Design Patterns book. Working through "Masting Ruby Closures" and need to plan on the next book to dive into after that.
[20:26:16] leitz: Hence my "guidance counselor" note.
[20:27:21] weaksauce: nice leitz... very well written book imo and probably one of the best programming books i have read
[20:28:07] leitz: weaksause, ER, DP, or MRC?
[20:28:20] leitz: Have read some of each and like them all.
[20:28:39] leitz: and I need to spell weaksauce correctly next time.
[20:28:45] weaksauce: haven't seen his dp book.
[20:29:07] al2o3-cr: pico de gallo
[20:29:40] weaksauce: just looked up his blog... last post was in 2015...
[20:29:45] dminuoso: al2o3-cr: Also then there's things like flat_map which expose the Monadic interface of Array. ;p
[20:29:58] dminuoso: (or Array#join if you are a categorical theory purist)
[20:30:02] leitz: weaksauce, I like his DP book, same level of easy to read and lots of info.
[20:30:14] dminuoso: Which I think is widely underused.
[20:30:16] alfiemax: has joined #ruby
[20:30:25] leitz: I would like to use more patterns, but not just for pattern's sake.
[20:30:43] al2o3-cr: dminuoso: i'm not that smart =)
[20:30:54] leitz: The theory is that it would push me to learn even more.
[20:31:00] dminuoso: al2o3-cr: flat_map { ... } is just map { ... }.flatten
[20:31:28] weaksauce: looks to be a worthy book leitz
[20:31:30] dminuoso: That's all there is to it. :P
[20:32:43] al2o3-cr: dminuoso: a-ok ;)
[20:32:51] guardian: hello, this is a thing difficult to google: I'm launching a test with bundle exec m ./path/to/test.rb. Inside test.rb I try to use pry but when launching the test the debugger doesn't break. Does someone know how to debug such tests?
[20:33:39] mtkd: has joined #ruby
[20:34:03] morenoh149: is anyone experienced in compiling ruby on osx. I'm having some issues and it's been blocking me for a week now
[20:34:24] sumobob: has joined #ruby
[20:34:52] dminuoso: morenoh149: Gist your problem
[20:35:24] dminuoso: guardian: Normally it should work. If it doesn't break it either means execution never hits that line of code or perhap stdin/stdout is being redirected and you do not see it.
[20:35:25] morenoh149: dminuoso: https://gist.github.com/morenoh149/e774cb45dba51bf257a2c7cec4c97ee6 in the first file, openssl is never found
[20:35:40] leitz: al2o3-cr, Ruby 1.8.7 was released 31 May 2008. :)
[20:36:26] dminuoso: morenoh149: This might sound obvious but.. have you tried following the instructions?
[20:37:09] morenoh149: dminuoso: I've followed this to the letter https://github.com/postmodern/chruby/wiki/Ruby#installation
[20:37:18] dminuoso: morenoh149: Ah mmm.
[20:37:33] dminuoso: morenoh149: Did you install openssl with brew?
[20:37:43] weaksauce: morenoh149 have you considered ruby-install?
[20:37:44] morenoh149: I even did the instructions outlined at https://github.com/raggi/openssl-osx-ca#readme
[20:37:51] weaksauce: seems to work pretty well for me
[20:37:53] morenoh149: dminuoso: yes with brew
[20:37:58] morenoh149: weaksauce: I can try that instead
[20:39:30] morenoh149: weaksauce: but ruby-install doesn't list 2.4.2 which is what I need
[20:39:41] dminuoso: morenoh149: That is truly strange.
[20:39:42] Papierkorb: has joined #ruby
[20:39:51] guardian: dminuoso: nope it doesn't for some reason
[20:39:53] mcr1: has joined #ruby
[20:40:02] dminuoso: morenoh149: What are you compiling from?
[20:40:10] weaksauce: morenoh149 it does for me
[20:40:15] weaksauce: update your ruby install?
[20:40:37] morenoh149: weaksauce: I did ruby-install -L is that enough?
[20:40:38] Papierkorb: has left #ruby: ("Konversation terminated!")
[20:40:45] weaksauce: or just do ruby-install ruby-2.4.2 and see what happens
[20:40:57] dminuoso: weaksauce: Honestly "dont use the vanilla way" is not a real good solution in #ruby
[20:41:01] dminuoso: This should work.
[20:41:33] weaksauce: dminuoso well if banging your head into the wall for a week is the vanilla way perhaps a change of course is applicable
[20:41:46] leitz: ACTION steps away for a bit.
[20:42:06] dminuoso: weaksauce: Ive never had a single problem with this. If there are issues that block users from compiling the most recent version, it's a bug and needs fixing.
[20:42:07] amatas: has joined #ruby
[20:42:15] dminuoso: or it's some system misconfig
[20:42:41] morenoh149: I'll try 2.4.3 and see what happens
[20:42:45] weaksauce: i've seen openssl problems all the time
[20:43:22] morenoh149: I thought maybe it was a discrepancy between zsh and bash but both have access to the homebrew ssl
[20:44:02] dminuoso: morenoh149: What revision are you compiling from?irb
[20:44:08] dminuoso: oops ignore that
[20:44:11] dminuoso: Was trying to redraw =)
[20:44:20] dminuoso: morenoh149: What's your RUBY_PLATFORM?
[20:44:36] Antiarc1: has joined #ruby
[20:44:39] morenoh149: dminuoso: empty
[20:44:46] dminuoso: morenoh149: That sounds wrong.
[20:44:46] gary: has joined #ruby
[20:44:55] morenoh149: as an env var?
[20:45:01] dminuoso: morenoh149: No inside Ruby ;
[20:45:34] dminuoso: It should read "x86_64-darwin17"
[20:45:40] morenoh149: => "x86_64-darwin15"
[20:47:08] amatas: has joined #ruby
[20:47:39] n008f4g_: has joined #ruby
[20:47:47] weaksauce: morenoh149 did you add the path to your ssl libs?
[20:47:49] Antiarc: has joined #ruby
[20:47:55] weaksauce: to your .zshenv
[20:49:43] dminuoso: weaksauce: Its not necessary
[20:50:10] weaksauce: well. in the time we just talked i installed 2.4.3 using ruby-install
[20:50:11] morenoh149: all I added to .zshrc is source /usr/local/share/chruby/chruby.sh; source /usr/local/share/chruby/auto.sh
[20:51:17] weaksauce: ¯\\_(ツ)_/¯
[20:51:29] dminuoso: morenoh149: `grep SSL_library_init "$(brew --prefix openssl)/include/openssl/ssl.h"`
[20:51:37] dminuoso: does this produce a result for you?
[20:51:52] Antiarc: has joined #ruby
[20:52:52] morenoh149: dminuoso: 3 lines
[20:53:51] Antiarc: has joined #ruby
[20:53:54] morenoh149: so I installed ruby 2.4.3p205 and chruby into it, but when running the project `bundle install` I get Your Ruby version is 2.5.0, but your Gemfile specified 2.4.2
[20:54:13] alfiemax: has joined #ruby
[20:54:31] dminuoso: morenoh149: Be sure to rehash
[20:54:40] dminuoso: morenoh149: Otherwise you might get the wrong bundle binstub
[20:54:58] dminuoso: At least with rails I've had weird issues like that before.
[20:55:09] morenoh149: how do you rehash
[20:55:27] morenoh149: well I can search
[20:55:44] dminuoso: morenoh149: just `rehash` in your zsh
[20:56:06] workmad3: has joined #ruby
[20:56:38] gary_: has joined #ruby
[20:56:40] dminuoso: morenoh149: You should _actually_ get a command not found error since you probably have not installed the `bundle` gem for your new gem version
[20:56:53] Antiarc: has joined #ruby
[20:57:30] Antiarc: has joined #ruby
[20:58:14] xfbs: has joined #ruby
[20:58:27] sumobob: has joined #ruby
[21:00:36] synthroid: has joined #ruby
[21:01:53] jenrzzz: has joined #ruby
[21:01:53] jenrzzz: has joined #ruby
[21:02:22] morenoh149: dminuoso: I chruby into 2.4.2 and still get `Your Ruby version is 2.5.0, but your Gemfile specified 2.4.2`
[21:02:42] dminuoso: morenoh149: Did you `rehash` again?
[21:02:44] morenoh149: to clarify I have compiled and installed 2.4.2 but without openssl (because it wasn't found)
[21:03:02] morenoh149: dminuoso: just did, same error
[21:03:15] dminuoso: morenoh149: What does `which bundler` give you?
[21:04:02] alfiemax: has joined #ruby
[21:04:21] delaz: has left #ruby: ()
[21:04:50] morenoh149: /usr/local/bin/bundler
[21:06:51] weaksauce: morenoh149 do gem install bundle and then run bundle again
[21:07:02] weaksauce: er s/bundle/bundler
[21:07:39] weaksauce: bundler for me fell back to system ruby when there wasn't a gem for it for the current ruby
[21:07:40] morenoh149: `ERROR: Could not find a valid gem 'bundler' (>= 0) in any repository` probably due to lack of https support
[21:07:46] dminuoso: morenoh149: That's the problem. You have a global installation shadowing your chruby's PATH.
[21:09:39] morenoh149: dminuoso: so do I have to fix whatever is updating the PATH or is the PATH updated dynamically by chruby?
[21:09:59] dminuoso: morenoh149: Lets fix the actual problem and build ruby with OpenSSL
[21:11:40] jnollette: has joined #ruby
[21:13:35] dminuoso: morenoh149: I think I found the problem
[21:14:11] dminuoso: morenoh149: Do you happen to have pkg-config from brew?
[21:17:09] morenoh149: dminuoso: yes
[21:17:47] dminuoso: morenoh149: That's the issue on 2.4.2. Unlink pkg-config from brew, install, then relink again
[21:18:27] dminuoso: Or do anything to prevent ruby from picking up that brew's pkg-config =)
[21:18:52] morenoh149: dminuoso: unlink: pkg-config: No such file or directory
[21:19:03] dminuoso: morenoh149: no with brew.
[21:19:25] dminuoso: morenoh149: `brew unlink pkg-config`
[21:19:49] morenoh149: then recompile ruby?
[21:19:57] dminuoso: morenoh149: just `make` should be sufficient
[21:20:22] dminuoso: you might have to `make clean` first if it doesn't work
[21:20:51] morenoh149: still `../.././ext/openssl/extconf.rb:0: Failed to configure openssl. It will not be installed.`
[21:21:21] morenoh149: I ran make from the downloaded 2.4.2 sourcecode
[21:21:23] dminuoso: morenoh149: do a fresh configure
[21:21:37] dminuoso: its possible that the relevant paths are set at configure time
[21:22:48] morenoh149: running ./configure --prefix="$HOME/.rubies/ruby-2.4.2" --with-opt-dir="$(brew --prefix openssl):$(brew --prefix readline):$(brew --prefix libyaml):$(brew --prefix gdbm):$(brew --prefix libffi)"
[21:25:06] alfiemax: has joined #ruby
[21:26:26] morenoh149: looks good! running make install
[21:27:19] dminuoso: morenoh149: Remember to relink your pkg-config if you want (the bug is fixed in later ruby versions)
[21:29:46] morenoh149: dminuoso: how do I fix the `Your Ruby version is 2.5.0, but your Gemfile specified 2.4.2` when running bundle install?
[21:30:04] morenoh149: I've chruby into the 2.4.2 I just compiled
[21:30:16] morenoh149: I also rehash
[21:30:22] dminuoso: morenoh149: Its not a rehash problem
[21:30:26] dminuoso: morenoh149: its a PATH problem
[21:30:35] dminuoso: morenoh149: Make it so your system ruby is not at the front.
[21:30:52] dminuoso: morenoh149: Or probably you are just missing the `bundler` gem
[21:31:00] dminuoso: which causes zsh to keep searching and find it in the systems ruby
[21:35:23] morenoh149: I shared my path here https://gist.github.com/morenoh149/e774cb45dba51bf257a2c7cec4c97ee6 does it look alright?
[21:36:02] dminuoso: morenoh149: You are simply just missing the gem `bundler` in your ruby version,
[21:36:03] Gary_B: has joined #ruby
[21:36:06] dminuoso: morenoh149: gem install bundler
[21:36:07] dminuoso: and you are good.
[21:36:52] morenoh149: yeah just verified what chruby actually does to the path
[21:37:07] RougeR: has joined #ruby
[21:37:52] dvdingus: has joined #ruby
[21:39:27] hfp_work: has joined #ruby
[21:40:17] WA9ACE: has joined #ruby
[21:45:11] suhdood_: has joined #ruby
[21:46:17] alfiemax: has joined #ruby
[21:49:30] shinnya: has joined #ruby
[21:49:57] RougeR: has joined #ruby
[21:49:57] RougeR: has joined #ruby
[21:50:52] RougeR: has joined #ruby
[21:50:52] RougeR: has joined #ruby
[21:58:56] alfiemax: has joined #ruby
[21:59:30] guille-moe: has joined #ruby
[22:01:17] Gnut: has joined #ruby
[22:01:29] bijan_: has joined #ruby
[22:01:50] n0m4d1c: has joined #ruby
[22:01:52] memo1: has joined #ruby
[22:02:43] n0m4d1c: has joined #ruby
[22:04:23] tomphp: has joined #ruby
[22:07:33] jenrzzz: has joined #ruby
[22:07:33] jenrzzz: has joined #ruby
[22:08:00] tAn: has joined #ruby
[22:10:38] gary: has joined #ruby
[22:10:47] devil_tux: has joined #ruby
[22:16:06] cagomez: has joined #ruby
[22:19:28] alex``: has joined #ruby
[22:21:12] eightlimbed: has joined #ruby
[22:21:17] theo_: has joined #ruby
[22:22:28] devil_tux: has joined #ruby
[22:34:08] Xeago: has joined #ruby
[22:40:02] tomphp: has joined #ruby
[22:41:46] gary: has joined #ruby
[22:43:24] nowhere_man: has joined #ruby
[22:47:53] nowhereman_: has joined #ruby
[22:49:19] houhoulis: has joined #ruby
[22:50:38] electrostat: has joined #ruby
[22:52:30] devil_tux: has joined #ruby
[22:55:41] cagomez: is there a way to reference an implicit block that was passed to a method?
[22:56:27] workmad3: has joined #ruby
[22:56:42] dminuoso: cagomez: three methods
[22:56:52] dminuoso: cagomez: a) you bind it into an argument using &
[22:57:06] dminuoso: b) you can yield it
[22:57:24] dminuoso: c) you can use Proc.new without a block (which will implicitly try to grab the block passed to the current method)
[22:57:55] dminuoso: >> def f; Proc.new; end; a = f { puts "Hi" }; a.()
[22:57:57] ruby[bot]: dminuoso: # => Hi ...check link for more (https://eval.in/959159)
[22:58:53] dminuoso: Dunno about exact details when you try to use Proc.new in different edge cases.
[22:59:16] devil_tux: has joined #ruby
[22:59:51] cagomez: dminuoso: I was trying to inspect what the block given was when I passed in `&:then` to `and_then` here: https://repl.it/repls/SvelteInsubstantialAfkgaming
[23:00:31] yokel: has joined #ruby
[23:01:06] cagomez: what exactly is happening on line 9?
[23:01:15] dminuoso: cagomez: Well you can reify blocks using the first and last method I just mentioned, but it will not really help you because you can't tell much about a Proc beyond its arity.
[23:01:36] dminuoso: cagomez: So & is the block<>proc conversion operator
[23:02:07] cagomez: ^ is &:upcase converting :upcase to a block?
[23:02:11] xelkarin: has joined #ruby
[23:02:21] dminuoso: cagomez: &:foo calls Symbol#to_proc which is implemented as class Symbol; def to_proc; proc{ |s| s.public_send(s) }; end
[23:02:27] dminuoso: (or .send Im not sure from the top off my head)
[23:02:38] dminuoso: And then it strips the Proc object away, turning it into a Block.
[23:02:45] cagomez: excellent, nice. so @value is being passed in as `s` in that proc?
[23:02:52] dminuoso: cagomez: Yes.
[23:03:37] dminuoso: >> class Integer; def to_proc; proc{ |e| e[i] }; end; end; [[0,1,2],[3,4,5]].map(&0)
[23:03:39] ruby[bot]: dminuoso: # => [0, 3] (https://eval.in/959160)
[23:03:43] dminuoso: cagomez: ^- As a random other example.
[23:04:05] dminuoso: So you can see you can implement to_proc for anything.
[23:04:17] cagomez: so is line 9 essentially passing @value as a param to whatever block was passed in?
[23:04:27] dminuoso: cagomez: Yes.
[23:04:32] dminuoso: Well, @value.dup
[23:04:35] cagomez: (as if the block were a method)
[23:04:46] dminuoso: cagomez: You can think of blocks as (hidden) procs.
[23:04:55] dminuoso: As (hidden) arguments.
[23:05:17] dminuoso: Because semantically and implementation wise thats exactly what blocks are.
[23:05:36] cagomez: how did your example above work? I can't tell what it's doing
[23:05:47] dminuoso: cagomez: The same thing as with Symbol#to_proc basically
[23:05:55] dminuoso: & turns something into a Block
[23:06:08] dminuoso: In order to do that, it tries to convert it into a Proc first by trying to use #to_proc on it.
[23:06:13] jenrzzz_: has joined #ruby
[23:06:17] dminuoso: So the objects class must have #to_proc implemented
[23:06:19] dminuoso: I implemented it
[23:06:23] dminuoso: class Integer; def to_proc; proc{ |e| e[i] }; end; end;
[23:06:41] Hanmac: &:symbol has some extra magic that it does not create a Proc if you only use the Block with yield
[23:06:45] cagomez: what is `i` though?
[23:07:11] cagomez: and does Integer not implement `to_proc` already? or did you just monkeypatch it by opening the class?
[23:07:30] dminuoso: cagomez: Oh me being absolutely lazy. Imagine that was `self`
[23:07:37] dminuoso: cagomez: I just monkey patched it.
[23:08:36] dminuoso: cagomez: I abused the fact that Integer is a Numeric and implements: http://ruby-doc.org/core-2.4.0/Numeric.html#method-i-i
[23:08:43] dminuoso: And then I abused the fact that Ruby has extremely weak typing.
[23:08:49] learning-ruby: has joined #ruby
[23:08:50] dminuoso: thus saving myself 3 characters.
[23:09:05] cagomez: what is the `i` in `e[i]`?
[23:09:16] dminuoso: cagomez: It turns `self` into an imaginary number :D
[23:09:33] learning-ruby: In the Ruby source code, what is the directory /ext for?
[23:09:34] cagomez: ah right. that's another syntax for .call, right?
[23:09:39] dminuoso: learning-ruby: Extensions.
[23:09:55] dminuoso: cagomez: For Proc yes, but thats not what Im doing.
[23:10:10] weaksauce: i does fail if called with anything other than 0 though.
[23:10:11] dminuoso: cagomez: Basically my Integer#to_proc is under the assumption that the argument to the proc is some container type.
[23:10:21] dminuoso: In particular an Array
[23:10:23] learning-ruby: dminuoso: thanks pal
[23:11:01] dminuoso: weaksauce: Yeah.
[23:11:12] weaksauce: self works in the general case
[23:11:21] cagomez: is there a way to make my own operator , such as :|, and alias it to my `and_then` method?
[23:11:23] dminuoso: Its just a weird habit I guess ¯\_(ツ)_/¯
[23:11:31] dminuoso: cagomez: def |
[23:11:46] dminuoso: cagomez: Or call it and_then and create an alias using
[23:11:48] dminuoso: &ri alias_method
[23:11:48] `derpy: http://ruby-doc.org/core-2.4.1/Module.html#method-i-alias_method
[23:11:56] dminuoso: Someone should probably update this
[23:11:56] learning-ruby: If I want to only have in the Ruby source code directory the Ruby core classes, what directories should I remove? (ex: lib, ext...)
[23:11:59] dminuoso: ACTION looks at adaedra
[23:12:14] dminuoso: learning-ruby: The root directory of the repository.
[23:12:34] dminuoso: learning-ruby: It's mostly spread out in those files. hash.c for example contains most of the implementation for Hash
[23:12:41] cagomez: where can I find a list of operators that are being used by Ruby? Is there a way to scope my new operator to this class?
[23:13:01] cagomez: ignore the first question ^
[23:13:43] dminuoso: cagomez: operators are just methods.
[23:14:06] dminuoso: cagomez: `a | b` is just syntax sugar for a.|(b)
[23:14:16] learning-ruby: dminuoso: oh, so if I ignore all of the directories and run rdoc on the root files only, it will give me all core classes?
[23:14:29] gary_: has joined #ruby
[23:14:34] dminuoso: learning-ruby: I dont know whether it will be _all_, but most yes.
[23:14:38] cagomez: ah nice. is there an operator that you can suggest for this class? I like elixir's |>
[23:15:35] dminuoso: cagomez: >, >>, <, <<, |, &, **, >=, <=, =~, !~
[23:16:47] dminuoso: cagomez: Also a cool trick I use is to use lambdas as argument together with >>, > and >=
[23:16:53] ferox: has joined #ruby
[23:17:02] dminuoso: cagomez: that allows me to make code look like: m >-> e { puts e }
[23:17:17] dminuoso: m >=-> e { puts e }
[23:17:22] dminuoso: m >>-> e { puts e }
[23:17:31] dminuoso: m <-> e { puts e }
[23:17:38] dminuoso: m <<-> e { puts e }
[23:17:41] dminuoso: m <=-> e { puts e }
[23:19:03] bijan_: has joined #ruby
[23:20:02] alfiemax: has joined #ruby
[23:20:07] xelkarin: has joined #ruby
[23:20:14] dminuoso: cagomez: If you want something like elixir's |> I have something better for you.
[23:20:18] cagomez: what is that doing, exactly? are >>, >, >= your own operators, or does Ruby do something special when used with a lamba? I'm not sure what those snippets are doing
[23:20:38] dminuoso: cagomez: Its just a syntax trick. They do whatever I want
[23:21:24] dminuoso: cagomez: class Proc; def *(o); ->(x) { self[o[x]] }; end; end
[23:21:28] craysiii: m O-|-< e { puts e }
[23:21:30] ferox: has joined #ruby
[23:21:39] craysiii: m O-\-< e { puts e }
[23:21:44] craysiii: m O-/-< e { puts e }
[23:21:48] dminuoso: cagomez: That thing is essentially the same as |> except in reverse and point free.
[23:22:44] dminuoso: cagomez: if you want _exactly_ |> then upgrade to ruby 2.5
[23:23:09] dminuoso: cagomez: https://ruby-doc.org/core-2.5.0/Object.html#method-i-yield_self
[23:23:32] cagomez: ah ok. I really want to define my own operator but I have to consider others that will be working with this class, so I think I'll keep `and_then`
[23:23:52] dminuoso: You could even create a refinement to do: class Object; def -(l); yield_self(&l) end; end
[23:24:16] dminuoso: And then go crazy: object |-> (o) { o.increase } |-> (v) { ... }
[23:24:19] dminuoso: not sure whether that will parse
[23:24:54] dminuoso: cagomez: Proc#* is a safe monkey patch.
[23:25:48] dminuoso: cagomez: *and_then is already implemented in Ruby 2.5 as yield_self :)
[23:25:53] cagomez: ah ok, thanks for your help. I've been playing with procs, lambdas, and I feel like I unlocked a new part of the language
[23:26:02] cagomez: seriously wow
[23:26:33] dminuoso: and with my miniscule hack you can make it look cool
[23:26:51] dminuoso: object |-> doubleIt |-> halfIt |-> takeSquareRoot |-> printIt
[23:27:03] dminuoso: Is what I ideally would want
[23:27:21] cagomez: yeah that looks great
[23:27:37] dminuoso: cagomez: So with Proc#* you would do this:
[23:27:52] dminuoso: t = printIt * takeSquareRoot * halfIt * doubleIt; t.(object)
[23:28:09] dminuoso: If you prefer you can also create Proc#>> like
[23:28:20] dminuoso: class Proc; def *(o); ->(x) { o[self[x]] }; end; end
[23:28:36] dminuoso: t = doubleIt >> halfIt >> takeSquareRoot >> printIt; t[object]
[23:28:47] dminuoso: or >> and <<
[23:29:12] dminuoso: cagomez: And while we're at cool things
[23:29:17] dminuoso: &ri Proc#curry
[23:29:17] `derpy: http://ruby-doc.org/core-2.4.1/Proc.html#method-i-curry
[23:29:21] dminuoso: Most useful method in Ruby
[23:29:56] cagomez: +1, I got to it use to curry a proc that I pass in to this class
[23:32:13] dminuoso: cagomez: And if thats not functional enough for you, you can take it to the next level with this: https://gist.github.com/dminuoso/b124a441ea1933cfb8c0e788091804fa
[23:32:50] dminuoso: Autocurrying methods
[23:33:07] dminuoso: defc :add { |a, b| a + b }
[23:33:30] dminuoso: `add` gives you a curried lambda. `add 2` gives you a curried lambda, applied with one argument
[23:33:43] cagomez: what is the use case?
[23:34:25] RougeR: has joined #ruby
[23:34:25] RougeR: has joined #ruby
[23:34:40] dminuoso: cagomez: I hate having to specify .() or [] when invoking lambdas
[23:35:11] dminuoso: cagomez: But at the same time I want to be able to use a method as first class value (without having to go through the hoops of extracting it with .method() )
[23:35:28] karapetyan: has joined #ruby
[23:36:10] cagomez: so would `add 3` in your example (after `add 2) produce 5?
[23:36:37] dminuoso: cagomez: no you basically use it like
[23:36:47] dminuoso: adder = add 3; puts adder[10]
[23:36:50] dminuoso: https://gist.github.com/dminuoso/038c2bc63c804245df8c67c163c407ac
[23:37:05] dminuoso: Basically this becomes obvious once you start writing combinator functions and higher order functions and use functional composition.
[23:37:11] alfiemax: has joined #ruby
[23:37:25] dminuoso: But you kind of have to rewrite Proc#call and Proc#[] in order to be really great.
[23:37:43] dminuoso: (You have to rig it to always apply one argument at a time)
[23:38:55] dminuoso: Otherwise you have to _know_ whenever you switch between lambdas and introduce a sudden and magical boundary like
[23:39:17] dminuoso: (Q.zipWith * Q.zipWith)[add][ary1, ary2]
[23:39:22] dminuoso: (Q.zipWith * Q.zipWith)[add, ary1, ary2]
[23:39:31] dminuoso: I like the second better =)
[23:40:23] cagomez: same. is there a way to pass a non-op block? like yield to a block, but have it do nothing with the arg passed to the block? maybe { |x| x } ?
[23:41:02] dminuoso: cagomez: I have a function called id =)
[23:41:10] dminuoso: Q.id is exactly that
[23:42:22] dminuoso: cagomez: Though you can do this with vanilla ruby already
[23:42:28] dminuoso: &ri Object#itself
[23:42:28] `derpy: http://ruby-doc.org/core-2.4.1/Object.html#method-i-itself
[23:42:32] dminuoso: cagomez: So you can use
[23:42:37] dminuoso: >> [1,2,3,4].map(&:itself)
[23:42:39] ruby[bot]: dminuoso: # => [1, 2, 3, 4] (https://eval.in/959166)
[23:42:42] dminuoso: This is mostly useful in this case
[23:42:51] cagomez: ah of course
[23:43:01] dminuoso: >> [1, 2, nil, 5, False].select(&:itself)
[23:43:02] ruby[bot]: dminuoso: # => uninitialized constant False ...check link for more (https://eval.in/959167)
[23:43:08] dminuoso: haha too much Haskell
[23:43:11] dminuoso: >> [1, 2, nil, 5, false].select(&:itself)
[23:43:12] ruby[bot]: dminuoso: # => [1, 2, 5] (https://eval.in/959168)
[23:43:24] dminuoso: Even wrote `filter` instead of `select`
[23:45:36] dminuoso: cagomez: https://eval.in/959169 you can have much fun with functional programming in Ruby.
[23:46:30] dminuoso: cagomez: At the bottom you can see my use of >->
[23:46:47] dminuoso: "Application side" begins at line 306
[23:47:13] cagomez: if I create an alias for `foo` and call it `bar`, do you say that `foo is aliased to bar`, or is it the other way around?
[23:47:21] eckhardt: has joined #ruby
[23:48:25] dminuoso: ACTION is not a native speaker and thusly not qualified to answer this question
[23:50:30] sumobob: has joined #ruby
[23:51:40] banisterfiend: has joined #ruby
[23:52:11] gary: has joined #ruby
[23:53:54] alfiemax: has joined #ruby
[23:55:13] maum: has joined #ruby
[23:55:33] karapetyan: has joined #ruby
[23:56:25] cagomez: in `yield @value`, is `@value` being yielded? or is the method yielding to a block and we are just passing @value as an argument?
[23:57:09] dminuoso: cagomez: `yield @value` is semantically equivalent to: Proc.new.call(@value)
[23:57:51] dminuoso: cagomez: Or these two are equivalent: `def meth; yield @value; end;` `def meth(&blk); blk.call(@value); end;
[23:58:31] dminuoso: cagomez: so if you are just looking for good terminology "the block is called with @value as the argument" ;)
[23:58:32] cagomez: except the latter is supposedly less performant than the former?
[23:58:46] dminuoso: cagomez: the performance is largely irrelevant
[23:58:47] cagomez: (&block.call is slower than yield)?
[23:59:17] cagomez: ah ok. I like the latter because it looks cleaner
[23:59:45] banisterfiend: i still put the &block in the sig even if i'm yielding