« Back to channel list

#ruby - 21 June 2016

« Back 1 day Forward 1 day »
[00:02:49] karmatr0n: has joined #ruby
[00:02:52] evansbee: has joined #ruby
[00:04:43] sumangurung: has joined #ruby
[00:05:55] shevy: wixad_ hah I was wondering about that too... but looking back, I never used getoptlong for anything really so far
[00:07:05] Radar: ?twgr ruby-lang147
[00:07:05] ruby[bot]: Radar: I don't know anything about twgr
[00:07:11] Radar: ruby[bot]: :((((
[00:07:30] Radar: ruby-lang147: https://www.manning.com/books/the-well-grounded-rubyist-second-edition
[00:08:02] boogeyman: has joined #ruby
[00:08:10] jhass: Radar: add it! :)
[00:08:19] palms: has joined #ruby
[00:08:23] sumangurung: has joined #ruby
[00:10:35] boogeyman: has joined #ruby
[00:10:43] wixad_: @shevy i guess optionparser and slop handle the needy situation better...
[00:11:37] wrkrcoop: has joined #ruby
[00:17:18] nankyokusei: has joined #ruby
[00:17:52] amincd: has joined #ruby
[00:18:23] amincd: hi, why does File.new("filename", "r+") not create a duplex IO?
[00:19:26] sumangurung: Hi folks, I was wondering what skills would you expect a beginner vs an intermediate vs an advanced ruby programmer to have?
[00:20:03] Rodya_: has joined #ruby
[00:21:01] toretore: amincd: how do you determine that it doesn't?
[00:23:39] amincd: toretore: io.close_read fails
[00:23:51] toretore: amincd: code?
[00:24:01] toretore: amincd: and error
[00:24:04] amincd: in `close_read': closing non-duplex IO for reading (IOError)
[00:24:29] Moosashi: has joined #ruby
[00:25:34] amincd: io = File.new("textfile.txt", "r+"); io.close_read
[00:25:36] LoneHerm_: has joined #ruby
[00:26:44] jaguarmagenta: has joined #ruby
[00:26:52] toretore: amincd: actually, i don't think a file is a "duplex io"
[00:27:08] Beverage: has joined #ruby
[00:27:16] amincd: toretore: if the permissions are "r+", what is it then?
[00:27:28] toretore: duplex != r/w
[00:28:08] amincd: I thought they were synonymous
[00:28:12] toretore: duplex refers to an io that has two different channels for read and write afaik
[00:28:12] jhass: a pipe can be a duplex IO, actually two IOs abstracted into a single IO isntance
[00:28:42] toretore: sockets too are duplex in this sense
[00:28:51] jhass: or actually two pipes I should say
[00:30:34] arescorpio: has joined #ruby
[00:30:49] amincd: hmm I guess I didn't understand IO and processes too well then
[00:33:17] toretore: amincd: close_read makes sense when there's an "other side" that gets a signal that your side doesn't accept any further writes
[00:33:47] ramfjord_: has joined #ruby
[00:33:57] amincd: toretore: so I guess objects created by File wouldn't need a duplex
[00:34:35] amincd: IO.popen creates duplexes which is consistent with your explanation
[00:38:21] infernix: has joined #ruby
[00:41:05] tmtwd: has joined #ruby
[00:42:33] Spami: has joined #ruby
[00:42:40] hahuang62: has joined #ruby
[00:43:14] KnownSy0: has joined #ruby
[00:44:33] evansbee: has joined #ruby
[00:45:01] moos3: has joined #ruby
[00:45:57] CloCkWeRX: has joined #ruby
[00:51:42] tAn: has joined #ruby
[00:53:29] KnownSy0: has joined #ruby
[00:58:39] romistrub: has joined #ruby
[00:59:47] romistrub: sigh... so TCPServer#accept is returning a TCPSocket, but when I do a TCPSocket#recv, I get a string with length zero. What gives?
[00:59:58] freerobby: has joined #ruby
[01:00:22] ruby[bot]: We can't help you without your code, please post it to https://gist.github.com
[01:00:28] xall_: has joined #ruby
[01:00:36] romistrub: Radar, it's long and multifile
[01:01:26] cdg: has joined #ruby
[01:01:26] Radar: glhf then\
[01:01:42] romistrub: lol, thanks
[01:01:56] Radar: "Why am I getting this problem?!" "Show us the code" "Nope." "Nope."
[01:02:28] romistrub: I'm just saying, it's a lot of code... gimme a minute and I'll gist it
[01:02:34] adam12: romistrub: Passing any args to #recv?
[01:02:39] Radar: Small reproducible example would be handy.
[01:02:54] charliesome: has joined #ruby
[01:03:59] romistrub: can't get it to reproduce on a small scale
[01:04:03] romistrub: here's the whole of it
[01:04:05] romistrub: https://gist.github.com/romistrub/df3481a54d6af18cbd0e97514f387ccb
[01:04:22] romistrub: almost, I left out a little bit (framework/web_socket)
[01:04:43] Radar: Gist supports multiple files.
[01:04:49] Radar: Can you please split that up into multiple files?
[01:05:03] romistrub: oh; well I copied and pasted all of these to one file; thought it would be easier that way
[01:05:09] AcidCrash: has joined #ruby
[01:06:11] romistrub: basically, my expectation was that every time TCPServer#accept returned a TCPSocket, it meant that a browser was making an HTTP request to me server
[01:06:23] romistrub: But I'm getting "requests" of zero length
[01:06:37] solocshaw: has joined #ruby
[01:07:14] romistrub: I can easily filter out requests with zero length, but I'm confused as to why TCPServer#accept would return a TCPSocket whose contents (via #recv) are length 0
[01:07:32] romistrub: I'm new to Sockets in general, so I'm guessing it's a misunderstanding on my part
[01:08:08] romistrub: adam12, yeah, 1024
[01:08:23] adam12: romistrub: How are you testing the connections? browser?
[01:08:31] romistrub: adam12: yeah
[01:08:46] romistrub: is it a keepalive or something?
[01:08:48] adam12: Can you telnet to it locally and dump some crap through it, to see if it's actually receiving 0 length?
[01:09:11] Radar: romistrub: Did you add the websocket bit?
[01:09:33] romistrub: Radar: the Websocket element wasn't relevant, so I just didn't include it in the pastejob
[01:09:35] Hobogrammer: has joined #ruby
[01:09:55] noodle: has joined #ruby
[01:09:59] adam12: I guess I should of asked what protocol this was..
[01:10:12] romistrub: adam12: protocol is http
[01:10:42] romistrub: adam12: don't get me wrong, it's receiving all of the manual http requests fine
[01:11:07] Moosashi: has joined #ruby
[01:11:35] eljimador: has joined #ruby
[01:11:59] adam12: romistrub: So just browser requests are failing?
[01:12:10] romistrub: adam12: browser requests aren't failing
[01:12:39] adam12: You're receiving a zero length string...
[01:12:47] adam12: but other regular strings too
[01:12:50] romistrub: but only once and a while
[01:12:53] adam12: So you're just wondering about the zero length?
[01:12:58] romistrub: and not prompted by the requests I'm making manually
[01:13:07] eljimmy: has joined #ruby
[01:13:22] romistrub: yeah, where's it coming from?
[01:13:56] romistrub: do browsers send keepalives or something without any http headers?
[01:13:57] adam12: It could be keepalive? if you see the headers come back through. You'd have to ack keepalive support.
[01:14:09] bmurt: has joined #ruby
[01:14:19] northfurr: has joined #ruby
[01:14:22] adam12: When you send content back, send keepalive header
[01:14:31] adam12: So they send it to you if they support it, if you support it you send it back
[01:14:52] romistrub: adam12: but do they send it firs?
[01:15:02] adam12: They normally do, in the request. That's for HTTP1.0
[01:15:20] adam12: I'm not sure about 1.1. I'm assuming it's always persistent, but no keepalive.
[01:15:22] romistrub: adam12: jeez, that's obnoxious
[01:15:32] romistrub: what if I don't want those messages?
[01:15:38] romistrub: do I just ignore them?
[01:15:48] romistrub: or can I instruct to stop sending?
[01:15:56] adam12: You'd have to say you support them, so if not, don't send the header that in your response.
[01:16:23] adam12: Do you see a Connection: keep-alive header during your requests?
[01:16:32] romistrub: well right now I have no response to that, as the length = 0 crashes my expectation that the request will have headers lol
[01:16:39] adam12: (ie through Developer Tools)
[01:16:42] romistrub: let me check
[01:16:43] Hanmac: has joined #ruby
[01:16:55] romistrub: I'm sniffing the entire string that comes through, just checking my terminal
[01:17:12] romistrub: yeah, I get connection=>keep-alive
[01:17:22] adam12: on the response?
[01:17:27] adam12: or from the client?
[01:17:27] xcesariox: has joined #ruby
[01:17:29] romistrub: on the request
[01:17:31] romistrub: from the client
[01:17:37] adam12: Do you send it back?
[01:17:48] adam12: Likely not keepalive then, imho.
[01:18:03] romistrub: you mean they're not attempting to keep it alive?
[01:18:20] romistrub: oh, crap, that made so much sense
[01:18:30] adam12: I don't think they send 'pings' or anything like that, just the server doesn't automatically close.
[01:18:33] romistrub: so the "ping" of 0 bytes only starts happening after a negotiation of sorts?
[01:18:59] adam12: Is it possible that recv times out? I'm not deeply familiar with it.
[01:19:29] romistrub: it shouldn't even be getting to the point where recv is called unless a socket is opened
[01:19:42] romistrub: in other words, the recv should have bits immediately
[01:20:40] romistrub: and then I'd think it would return an error or something instead of just following through with zero bytes
[01:21:10] gfvcastro: has joined #ruby
[01:22:56] charliesome: has joined #ruby
[01:23:20] CloCkWeRX: has left #ruby: ()
[01:23:29] romistrub: adam12: I should note that the error appears to happen "at random"
[01:23:40] adam12: romistrub: after the headers arrived or before?
[01:23:47] adam12: Could you use #gets instead of #recv?
[01:24:09] romistrub: I think I tried that and it didn't work, let me try again... why, what's the difference?
[01:24:11] adam12: I'm no socket guru so I am not sure if that would fix anything..
[01:25:11] Ropeney: has joined #ruby
[01:25:18] romistrub: I don't think that'll work; gets reads a line and stops once the line terminates
[01:25:56] gfvcastro: has joined #ruby
[01:26:09] adam12: Yeah, you'd likely have to loop
[01:26:30] adam12: and probably break on newline.
[01:28:03] romistrub: I'm just trying to google "tcp socket receiving string of zero bytes"
[01:32:50] adam12: romistrub: I have a super primitive example I mocked up, and exiting telnet ended up recv'ing an empty string. By design perhaps?
[01:33:43] adam12: I mean, a socket closed on one end but not on the other
[01:35:19] romistrub: adam12: but in my case, I close the socket on the server end, after the one recv
[01:36:18] markfletcher: has joined #ruby
[01:36:29] Sashimi_: has joined #ruby
[01:39:29] mistermo_: has joined #ruby
[01:43:24] hahuang62: has joined #ruby
[01:44:09] dikaio: has joined #ruby
[01:45:16] karmatr0n: has joined #ruby
[01:46:24] agentmeerkat: has joined #ruby
[01:46:38] swills: has joined #ruby
[01:48:38] sumobob: has joined #ruby
[01:51:03] jrafanie: has joined #ruby
[01:51:46] enterprisey: has joined #ruby
[01:52:39] wuyin: has joined #ruby
[01:54:34] romistrub: adam12: https://gist.github.com/romistrub/0c197f2615a4573fdf451f2995abaeb6
[01:54:56] romistrub: I simplified it to its bare minimum; on Chrome, I get the same bizarre behaviour.... a "request" of 0 bytes
[01:56:18] adam12: Does that code actually work?
[01:57:15] adam12: I get 1024, then 0 (after updating code to work)
[01:57:56] ur5us: has joined #ruby
[01:58:46] toretore: tcp connection != http request
[01:59:27] Yzguy: has joined #ruby
[01:59:27] roamingdog: has joined #ruby
[01:59:44] smathy: has joined #ruby
[02:05:32] romistrub: adam12: yeah, it does
[02:06:09] romistrub: toretore: I realize that, but I didn't think the client would send anything over a TCPSocket unless it was an HTTP request
[02:06:50] romistrub: I created a barebones client, and it doesn't send any magic
[02:07:18] toretore: how do you reproduce this 0 byte request?
[02:07:56] romistrub: toretore: just make a request with google Chrome to localhots
[02:08:17] toretore: i did, 1024 bytes
[02:08:30] romistrub: first recv delivers 761 bytes; 5 to 10 seconds later the second recv generates 0 bytes
[02:09:02] toretore: is the second recv on the same socket?
[02:09:28] romistrub: nope, it would have to get past the accept, right?
[02:10:00] bmurt: has joined #ruby
[02:10:56] romistrub: yeah; confirmed it's a different socket
[02:11:11] ornerymoose: has joined #ruby
[02:11:29] dcunit3d: has joined #ruby
[02:12:00] smathy: Hmm, I was about to suggest it would be a keep-alive, but I'd expect that on the same socket.
[02:13:27] romistrub: tried to recreate the browser behaviour using test_client.rb and sending "", but no socket was created
[02:13:30] ornerymoose: has joined #ruby
[02:13:42] Rodya_: has joined #ruby
[02:14:02] toretore: romistrub: gist the exact code you're using to observe this behavior
[02:14:10] romistrub: toretore: sure, 1 sec
[02:14:32] toretore: nm, i'm seeing it now
[02:14:38] toretore: just took a lot longer
[02:15:15] romistrub: https://gist.github.com/romistrub/0c197f2615a4573fdf451f2995abaeb6
[02:15:16] toretore: i'm guessing you're not actually replying to the initial request, so it's probably chome trying to see if the host is still available
[02:15:40] romistrub: toretore: even when I'm replying (which I was, before I minimalized the script), it still sent the 0-byte signal
[02:16:00] toretore: define replying
[02:16:23] toretore: do you close the socket, and then chrome opens another connection?
[02:16:29] romistrub: toretore: yup
[02:17:05] blackgoat: has joined #ruby
[02:17:46] romistrub: is anybody has a different browser, it would be pertinent to test it on that, too
[02:18:11] romistrub: just to see if this is a chrome particular
[02:18:13] nankyokusei: has joined #ruby
[02:18:38] Brian: has joined #ruby
[02:22:32] matp_: has joined #ruby
[02:22:51] smathy: Doesn't happen here (from Chrome, ruby 2.3), I just get three attempts at 692 bytes.
[02:24:01] romistrub: smathy, give it time, it takes up to 20 secs
[02:24:09] _Tariq: has joined #ruby
[02:24:18] smathy: I left it for 5 minutes.
[02:24:36] romistrub: did you use the exact code I did?
[02:24:45] smathy: Except not port 80.
[02:25:56] Yiota: has joined #ruby
[02:26:37] smathy: A high port, I don't have ruby set up for root.
[02:27:30] jaguarmagenta: has joined #ruby
[02:29:19] romistrub: smathy: tried it with 3000, still getting the 0
[02:30:36] smathy: Yeah, it'd be hard to imagine it was something caused by a specific port. Maybe your Chrome is making the reconnection so quickly that by the time you're looping and accepting, the buffer is already empty. I'm not sure how TCPServer handles itself with that.
[02:31:01] smathy: What if you make a thread for the accept instead?
[02:31:20] enterprisey: Does Ruby have a method similar to Python's partition method for strings?
[02:32:46] smathy: enterprisey, partition
[02:33:49] claw: has joined #ruby
[02:34:48] romistrub: smathy: that wouldn't make sense; I check socket first and it's a new socket when I click recv
[02:35:26] bfig: has joined #ruby
[02:35:31] smathy: romistrub, well, the behavior you're explaining doesn't makes sense.
[02:35:34] moos3: has joined #ruby
[02:35:45] bfig: I'm having issues running the ruby interp. It hangs as soon as I start it (ubuntu 16.04)
[02:35:49] romistrub: smathy: I know it doesn't; but it's what happens
[02:36:06] smathy: bfig, describe what you're doing and what's happening.
[02:36:31] smathy: romistrub, right, so no point dismissing things that also don't make sense. The problem you're seeing is already "out there".
[02:36:55] smathy: romistrub, take a look and see if the thread approach still shows the same issue.
[02:36:56] romistrub: smathy: I see what you're saying
[02:37:01] Yiota: has joined #ruby
[02:37:04] romistrub: a thread for what specifically?
[02:37:16] Regulati_: has joined #ruby
[02:37:37] mattwashere: has joined #ruby
[02:38:08] bfig: smathy: I'm on the console, write 'ruby', press enter
[02:38:18] smathy: romistrub, like `Thread.start(t.accept) do |socket|` instead of just `t.accept` - and `end` after you `socket.close`
[02:38:34] romistrub: smathy: on it
[02:38:52] smathy: bfig, right, and you should see a blank line waiting for STDIN that at EOF ruby will then process.
[02:39:38] smathy: bfig, if you want an interactive shell, use irb (or pry is an enhanced version, but doesn't ship with ruby, you'd need to install the gem).
[02:39:53] bfig: smathy: great! thanks for the advice
[02:39:59] romistrub: smathy: same thing
[02:40:19] smathy: romistrub, oh well. I'm out of ideas.
[02:40:33] romistrub: smathy: yeah, me too
[02:40:35] smathy: romistrub, which version of ruby are you using? I arrived late.
[02:40:58] sdothum: has joined #ruby
[02:41:01] romistrub: smathy: err... 2.2.3
[02:41:27] smathy: Are you stuck there for a reason? Try moving to the latest.
[02:42:02] romistrub: smathy: stupid question, but I looked it up before... how do I do that? I'm on Windows, which might be a limiting factor
[02:42:43] smathy: I just switched to 2.2.3 and I still don't see the issue.
[02:42:57] romistrub: Chrome version?
[02:43:03] smathy: Oh, heh, Windows :) Ok, totally different network stack so none of my tests are relevant.
[02:43:05] chimkan: has joined #ruby
[02:43:16] romistrub: 51.0.2704.103 m
[02:44:06] hahuang62: has joined #ruby
[02:44:32] romistrub: toretore duplicated the problem
[02:44:48] chimkan: does anyone have try to do machine learning with ruby?
[02:44:52] enterprisey: Any idea how I can change this regexp to get Ruby to stop complaining? /==\s?(\w+)\s?==/
[02:44:59] smathy: romistrub, long shot, but have you tried from a new incognito session?
[02:45:21] romistrub: smathy: interesting idea, 1 sec
[02:46:10] smathy: chimkan, they have, the work is a little stale now though. People have tended to use Python or other languages more than ruby.
[02:46:11] romistrub: same problem
[02:46:59] _Tariq: I know there is one ML algorithm that could be useful for web dev
[02:47:07] _Tariq: Let me see if I have it starred
[02:47:21] chimkan: smathy, thanks. I’m currently using python scikit or even spacy.io and creating a CLI that generates the predictions or results in json
[02:47:52] chimkan: I call my python cli within ruby via eval()
[02:48:03] chimkan: but trying to see if there’s anything better
[02:48:05] mattwashere: has joined #ruby
[02:48:24] _Tariq: https://github.com/jekyll/classifier-reborn
[02:49:08] _Tariq: I'd probably recommend using your approach
[02:49:11] _Tariq: Best tool for the job and all.
[02:49:31] _Tariq: But this library could be useful for sites that want to "recommend" other parts of the website
[02:50:04] _Tariq: using machine learning to select articles that are very close to the existing article in question
[02:50:04] _Tariq: So potentially useful for webdev work
[02:50:39] smathy: romistrub, first request 384 length (for localhost:3100) and then I get two more at 410 length (because Chrome has added a cache header to the retries). Never a 0 length. Running 2.2.3 or 2.3.1 - all the same.
[02:50:39] chimkan: _Tariq, that’s a very good one, I didn’t know that
[02:51:10] romistrub: smathy: I'm trying firefox
[02:51:33] smathy: FF for me just has a single request at 298 and no retries.
[02:52:34] romistrub: smathy: same weirdness with firefox
[02:53:15] smathy: Safari has some retries, all of them have content.
[02:53:31] smathy: romistrub, yeah, I definitely suspect TCPServer more than I would Chrome.
[02:54:19] smathy: romistrub, maybe try with TCPSocket instead, see if you get the same issue.
[02:54:32] romistrub: smathy: one problem, I tried to send a null string using TCPSocket, and didn't get a string with zero length, I got nothing at all
[02:54:43] romistrub: smathy: tried that already, no such problem
[02:55:13] smathy: romistrub, what's "a null string"? You mean "\0" ?
[02:56:47] gfvcastro: has joined #ruby
[02:57:32] toretore: romistrub: https://gist.github.com/toretore/24dcef14e76f66aa21d5264aaf13dd20
[02:57:35] Dimik1: has joined #ruby
[02:57:39] Dimik1: dudes dudes
[02:57:47] Dimik1: how can i range a float number
[02:58:07] toretore: romistrub: you will see that chrome initializes a connection and then closes it some time later
[02:58:20] Radar: Dimik1: what
[02:58:24] shevy: Dimik1 what does this mean
[02:58:41] Dimik1: 0.01..0.10
[02:58:51] romistrub: toretore: but I get the 0-byte string on a different socket
[02:58:55] shevy: what should be the output of this
[02:59:18] Dimik1: something like for x in 0.01..0.10 do puts x end
[02:59:24] shevy: no I mean
[02:59:24] toretore: romistrub: what it's doing is making a "preconnect" in case it needs to make another request, then closes it after a timeout when it figures it doesn't need it after all
[02:59:28] shevy: what are the differential steps there?
[02:59:31] toretore: romistrub: https://www.igvita.com/2012/06/04/chrome-networking-dns-prefetch-and-tcp-preconnect/
[02:59:45] shevy: is it 0.01 0.02 etc... or is it 0.010 0.011 etc...
[02:59:51] romistrub: toretore: same thing on firefox, though
[02:59:58] toretore: the "random" element is that chrome has a "predictor" that tries to learn when to preconnect and not
[03:00:00] Dimik1: 0.01 0.02 etc
[03:00:04] Radar: >> a = (0.01)..(0.10); a.to_a
[03:00:07] ruby[bot]: Radar: # => can't iterate from Float (TypeError) ...check link for more (https://eval.in/592396)
[03:00:36] Radar: >> ((0.01)..(0.10)).step(0.01).to_a
[03:00:42] ruby[bot]: Radar: # => [0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1] (https://eval.in/592397)
[03:00:55] chimkan: (1..100).map {|i| i/100.to_f}
[03:01:01] shevy: yay Radar for the rescue
[03:01:13] Dimik1: neat solutions
[03:01:21] shevy: 0.09000000000000001 tripped me up in IRB for a moment :D
[03:01:54] romistrub: toretore: thanks for giving me something to read up on
[03:02:05] romistrub: smathy: thanks for all your help
[03:03:38] toretore: romistrub: in practical terms: you have to check for eof on the socket in your read loop and discard it if a complete request hasn't come through
[03:03:43] smathy: romistrub, you mean that client code you're showing with the `socket.send ""` ? I get a zero length string btw.
[03:03:51] maloik: has joined #ruby
[03:03:55] smathy: ...your client code connecting to your server code.
[03:03:57] northfurr: has joined #ruby
[03:05:07] SilverKey: has joined #ruby
[03:05:45] romistrub: smathy: that's exactly what I mean
[03:06:34] ornerymoose: has joined #ruby
[03:06:41] romistrub: toretore: can u give me an example of using eof?
[03:06:52] smathy: romistrub, last thought, maybe there's an initial empty connection made, and then the browser sends headers in another send. Try doing a second `s << socket.recv(1024)` after your initial `s = socket.recv(1024)` - just as a diagnostic step.
[03:07:41] romistrub: smathy: I'm pretty sure toretore figured out that it's a TCP Preconnect
[03:08:18] romistrub: apparently Chrome doesn't start issuing preconnects until it's expected certain responses from a server, which explains why smathy didn't get the 0-byte recv
[03:08:41] toretore: romistrub: data = ''; loop{ data << socket.recv(1234); break if socket.eof? or can_has_request?(data) }
[03:08:50] toretore: try this one: https://gist.github.com/toretore/46d903100f25af15f421fecf64a140e9
[03:09:21] toretore: open in chrome, then you will see that the preconnect gets made; then if you click the link it will use that connection for the request
[03:09:48] smathy: romistrub, ok cool.
[03:09:55] karmatr0n: has joined #ruby
[03:15:34] LoneHermit: has joined #ruby
[03:16:02] hk238: has joined #ruby
[03:17:16] mattwashere: has joined #ruby
[03:18:07] braincras: has joined #ruby
[03:20:51] Niham: has joined #ruby
[03:20:52] k3rn31: has joined #ruby
[03:22:55] northfurr: has joined #ruby
[03:23:04] tmtwd: has joined #ruby
[03:23:06] mercerist: has joined #ruby
[03:23:10] yfeldblum: has joined #ruby
[03:26:13] tomchapin: has joined #ruby
[03:29:03] gfvcastro: has joined #ruby
[03:29:52] RegulationD: has joined #ruby
[03:34:27] gix: has joined #ruby
[03:34:43] mumbles: has joined #ruby
[03:36:39] swills: has joined #ruby
[03:41:04] mistermo_: has joined #ruby
[03:43:15] aryaching: has joined #ruby
[03:44:53] hahuang62: has joined #ruby
[03:47:20] agentmeerkat: has joined #ruby
[03:48:30] pontiki: has joined #ruby
[03:48:53] toblogan: has joined #ruby
[03:52:58] blackgoat: has joined #ruby
[03:55:34] toblogan: has joined #ruby
[03:56:59] bfig_: has joined #ruby
[04:00:53] wuyin: has joined #ruby
[04:02:15] yardenbar: has joined #ruby
[04:02:48] dopie2: has joined #ruby
[04:03:43] LACampbell: has joined #ruby
[04:03:56] roamingdog: has joined #ruby
[04:05:45] dopie2: has joined #ruby
[04:06:05] ponga: has joined #ruby
[04:09:03] karmatr0n: has joined #ruby
[04:13:58] enterprisey: has joined #ruby
[04:16:43] k3rn31: has joined #ruby
[04:18:16] iajrz: has joined #ruby
[04:19:03] nankyokusei: has joined #ruby
[04:19:41] rkazak: has joined #ruby
[04:20:46] howdoi: has joined #ruby
[04:22:39] iajrz`: has joined #ruby
[04:23:47] moos3: has joined #ruby
[04:24:21] jaguarmagenta: has joined #ruby
[04:26:41] dextertzu: has joined #ruby
[04:28:01] crystal77: has joined #ruby
[04:29:08] LoneHermit: has joined #ruby
[04:32:32] sdothum: has joined #ruby
[04:33:04] dopie2: has joined #ruby
[04:33:07] terminalrecluse: has joined #ruby
[04:36:28] pawnbox: has joined #ruby
[04:37:49] hk238: has joined #ruby
[04:42:56] ahuman: has joined #ruby
[04:44:19] kknight: has joined #ruby
[04:44:21] LACampbell: has left #ruby: ("Ex-Chat")
[04:45:35] hahuang62: has joined #ruby
[04:47:56] Dimik1: has joined #ruby
[04:52:21] diegoaguilar: has joined #ruby
[04:52:42] johnny56_: has joined #ruby
[04:52:59] yardenbar: has joined #ruby
[05:01:29] bfig_: has left #ruby: ()
[05:09:00] kareeoleez: has joined #ruby
[05:11:50] Sangwoo: has joined #ruby
[05:14:53] Brian: has joined #ruby
[05:15:03] Dimik: ACTION np: Ernis - 1 Hour Dark Drum and Bass Mix [55:20m/235kbps/44kHz]
[05:17:47] sauvin: has joined #ruby
[05:18:06] cyphase: has joined #ruby
[05:22:00] ych: has joined #ruby
[05:22:48] Radar: Dimik: no thanks
[05:23:39] _mak_: has joined #ruby
[05:23:52] djbkd: has joined #ruby
[05:25:11] duncannz: has joined #ruby
[05:25:34] emilkarl: has joined #ruby
[05:26:12] _mak_: so, I have this endpoint JSON URI that requires me to be authenticated with cookies. I'm currently using watir to open a browser and authenticate th session. How could I authenticate my script without resorting to watir?
[05:27:40] hk238: has joined #ruby
[05:29:01] ngw: has joined #ruby
[05:33:49] atm0sphere: has joined #ruby
[05:37:37] Nawn: has joined #ruby
[05:38:22] d0lph1n98: has joined #ruby
[05:42:56] rickmasta: has joined #ruby
[05:45:44] bluOxigen: has joined #ruby
[05:46:20] hahuang62: has joined #ruby
[05:47:07] northfurr: has joined #ruby
[05:48:07] raeoks: has joined #ruby
[05:48:51] n1x-nz: has joined #ruby
[05:49:35] gfvcastro: has joined #ruby
[05:50:11] guardianJ: has joined #ruby
[05:52:36] last_staff: has joined #ruby
[05:53:11] mradmacher: has joined #ruby
[05:58:21] pawnbox: has joined #ruby
[06:01:29] the_drow: has joined #ruby
[06:02:47] codecop: has joined #ruby
[06:03:29] TomyLobo: has joined #ruby
[06:04:03] pandaant: has joined #ruby
[06:06:45] aryaching: has joined #ruby
[06:08:33] Niham: has joined #ruby
[06:09:59] aryaching: has joined #ruby
[06:10:23] Dimik: ACTION np: - Dark Drum & Bass MIX - [VOL.3] [80:00m/320kbps/44kHz]
[06:10:37] djbkd: has joined #ruby
[06:10:38] Dimik: stupid script
[06:11:17] pawnbox: has joined #ruby
[06:11:53] moos3: has joined #ruby
[06:12:18] PlasmaStar: has joined #ruby
[06:13:04] binaryplease1: has joined #ruby
[06:14:30] emilkarl: has joined #ruby
[06:17:26] LoneHermit: has joined #ruby
[06:17:55] blaxter: has joined #ruby
[06:19:54] nankyokusei: has joined #ruby
[06:20:00] aryaching: has joined #ruby
[06:20:39] madgen: has joined #ruby
[06:20:43] firstdayonthejob: has joined #ruby
[06:22:16] fenre: has joined #ruby
[06:26:18] karmatr0n: has joined #ruby
[06:27:01] Regulati_: has joined #ruby
[06:28:01] anisha: has joined #ruby
[06:31:19] Madplatypus: has joined #ruby
[06:31:28] vuoto: has joined #ruby
[06:34:12] TomyLobo: has joined #ruby
[06:36:03] bigkevmcd: has joined #ruby
[06:36:21] roamingdog: has joined #ruby
[06:36:23] conta: has joined #ruby
[06:38:21] der-landgraf: has joined #ruby
[06:49:42] emiltin: has joined #ruby
[06:51:04] User458764: has joined #ruby
[06:52:35] timfoo: has joined #ruby
[06:52:50] Ishido: has joined #ruby
[06:54:27] tAn: has joined #ruby
[06:56:05] spiette: has joined #ruby
[06:56:08] ur5us: has joined #ruby
[06:56:55] roamingdog: has joined #ruby
[06:58:40] vdamewood: has joined #ruby
[06:59:47] gettalong: has joined #ruby
[07:00:12] Sp4rKy: laurent2: oui t'as vu j'ai été gentil :p
[07:02:16] Niham_: has joined #ruby
[07:06:47] dionysus69: has joined #ruby
[07:07:46] andikr: has joined #ruby
[07:08:07] craigp_: has joined #ruby
[07:09:44] SolarSailor: has joined #ruby
[07:12:16] ruby-lang467: has joined #ruby
[07:13:35] aredridel: has joined #ruby
[07:14:03] Akuma0n3: has joined #ruby
[07:14:50] Voxxit: has joined #ruby
[07:15:15] yardenbar: has joined #ruby
[07:15:49] xall_: has joined #ruby
[07:16:01] fullstack: has joined #ruby
[07:17:43] zack6849: has joined #ruby
[07:17:43] zack6849: has joined #ruby
[07:17:55] jgt: has joined #ruby
[07:18:13] madgen: has joined #ruby
[07:18:37] twe4ked: has joined #ruby
[07:18:38] aufi: has joined #ruby
[07:20:26] agit0: has joined #ruby
[07:23:06] antgel: has joined #ruby
[07:24:04] cevett_: has joined #ruby
[07:24:09] beawesomeinstead: has joined #ruby
[07:26:23] aries_liuxueyang: has joined #ruby
[07:27:13] karmatr0n: has joined #ruby
[07:27:33] p1k: _mak_: you can set cookie headers on programatic requests just as with a browser, but if you want api access to your endpoint tokens are the more correct way
[07:28:39] aganov: has joined #ruby
[07:30:33] the_drow: has joined #ruby
[07:34:41] Akuma0n3: has joined #ruby
[07:34:41] Silthias: has joined #ruby
[07:34:54] galeido: has joined #ruby
[07:34:55] joonty: has joined #ruby
[07:35:57] Hounddog: has joined #ruby
[07:37:53] ur5us: has joined #ruby
[07:38:09] Infra-Red: has joined #ruby
[07:46:52] multi_io: has joined #ruby
[07:47:51] mistermocha: has joined #ruby
[07:50:20] agentmeerkat: has joined #ruby
[07:50:48] edwinvdgraaf: has joined #ruby
[07:50:59] ngw: has joined #ruby
[07:51:04] SuperLag: has joined #ruby
[07:51:46] mistermo_: has joined #ruby
[07:55:50] mooru: has joined #ruby
[07:58:13] tAn: has joined #ruby
[08:00:04] moos3: has joined #ruby
[08:00:31] Akuma0n3: has joined #ruby
[08:03:04] yfeldblum: has joined #ruby
[08:04:03] yfeldblum: has joined #ruby
[08:04:09] k3rn31: has joined #ruby
[08:06:58] Coldblackice: has joined #ruby
[08:08:07] jaruga___: has joined #ruby
[08:08:29] beawesomeinstead: has joined #ruby
[08:09:04] kp666: has joined #ruby
[08:09:26] lalalaaa_: has joined #ruby
[08:12:51] Hyuk: has joined #ruby
[08:14:10] edwinvdgraaf: has joined #ruby
[08:16:30] pawnbox: has joined #ruby
[08:16:35] ocbtec: has joined #ruby
[08:17:21] skade: has joined #ruby
[08:18:04] Mia: has joined #ruby
[08:18:04] Mia: has joined #ruby
[08:20:48] nankyokusei: has joined #ruby
[08:21:14] dcunit3d: has joined #ruby
[08:22:03] Macaveli: has joined #ruby
[08:22:20] HalpMe: has joined #ruby
[08:22:38] ruby[bot]: has joined #ruby
[08:22:38] ChanServ: +o ruby[bot]
[08:24:13] HalpMe: has left #ruby: ()
[08:24:35] Sashimi_: has joined #ruby
[08:24:57] mrgrieves: has joined #ruby
[08:27:13] edwinvdgraaf: has joined #ruby
[08:28:03] karmatr0n: has joined #ruby
[08:28:50] zacstewart: has joined #ruby
[08:29:58] edwinvdgraaf: has joined #ruby
[08:32:53] pawnbox: has joined #ruby
[08:32:59] tvw: has joined #ruby
[08:35:23] norc: has joined #ruby
[08:37:47] gettalong: has joined #ruby
[08:42:09] roamingdog: has joined #ruby
[08:42:32] tvw: has joined #ruby
[08:43:01] Hanmac: has joined #ruby
[08:45:00] Kedare: has joined #ruby
[08:46:38] moos3: has joined #ruby
[08:47:13] nhhc: has joined #ruby
[08:49:38] nadir: has joined #ruby
[08:50:41] lxsameer: has joined #ruby
[08:51:40] Moosashi: has joined #ruby
[08:52:01] kareeole_: has joined #ruby
[08:54:38] Xeago_: has joined #ruby
[08:55:12] yfeldblum: has joined #ruby
[08:56:17] mistermocha: has joined #ruby
[08:56:58] dionysus69: has joined #ruby
[08:57:14] Spami: has joined #ruby
[08:58:41] mistermo_: has joined #ruby
[09:00:47] mistermocha: has joined #ruby
[09:02:10] yxdjlr: has joined #ruby
[09:02:16] minimalism: has joined #ruby
[09:02:45] mistermo_: has joined #ruby
[09:04:44] mistermo_: has joined #ruby
[09:06:34] mistermocha: has joined #ruby
[09:06:37] snowy: has joined #ruby
[09:06:43] bnagy: has joined #ruby
[09:07:02] the_drow: has joined #ruby
[09:08:30] mistermo_: has joined #ruby
[09:09:18] oshanz: has joined #ruby
[09:09:43] thoraxe: has joined #ruby
[09:10:26] mistermo_: has joined #ruby
[09:10:31] roamingdog: has joined #ruby
[09:10:39] Hyuk: has joined #ruby
[09:10:46] Mia: has joined #ruby
[09:12:21] mistermocha: has joined #ruby
[09:14:15] mistermo_: has joined #ruby
[09:18:58] oshanz: hi all, i'm new to ruby. as of github repository there are only 40 ruby contributors. like to know is that wrong or else why?.
[09:19:18] JoeSa: has joined #ruby
[09:20:07] JoeSa: has joined #ruby
[09:22:14] chip_: has joined #ruby
[09:22:35] _joes__: has joined #ruby
[09:23:26] Sashimi_: has joined #ruby
[09:23:57] moei: has joined #ruby
[09:24:00] Xeago_: has joined #ruby
[09:24:45] giz|work: has joined #ruby
[09:26:51] edwinvdg_: has joined #ruby
[09:27:01] madgen: has joined #ruby
[09:27:11] maloik: oshanz there's no way to tell... a very small library could be "completely done" and see no commits for years, and have a single committer
[09:27:21] the_drow: has joined #ruby
[09:27:27] maloik: for other things you'd want more updates and probably a bigger team behind it, but it's all subjective
[09:27:59] pawnbox: has joined #ruby
[09:28:06] Hanmac: depends ... i did something big like a ruby binding for wxWidgets all by my self
[09:28:25] lukebyrne: has joined #ruby
[09:29:09] karmatr0n: has joined #ruby
[09:29:50] zacstewart: has joined #ruby
[09:30:15] emiltin: has joined #ruby
[09:31:24] jhass: I think they're talking about github.com/ruby/ruby
[09:31:59] Hanmac: jhass: yeah i see it myself ... there are only 40, but they are very active in commiting
[09:32:13] jhass: oshanz: ^ is only a mirror of the SVN repo where the development actually happens. Githubs contributor graph only shows people it could identify (knows the mail address of)
[09:33:18] maloik: nice reading skills, I did not catch that :)
[09:34:42] noodle: has joined #ruby
[09:35:00] jaguarmagenta: has joined #ruby
[09:35:33] oshanz: :relieved: thanks.
[09:35:46] jhass: oshanz: take the second newest commit for example https://github.com/ruby/ruby/commit/0f8a24a706e1e598a0e4bfaff3df0e0f8fc88d8c
[09:36:09] jhass: github couldn't associate it to a github profile and so it won't show up in the contributors list
[09:36:40] zeroDi: has joined #ruby
[09:41:25] oshanz: hope there will be a solution. contributors deserve it.
[09:42:52] jhass: github is not source of truth here
[09:43:06] jhass: don't make it more important than it is
[09:43:26] norc: You are right jhass.
[09:43:27] norc: Slashdot is.
[09:44:46] Hyuk: has joined #ruby
[09:47:23] workmad3: has joined #ruby
[09:48:42] bnagy: has joined #ruby
[09:49:12] marr: has joined #ruby
[09:49:13] oshanz: sory. i didn't mean anything like that. just i prefer github. btw thanks for information.
[09:50:19] bruce_lee: has joined #ruby
[09:51:30] agentmeerkat: has joined #ruby
[09:52:18] roamingdog: has joined #ruby
[09:53:12] LoneHermit: has joined #ruby
[09:55:05] gettalong: has joined #ruby
[09:55:18] marr: has joined #ruby
[09:57:41] fenre: has joined #ruby
[10:01:43] yeticry: has joined #ruby
[10:01:44] kareeoleez: has joined #ruby
[10:05:02] bnagy: has joined #ruby
[10:05:31] lightt: has joined #ruby
[10:06:22] edwinvdgraaf: has joined #ruby
[10:06:33] mercerist: has joined #ruby
[10:09:55] mooru: has joined #ruby
[10:10:12] moeabdol: has joined #ruby
[10:12:29] slackbotgz: has joined #ruby
[10:16:09] emiltin: has joined #ruby
[10:17:30] sdothum: has joined #ruby
[10:19:13] mistermocha: has joined #ruby
[10:20:01] jaruga___: has joined #ruby
[10:20:21] Niham: has joined #ruby
[10:20:43] bnagy: has joined #ruby
[10:21:38] nankyokusei: has joined #ruby
[10:21:49] ponga: what channel should i be asking general programming related question
[10:21:55] Niham: has joined #ruby
[10:23:20] dcunit3d: has joined #ruby
[10:23:59] jhass: I think there's a #programming or ##programming? but eh, here's probably fine too
[10:24:11] Niham: has joined #ruby
[10:25:59] ponga: pypy and crystal lang says its compiler is written in of language itself, why does that work? does CPU/OS naturally understands compiler?
[10:26:05] bnagy: has joined #ruby
[10:26:07] Niham: has joined #ruby
[10:26:14] ponga: its very dumbass question but it always tickled my mind
[10:28:46] Dysp: has joined #ruby
[10:28:48] conta: has joined #ruby
[10:28:55] Ropeney: has joined #ruby
[10:29:23] jhass: ponga: Crystal was bootstrapped with Ruby, pypy (I guess) with CPython (the main/offical one)
[10:29:55] jhass: once you have a basic compiler/interpreter running written in another language, you can then proceed to rewriting it in your own language
[10:30:05] karmatr0n: has joined #ruby
[10:30:33] jhass: So for Crystal, you have the Crystal compiler written in Ruby, which can then compile a compiler written in Crystal
[10:30:51] zacstewart: has joined #ruby
[10:30:54] jhass: that resulting compiler you can then use to compile the next version of the compiler you wrote in Crystal
[10:31:13] mrmortondk: has joined #ruby
[10:32:11] bweston92: has joined #ruby
[10:32:39] ponga: jhass: sounds crazy but thanks
[10:32:54] edwinvdgraaf: has joined #ruby
[10:32:58] jhass: the lession to learn here is that a compiler is nothing special, it's just a program that reads text, interprets it, and generates some kind of output of it, be it other text (source to source compiler), machine code (source to binary compiler) or whatever else really
[10:33:33] ponga: that's right!
[10:33:36] ponga: finally got it
[10:35:10] jhass: and the input is actually not even limited to text, see for example the piet programming language or one could argue that disassemblers are compilers too
[10:36:12] emiltin: has joined #ruby
[10:37:02] ocbtec: has joined #ruby
[10:37:38] GodFather: has joined #ruby
[10:39:00] DoubleMalt: has joined #ruby
[10:40:32] Xeago_: has joined #ruby
[10:43:14] User458764: has joined #ruby
[10:44:01] d0nn1e: has joined #ruby
[10:51:07] edwinvdgraaf: has joined #ruby
[10:52:07] Gasher: has joined #ruby
[10:55:00] snowy: has joined #ruby
[11:00:06] rickmasta: has joined #ruby
[11:01:28] rodfersou: has joined #ruby
[11:02:08] mikecmpbll: has joined #ruby
[11:04:01] gnufied: has joined #ruby
[11:06:32] ruby[bot]: -bb $a:john9218$#ruby-banned john9218!*@*$#ruby-banned
[11:06:43] blaxter: has joined #ruby
[11:06:49] johnmilton: has joined #ruby
[11:06:56] gettalong: has joined #ruby
[11:07:21] mercerist: has joined #ruby
[11:09:16] mercerist: has joined #ruby
[11:11:44] pawnbox: has joined #ruby
[11:16:54] Dysp: If I want to make methods private, like all except one, is there an easier way to do this than to simply private all of those who need be?
[11:16:56] rickmasta: has joined #ruby
[11:17:05] Dysp: I mean, could you write something like "private all except x, y"?
[11:17:46] ljarvis: Dysp: in theory, yes
[11:17:56] Dysp: But we don't do that, now, do we?
[11:18:36] ljarvis: no.. but, surely you could just have any public methods at the top, then use the private keyword without any args, and have all methods below it private?
[11:19:32] ruby[bot]: -bb airmac!*@*$#ruby-banned *!*@paris-s06-i02.cg-dialup.net$#ruby-banned
[11:20:35] ramfjord: has joined #ruby
[11:21:10] Hanmac: has joined #ruby
[11:21:23] Dysp: Alrighty. Thx.
[11:22:12] sepp2k: has joined #ruby
[11:22:18] mistermocha: has joined #ruby
[11:25:55] Xeago_: has joined #ruby
[11:26:35] bnagy: has joined #ruby
[11:26:37] vdamewood: has joined #ruby
[11:28:14] Macaveli: has joined #ruby
[11:30:09] emiltin: has joined #ruby
[11:30:40] fujinuma: has joined #ruby
[11:30:58] karmatr0n: has joined #ruby
[11:30:58] fujinuma: what is the fastest way to get ruby's default load path?
[11:31:15] fujinuma: instead; ruby -e 'puts $:'
[11:31:57] zacstewart: has joined #ruby
[11:32:05] fujinuma: ruby.vim uses that expression but it's too much slow.
[11:32:42] ornerymoose: has joined #ruby
[11:34:36] Hates_: has joined #ruby
[11:35:01] Xeago_: has joined #ruby
[11:35:29] acalewin: has joined #ruby
[11:35:35] ldnunes: has joined #ruby
[11:35:46] jaguarmagenta: has joined #ruby
[11:35:49] zipkid: has joined #ruby
[11:36:15] mdw: has joined #ruby
[11:36:27] Ropeney: has joined #ruby
[11:37:33] jhass: fujinuma: you can speed it up a little with --disable-gems
[11:37:39] jhass: I doubt gem env is any faster
[11:37:41] agit0: has joined #ruby
[11:39:20] armyriad: has joined #ruby
[11:39:34] fujinuma: jhass: what's the equivalent of puts $: in gem env?
[11:39:39] fujinuma: gem env what?
[11:40:12] shinnya: has joined #ruby
[11:40:17] jhass: gem env gempath I think?
[11:40:45] jhass: mh no, it's not even the same, nvm
[11:41:26] fujinuma: jhass: thank you for the --disable-gem flag it's much faster.
[11:41:27] gnufied: has joined #ruby
[11:42:13] moos3: has joined #ruby
[11:42:16] yottanami: has joined #ruby
[11:42:21] yottanami: I have an array like this `[{:name=>"Maz", :age=>22}, {:name=>"Alex", :age=>2}]` now I want update it and change the age of Alex, how can I do using Ruby
[11:43:13] aries_liuxueyang: has joined #ruby
[11:43:31] lukebyrne: has joined #ruby
[11:43:54] d0lph1n98: has joined #ruby
[11:45:22] fujinuma: yottanami: arr.each{|item| item[:key] = "blah" if item[:key]== "Alex"}
[11:45:30] bnagy: has joined #ruby
[11:46:03] Ishido: has joined #ruby
[11:47:54] emiltin: has joined #ruby
[11:48:03] fujinuma: yottanami: `arr.each { |person| person[:name] = "blah" if person[:name] == 'Alex'}` this looks nicer :)
[11:48:38] rodferso1: has joined #ruby
[11:48:56] kknight: has joined #ruby
[11:49:01] ldnunes_: has joined #ruby
[11:49:12] Xeago_: has joined #ruby
[11:50:14] shevy: and another one array = [{:name=>"Maz", :age=>22}, {:name=>"Alex", :age=>2}]; array.select {|entry| entry[:name] == 'Alex' }.first[:name] = 'John Doe' # => # => [{:name=>"Maz", :age=>22}, {:name=>"John Doe", :age=>2}]
[11:50:24] shevy: but in general, if you store it as a hash already, don't put it into an Array on top of that
[11:51:16] Hanmac: has joined #ruby
[11:52:16] agentmeerkat: has joined #ruby
[11:52:36] TomyWork: has joined #ruby
[11:53:26] jord-n: has joined #ruby
[11:53:27] joonty: has joined #ruby
[11:53:32] mradmacher: has joined #ruby
[11:55:18] gheegh: has joined #ruby
[11:59:12] Xeago_: has joined #ruby
[11:59:14] chimkan: has joined #ruby
[12:00:04] fmcgeough: has joined #ruby
[12:01:12] bnagy: has joined #ruby
[12:01:21] f4cl3y: has joined #ruby
[12:01:28] agit0: has joined #ruby
[12:02:42] moos3_: has joined #ruby
[12:03:08] pawnbox: has joined #ruby
[12:04:21] k3rn31: has joined #ruby
[12:07:46] shevy: http://brew.sh/
[12:07:52] shevy: https://perlbrew.pl/
[12:08:10] shevy: the ninja image rules though
[12:08:35] ornerymoose: has joined #ruby
[12:08:53] shevy: oh... it is more like rvm, not homebrew
[12:11:15] synthroid: has joined #ruby
[12:11:57] strigon33: has joined #ruby
[12:12:07] ornerymoose_: has joined #ruby
[12:12:11] jmignault: has joined #ruby
[12:12:14] Ropeney: has joined #ruby
[12:12:59] arne_: has joined #ruby
[12:13:37] aries_liuxueyang: has joined #ruby
[12:13:51] arne_: grml, how does one insert a tag in a text node with nokogiri?
[12:13:52] neha-: has joined #ruby
[12:14:24] madgen: has joined #ruby
[12:14:56] emilkarl: has joined #ruby
[12:16:58] skade: has joined #ruby
[12:19:44] bluOxigen: has joined #ruby
[12:20:11] allcentury: has joined #ruby
[12:22:28] nankyokusei: has joined #ruby
[12:23:24] freerobby: has joined #ruby
[12:25:27] dcunit3d: has joined #ruby
[12:25:53] gettalong: has joined #ruby
[12:26:14] cevett_: has joined #ruby
[12:27:14] cevett: has joined #ruby
[12:27:22] jrafanie: has joined #ruby
[12:28:00] GodFather: has joined #ruby
[12:28:53] madgen: has joined #ruby
[12:29:17] gfvcastro: has joined #ruby
[12:29:38] Hanmac: arne_: hm textnodes should not be able to have tags ... normally you would need to replace the text node ... but i currently don't know how ... i need to look it up
[12:32:00] karmatr0n: has joined #ruby
[12:32:37] zacstewart: has joined #ruby
[12:33:14] mistermocha: has joined #ruby
[12:33:33] edwinvdg_: has joined #ruby
[12:35:31] Xeago_: has joined #ruby
[12:36:05] rkazak: has joined #ruby
[12:36:18] aupadhye: has joined #ruby
[12:36:19] jhass: shevy: http://linuxbrew.sh/
[12:36:53] arne_: hanmac: guess i will have to "split" the text node, insert a node in between
[12:37:42] Hanmac: arne_: yeah i think that is what need to be done ... i don't know if nokogiri has a helper for that :/ you might ask at #nokogiri
[12:38:05] arne_: there is .swap which swaps a node with another node(set)
[12:38:12] arne_: which makes this pretty easy, i will see
[12:39:00] mistermocha: has joined #ruby
[12:39:21] arne_: so wait, people built a package manager for macosx, so they can install stuff linux user always have
[12:39:33] chip_: has joined #ruby
[12:39:34] arne_: and someone sits down and builds a packagemanager so he can install those packages on his linux machine?
[12:39:50] YaknotiS: has joined #ruby
[12:40:18] hutch34: has joined #ruby
[12:40:29] mistermo_: has joined #ruby
[12:42:47] pawnbox: has joined #ruby
[12:43:36] szybkapoczta: has joined #ruby
[12:43:48] chemiazpolski: has joined #ruby
[12:47:39] Rodya_: has joined #ruby
[12:48:10] strigonLeader: has joined #ruby
[12:48:22] szybkapoczta: has joined #ruby
[12:49:45] chemiazpolski: has joined #ruby
[12:50:45] mistermocha: has joined #ruby
[12:54:10] bmurt: has joined #ruby
[12:54:22] mistermo_: has joined #ruby
[12:57:46] jhass: amazing, isn't it?
[12:58:11] mrmortondk: has joined #ruby
[12:59:05] jhass: well linuxbrew does make sense for shared stuff where you can only install to $HOME actually ;)
[12:59:23] jhass: toastball's toast is a bit dated these days
[13:00:59] Xeago_: has joined #ruby
[13:02:32] c0mrad3: has joined #ruby
[13:04:17] spiette: has joined #ruby
[13:04:50] jgt1: has joined #ruby
[13:06:03] ChiefAlexander: has joined #ruby
[13:09:02] mshowman: has joined #ruby
[13:09:14] toretore: has joined #ruby
[13:10:27] moos3: has joined #ruby
[13:10:46] Macaveli: has joined #ruby
[13:12:26] gfvcastro: has joined #ruby
[13:13:34] SirOliver: has joined #ruby
[13:14:54] edwinvdgraaf: has joined #ruby
[13:16:04] nerium: has joined #ruby
[13:16:29] Yiota: has joined #ruby
[13:17:16] nhhc: has joined #ruby
[13:17:49] pawnbox: has joined #ruby
[13:18:02] mattwashere: has joined #ruby
[13:18:12] edwinvdgraaf: has joined #ruby
[13:19:40] A124: has joined #ruby
[13:19:47] aegis3121: has joined #ruby
[13:19:59] gfvcastro: has joined #ruby
[13:20:10] Vile`: has joined #ruby
[13:21:20] malconis: has joined #ruby
[13:22:19] mtkd: has joined #ruby
[13:23:21] GodFather_: has joined #ruby
[13:23:29] noway_: has joined #ruby
[13:25:53] pawnbox: has joined #ruby
[13:26:09] malconis: has joined #ruby
[13:29:21] nettoweb: has joined #ruby
[13:31:23] strigon33: has joined #ruby
[13:31:59] zacstewart: has joined #ruby
[13:32:05] edwinvdgraaf: has joined #ruby
[13:32:56] prestorium: has joined #ruby
[13:32:57] karmatr0n: has joined #ruby
[13:34:11] isxek: has joined #ruby
[13:36:29] jaguarmagenta: has joined #ruby
[13:37:03] symm-: has joined #ruby
[13:37:12] VeryBewitching: has joined #ruby
[13:38:56] eljimmy: has joined #ruby
[13:39:46] bkxd: has joined #ruby
[13:40:12] SilverKey: has joined #ruby
[13:40:59] pawnbox: has joined #ruby
[13:42:42] craigp: has joined #ruby
[13:42:46] pontiki: has joined #ruby
[13:44:01] hinbody: has joined #ruby
[13:47:46] mercerist: has joined #ruby
[13:49:09] aryaching: has joined #ruby
[13:50:09] hk238: has joined #ruby
[13:50:40] ifsp: has joined #ruby
[13:53:15] insanedreamer: has joined #ruby
[13:53:15] palms: has joined #ruby
[13:53:26] `tim`: has joined #ruby
[13:54:37] dasher00: has joined #ruby
[13:54:42] sergio_101: has joined #ruby
[13:55:51] User458764: has joined #ruby
[13:56:16] northfurr: has joined #ruby
[13:56:41] LoneHerm_: has joined #ruby
[13:57:02] User458764: Hi, when using block methods like array.collect {} how do you refer to the instance. I see something very cool in Swift which do that but I can't reproduce it in ruby
[13:58:12] wigust: has joined #ruby
[13:58:47] agentmeerkat: has joined #ruby
[13:59:29] jhass: what does "the instance" even mean here?
[13:59:35] jhass: the array?
[13:59:52] User458764: toretore oh great I see finally an interest to Swift over ruby :)
[14:00:29] jhass: yes you can't, you have to closure the initial variable
[14:00:31] User458764: I thought a self will does the job but not
[14:00:38] jhass: so what's the cool thing?
[14:01:06] mattwashere: has joined #ruby
[14:01:35] User458764: jhass the shorthand syntax https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Closures.html
[14:01:36] mikecmpbll: depends exactly what you're trying to do but can probably suggest a way to do it.
[14:01:58] jhass: User458764: I was more interested in some real world usecases
[14:02:48] reloaded: has joined #ruby
[14:03:19] User458764: mikecmpbll jhass when you are using array powerful builtin api and you want to refer to the index
[14:03:24] arne_: grml, why does nokogiri support creating notes from "chunks" everywhere, but when you want to create element
[14:03:44] apeiros: notes = nodes?
[14:03:53] jhass: User458764: so array.map.with_index {|elem, i| } ?
[14:04:00] apeiros: and "but when" = "but not when"?
[14:04:20] sdwrage: has joined #ruby
[14:04:25] apeiros: then phrase no parse
[14:04:39] User458764: jhass yes I saw this same expression in the collect documentation
[14:04:47] arne_: apeiros: pardon?
[14:05:06] wigust_: has joined #ruby
[14:05:07] apeiros: arne_: can't make sense of what you said
[14:05:24] jhass: User458764: I find the stuff under "Shorthand Argument Names" in your link very confusing
[14:05:29] jhass: I think perl has similar stuff
[14:05:34] apeiros: "but when you want to create elements" - yeah, then what? lacks some statement as is…
[14:05:37] kareeoleez: has joined #ruby
[14:05:43] Xeago_: has joined #ruby
[14:05:48] toretore: SyntaxError
[14:05:56] arne_: "... anything, but" sounds pretty valid to me
[14:06:10] jhass: User458764: I prefer to have readable names for stuff that actually have a semantic meaning for the data
[14:06:18] User458764: In the expression you gave me array.map.with_index {|elem, i| } how do you refer to the 'array' instance to collect only even index for example?
[14:06:34] arne_: i like every icecream, but chocolate
[14:06:36] mikecmpbll: User458764 : the example in that link you gave about passing a sorting function to the sort method can be done in ruby with lambdas, which are closures too
[14:06:46] apeiros: arne_: so "but" as "but not"
[14:06:50] mikecmpbll: >> backwards = ->(a, b){ b <=> a }; [1,2,3,4,5].sort(&backwards)
[14:06:51] apeiros: which you explicitly said "nope"
[14:06:54] ruby[bot]: mikecmpbll: # => [5, 4, 3, 2, 1] (https://eval.in/592845)
[14:07:11] arne_: no you didn't use the word "as" you used "=" which is equal, which is not equal.
[14:07:29] User458764: mikecmpbll hum interresting I bookmark it
[14:07:32] apeiros: arne_: uh dude, then you should have said "no" when I asked "notes = nodes"
[14:07:45] mikecmpbll: User458764 : that's identical to the sort example under "The Sort Method".
[14:07:52] jhass: User458764: I'm not sure what you mean, two possible interpretations: array.map.with_index {|elem, i| i.even? ? func(elem) : elem } or array.select.with_index {|_, i| i.even? }.map {|elem| func(elem) }
[14:08:12] reloaded: Gem net-ldap, how can I search internal ldap attributes like "pwdAccountLockedTime"? With ldapsearch command there is the "+" option who enables you to see those attributes but is there any in this gem?
[14:08:29] User458764: jhass ok it's the first time I see func method thanks
[14:08:32] arne_: either way.. nokogiri let's me add siblings like node.add_sibling "<img src="whatever.png">", but i cannot create an element like that, to insert it later on
[14:08:38] arne_: and i can't find the code in their github
[14:08:39] KCmetro: has joined #ruby
[14:08:59] apeiros: arne_: use Nokogiri.HTML("<element>")?
[14:09:11] arne_: that creates a document, where i have to search the element i want to insert
[14:09:13] jhass: User458764: tbh I have the feeling your use of "the instance" is not what you actually mean by it
[14:09:15] arne_: which is possible, but superugly
[14:09:45] apeiros: arne_: and Nokogiri.HTML.fragment("<element>")?
[14:10:10] apeiros: doesn't work. but there was something like that
[14:10:14] cdg: has joined #ruby
[14:10:46] apeiros: ah, Nokogiri::HTML.fragment("<element>"). but that doesn't given an element either. it's a DocumentFragment
[14:10:54] arne_: apeiros: well works for me
[14:10:58] jhass: User458764: func is a placeholder for some arbitrary operation on elem applied, I made it up on the spot, it's nothing given by the language
[14:11:05] arne_: apeiros: doc.at()
[14:11:22] arne_: apeiros: doc.at('//body').first.add_child Nokogiri::HTML.fragment('<img src="google.de">') does i what i want, thanks
[14:11:30] arne_: the nokogiri docs confused me there .. somehow
[14:11:49] apeiros: curious why a plain string doesn't work :-/
[14:11:50] mikecmpbll: arne_ , apeiros : not sure i'm following this exactly, but it sounded like it might be similar to an issue i was having a few years ago: http://stackoverflow.com/a/29219261/1520714
[14:12:01] mikecmpbll: this dude's answer seems comprehensive, if it is at all related
[14:12:13] arne_: still weird, that you can use html"fragments" everyhwere but in element-creations
[14:12:15] mikecmpbll: if not, ignore me :)
[14:12:32] apeiros: arne_: agreed
[14:12:46] apeiros: .add_child("html string") would make sense
[14:12:56] arne_: well, that works, i think
[14:13:21] apeiros: then I'm again confused as to what your issue is :D
[14:13:25] apeiros: but I got to go afk now
[14:13:30] arne_: yeah i will explain it, let me.. okeh
[14:14:38] arne_: i have html templates with ruby-style-placeholders "#{example}", and i was using .gsub to replace them, after i went into html-escaping-errors, i went with nokogiri :D
[14:14:52] arne_: now i cannot use gsub since it escapes { and } :D
[14:14:53] swills: has joined #ruby
[14:15:38] arne_: and if i want to insert a (for example) <img> node in text, i will have to rearrange everything, bleh
[14:16:00] arne_: so find text node => find placeholder => split textnode in 2 => insert img tag in between
[14:16:05] toretore: el.add_next_sibling('<img src="something"/>') #=> [#<Nokogiri::XML::Element:0x2ab4b63820d0 name="img" attributes=[#<Nokogiri::XML::Attr:0x2ab4b63820a8 name="src" value="something">]>]
[14:16:09] toretore: i don't see the issue
[14:16:28] arne_: that's no issue, i could easily add 3 elements, and remove the original
[14:16:41] arne_: but thats not "clean", i would rather want to use
[14:16:52] arne_: node.swap [text1,img-node,text2]
[14:17:29] arne_: toretore: i was just confused how you can use <img src="something"> everywhere, but in element creation
[14:17:41] toretore: what do you mean element creation?
[14:17:45] mdw: has joined #ruby
[14:17:46] toretore: you are very confusing
[14:17:53] arne_: document.create_element('img')
[14:17:59] arne_: gives you an "img" node
[14:18:16] arne_: but you cannot do document.create_element('<img src="something">')
[14:18:58] k3rn31: has joined #ruby
[14:19:48] arne_: (i would create the nodes programmatically, but i already have them as strings, and they're alot)
[14:20:16] TvL2386: has joined #ruby
[14:20:28] toretore: well, it makes sense that you get a fragment because a string can contain more than one element
[14:21:02] arne_: im not confused about fragments, i was unable to find fragments at all being documented as suited for my use-case
[14:21:07] arne_: fragments seem to be what i want
[14:22:08] karmatr0n: has joined #ruby
[14:22:35] Xeago_: has joined #ruby
[14:22:59] agent_white: has joined #ruby
[14:23:21] nankyokusei: has joined #ruby
[14:23:22] M-shine: has joined #ruby
[14:23:31] TvL2386: hi guys, I'm trying to send complex objects with Savon 2.11 but I have no clue if it's even possible...
[14:23:46] arne_: just DO IT
[14:23:51] TvL2386: yeah that came out wrong
[14:23:59] TvL2386: I'm doing it, but failing miserably
[14:24:32] TvL2386: savon does not seem to understand how to convert objects to valid soap xml I think
[14:25:17] toretore: good luck with that
[14:25:47] mikecmpbll: TvL2386 : complex objects?
[14:26:03] TvL2386: I was just wondering if anybody is familiar with soap and complex types
[14:26:33] mikecmpbll: TvL2386 : i've used savon quite a extensively.
[14:26:44] TvL2386: ah cool mikecmpbll
[14:28:11] dcunit3d: has joined #ruby
[14:28:14] TvL2386: let me show you
[14:29:02] TvL2386: I need to generate the following: https://gist.github.com/TvL2386/d3ad767c8bebb02de312a1af7396876d
[14:30:53] mikecmpbll: TvL2386 : okay, and what's the problem?
[14:31:15] skade: has joined #ruby
[14:31:25] TvL2386: well I'm struggling on how to get savon to create that output
[14:32:15] Xeago_: has joined #ruby
[14:32:20] mikecmpbll: TvL2386 : what are you struggling with? ...
[14:33:04] M-Kodo: has joined #ruby
[14:33:04] mistermocha: has joined #ruby
[14:34:04] SilverKey: has joined #ruby
[14:34:05] TvL2386: mikecmpbll, I don't know how to create the :message that I supply to Savon.client.call(:prequal, message: { ???? })
[14:34:47] mikecmpbll: TvL2386 : oh okay. savon converts the hash to xml (and does a little bit of other nice stuff)
[14:34:55] skade: has joined #ruby
[14:35:07] aufi: has joined #ruby
[14:35:36] freerobby: has joined #ruby
[14:36:28] TvL2386: mikecmpbll, yes... And in my generated xml I have: <env:Body><tns:prequal><orderLocation>#<Vendor1::OrderLocation:0x00562c35649698></orderLocation><productGroup>THE_PRODUCT</productGroup></tns:prequal></env:Body>
[14:36:38] allcentury: has joined #ruby
[14:36:51] mikecmpbll: TvL2386 : okay, why are you passing a ruby object to the soap message?
[14:37:44] User458764: has joined #ruby
[14:37:53] mikecmpbll: you'll probably want to render that object to XML before putting it in the message.
[14:37:53] mistermocha: has joined #ruby
[14:38:20] TvL2386: mikecmpbll, hmmm..... I thought I would keep that object around so I can add other things like persisting to the DB... That's probably gonna happen
[14:38:59] TvL2386: mikecmpbll, yeah that sounds good. And how would I get the "href" object references in the output?
[14:39:05] mikecmpbll: that fine, but you can't just plonk the object in the hash and expect savon to know how to convert it to your valid xml soap request.
[14:39:51] mistermocha: has joined #ruby
[14:40:16] TvL2386: mikecmpbll, yeah true :)
[14:41:15] mikecmpbll: TvL2386 : from what i recall (although i can't actually find it in the docs) to create attributes on the elements, you pass them under the key `attributes!`
[14:41:48] gfvcastro: has joined #ruby
[14:42:24] mikecmpbll: like message: { foo: "bar", attributes!: { foo: { "baz" => "blah" } } would result in something like <foo baz="blah">bar</foo>
[14:44:39] TvL2386: mikecmpbll, so what you are saying is to work with sub elements instead of having references to the objects as shown in the gist?
[14:44:46] mistermocha: has joined #ruby
[14:45:12] mikecmpbll: TvL2386 : no i was trying to explain how to get the element attributes like in the gist.
[14:45:26] TvL2386: oh the href!
[14:45:32] roamingdog: has joined #ruby
[14:46:00] polishdub: has joined #ruby
[14:47:03] mwlang: Is there a better way to tell the time portion of a Time is zero than t.hour + t.min + t.sec == 0 ?
[14:47:44] fujinuma: has left #ruby: ("Leaving")
[14:47:56] roamingdog: has joined #ruby
[14:48:43] rippa: has joined #ruby
[14:49:15] yardenbar: has joined #ruby
[14:51:23] crystal77: has joined #ruby
[14:51:45] snath: has joined #ruby
[14:52:12] M-mistake: has joined #ruby
[14:52:35] mistermocha: has joined #ruby
[14:53:04] SirOliver: has joined #ruby
[14:53:30] mistermo_: has joined #ruby
[14:54:01] sergio_101: has joined #ruby
[14:54:25] mikecmpbll: mwlang : with Time, i doubt it.
[14:54:49] jnoob22: has joined #ruby
[14:55:20] Macaveli: has joined #ruby
[14:56:29] mistermo_: has joined #ruby
[14:56:51] TvL2386: mikecmpbll, I've gotten the href to work like you said, added an example and output: https://gist.github.com/TvL2386/d3ad767c8bebb02de312a1af7396876d#file-ruby_snippet-rb
[14:57:28] mikecmpbll: TvL2386 : lovely
[14:58:05] diegoaguilar: has joined #ruby
[14:59:21] Silthias1: has joined #ruby
[15:00:50] shevy: jhass I think I saw it years ago... but I never tried it, I have become controlled by inertia!
[15:01:10] mattwashere: has joined #ruby
[15:02:07] aegis3121: has joined #ruby
[15:02:25] cdg: has joined #ruby
[15:02:41] strigon33: has joined #ruby
[15:02:46] Masstodon: has joined #ruby
[15:02:54] arne_: how great is that String#split keeps captured regex groups inside the split!?
[15:02:56] arne_: supergreat.
[15:03:43] Bish: >> "test \#{yo} test2".split /(\#{[^}]+})/
[15:04:10] Bish: >> "test \#{yo} test2".split /(\#{[^}]+})/
[15:04:20] ruby[bot]: Bish: # => ["test ", "\#{yo}", " test2"] (https://eval.in/592882)
[15:04:27] mistermocha: has joined #ruby
[15:04:32] Bish: isn't that f-ing great!?
[15:05:27] mistermo_: has joined #ruby
[15:05:30] PaulCapestany: has joined #ruby
[15:05:38] wvxtdg: has joined #ruby
[15:05:55] theRealAlexz: has joined #ruby
[15:05:55] theRealAlexz: has joined #ruby
[15:06:15] rcs: has joined #ruby
[15:06:36] giz|work: has joined #ruby
[15:07:24] mistermocha: has joined #ruby
[15:08:45] Dimik: has joined #ruby
[15:09:27] SirOliver: has joined #ruby
[15:10:46] Vingador: has joined #ruby
[15:11:04] safetypin: has joined #ruby
[15:11:21] mistermocha: has joined #ruby
[15:12:01] SirOliver: has joined #ruby
[15:12:29] Akuma: has joined #ruby
[15:12:37] Bish: shevy: why?
[15:13:19] mistermocha: has joined #ruby
[15:13:48] codecop: has joined #ruby
[15:14:09] mistermocha: has joined #ruby
[15:15:14] biberu: has joined #ruby
[15:15:57] shevy: because of the \#{}
[15:20:07] Xeago_: has joined #ruby
[15:20:39] freerobby: has joined #ruby
[15:22:50] Bish: well that was just for demonstration
[15:24:00] Bish: >> 'test #{yo} test2'.split /(\#{[^}]+})/
[15:24:02] Bish: better? :3
[15:24:10] ruby[bot]: Bish: # => ["test ", "\#{yo}", " test2"] (https://eval.in/592891)
[15:24:11] Bish: :( bottie whats wrong
[15:24:29] roamingdog: has joined #ruby
[15:24:56] miqlas-H: has joined #ruby
[15:25:55] mattwashere: has joined #ruby
[15:26:11] Silthias: has joined #ruby
[15:27:56] aryaching: has joined #ruby
[15:29:15] TomyLobo: has joined #ruby
[15:29:20] CJKinni: has joined #ruby
[15:29:37] dionysus69: has joined #ruby
[15:30:48] roamingdog: has joined #ruby
[15:32:18] Xeago__: has joined #ruby
[15:34:31] miqlas-H: has joined #ruby
[15:35:15] CloCkWeRX: has joined #ruby
[15:35:33] gfvcastro: has joined #ruby
[15:35:35] synthroid: has joined #ruby
[15:35:42] allcentury: has joined #ruby
[15:36:16] apeiros: Bish: you're probably not identified with nickserv?
[15:36:22] iCHAIT_: has left #ruby: ()
[15:36:32] ChiefAlexander: has joined #ruby
[15:36:56] jhass: it came back after all?
[15:37:13] jaguarmagenta: has joined #ruby
[15:37:16] giz|work: has joined #ruby
[15:38:39] Ishido: has joined #ruby
[15:39:58] SirOliver: has joined #ruby
[15:41:25] marr: has joined #ruby
[15:42:23] Xeago_: has joined #ruby
[15:42:26] shevy: ruboto! come back!
[15:42:54] gregf_: >> p "am back"
[15:43:02] shevy: ruboto was so human-like, people constantly thought that ruboto was a real person
[15:43:04] ruby[bot]: gregf_: # => "am back" ...check link for more (https://eval.in/592897)
[15:43:45] Billias: has joined #ruby
[15:43:47] jhass: shevy: hint, do /whois ruby[bot]
[15:44:05] shevy: a butler bot!
[15:44:17] jhass: look at the cloak
[15:44:27] snath: has joined #ruby
[15:45:44] Xeago_: has joined #ruby
[15:55:08] Xeago_: has joined #ruby
[15:55:59] Ishido: has joined #ruby
[16:00:11] apeiros: jhass: oh, so it did…
[16:01:03] jhass: might just be eval.in being slow
[16:01:08] jhass: did so on the old host too sometimes
[16:01:14] User458764: has joined #ruby
[16:01:19] Xeago_: has joined #ruby
[16:01:32] Mia: has joined #ruby
[16:02:00] mikecmpbll: has joined #ruby
[16:02:05] bmurt_: has joined #ruby
[16:02:10] mercerist: has joined #ruby
[16:02:39] amclain: has joined #ruby
[16:02:56] romistrub: has joined #ruby
[16:03:17] whathappens: has joined #ruby
[16:03:24] romistrub: for anyone that was here last night; toretore or smathy; I finally figured out what was causing the 0-byte string returned by recv
[16:03:27] Ishido: has joined #ruby
[16:03:52] adam12: which was?
[16:04:00] romistrub: It's the closing of a connection created by an TCP Preconnect
[16:04:24] romistrub: Figured out that closing causes the usually-blocking recv to return a string of 0 length
[16:04:33] jrafanie: has joined #ruby
[16:04:44] freerobby: has joined #ruby
[16:05:03] romistrub: then tested the preconnect out using a <link rel="preconnect"/> in the HTML I was delivering
[16:05:15] romistrub: it turned out that a preconnect is initiated almost immediately, and is closed 5-10 seconds later
[16:05:22] romistrub: it's that closing that was futzing me up
[16:05:35] blandflakes: has joined #ruby
[16:09:40] Kus: has joined #ruby
[16:13:22] KCmetro: has joined #ruby
[16:13:45] bkxd: has joined #ruby
[16:14:20] last_staff: has joined #ruby
[16:14:31] danostrowski: has joined #ruby
[16:16:15] mercerist: has joined #ruby
[16:16:19] bluOxigen: has joined #ruby
[16:17:33] mattwashere: has joined #ruby
[16:18:09] [Butch]: has joined #ruby
[16:18:57] yardenbar: has joined #ruby
[16:21:27] nadir: has joined #ruby
[16:23:56] SCHAAP137: has joined #ruby
[16:24:13] nankyokusei: has joined #ruby
[16:24:33] Xeago_: has joined #ruby
[16:25:29] mtkd: has joined #ruby
[16:27:42] Kallis: has joined #ruby
[16:29:40] gfvcastro: has joined #ruby
[16:30:11] dcunit3d: has joined #ruby
[16:30:30] mercerist: has joined #ruby
[16:32:11] dionysus69: has joined #ruby
[16:32:18] freerobby1: has joined #ruby
[16:36:36] mistermocha: has joined #ruby
[16:37:20] vuoto: has joined #ruby
[16:39:47] smathy: has joined #ruby
[16:40:20] ChiefAlexander: has joined #ruby
[16:40:50] moeabdol: has joined #ruby
[16:40:56] Coldblackice: has joined #ruby
[16:42:32] LoneHerm_: has joined #ruby
[16:44:11] tAn: has joined #ruby
[16:44:50] gregf: has joined #ruby
[16:45:31] vuoto: has joined #ruby
[16:46:54] ruby-lang191: has joined #ruby
[16:49:20] frem_: has joined #ruby
[16:49:36] globalall0c: has joined #ruby
[16:50:13] gettalong: has joined #ruby
[16:50:26] ocbtec: has joined #ruby
[16:51:18] jnoob22: has joined #ruby
[16:51:48] SCHAAP137: has joined #ruby
[16:52:40] smathy: romistrub, thanks for the update.
[16:53:02] ruby-lang191: Can someone help me with understanding the function def of line 3 in https://gist.github.com/anonymous/52e0e7d130fdf02ca7e626f8d139dab2 or what to google for?
[16:54:02] smathy: ruby-lang191, if it's the `h.` that you don't understand: singleton method. If it's the `[]=` that you don't understand, umm, just ruby docs.
[16:55:13] ruby-lang191: cool, thanks!
[16:55:44] mebus: has left #ruby: ()
[16:55:50] smathy: Happy to explain either here if you need it, but some people like discovering for themselves, so I don't want to ruin the experience if that's you :)
[16:57:13] SirOliver: has joined #ruby
[16:57:37] dopie2: has joined #ruby
[16:57:38] tomchapin: has joined #ruby
[16:59:11] diegoaguilar: has joined #ruby
[16:59:47] Xeago_: has joined #ruby
[17:00:15] Chau: has joined #ruby
[17:01:35] `tim`: has joined #ruby
[17:02:02] hxegon_AFK: how does this work?
[17:02:38] hxegon: >> [1, 2].send(*[:map, proc { |n| n * 2 }])
[17:02:51] hxegon: * not work
[17:03:02] apeiros: a proc as arg != a block arg
[17:03:17] AnoHito: has joined #ruby
[17:03:25] apeiros: you need to prefix a proc with & to tell ruby that it is to be treated as a block
[17:03:26] Moosashi: has joined #ruby
[17:03:32] madgen: has joined #ruby
[17:03:58] apeiros: >> meth, block = [:map, proc { |n| n * 2 }]; [1,2].send(meth, &block)
[17:04:04] ruby[bot]: apeiros: # => [2, 4] (https://eval.in/592932)
[17:04:07] hxegon: so you can't splat an array with a block and have it treat it as a block?
[17:04:23] crdpink2: has joined #ruby
[17:05:20] yardenbar: has joined #ruby
[17:05:28] hahuang62: has joined #ruby
[17:05:58] fabianfrz1: has joined #ruby
[17:06:20] mdw7: has joined #ruby
[17:06:25] the_drow: has joined #ruby
[17:06:29] smathy: >> [1, 2].send :map, &proc{|n| n * 2 }
[17:06:33] ruby[bot]: smathy: # => [2, 4] (https://eval.in/592933)
[17:07:16] mdw7: has joined #ruby
[17:07:34] bmbouter: has left #ruby: ("WeeChat 1.2")
[17:07:57] apeiros: also public_send > send
[17:08:12] ruby-lang191: `h = {} def h.[]=(k, v)` Why is a singleton method being called on an empty hash in the def? Also what is []= , on docs I found it as setting environment variable but I think I'm looking up the wrong thing.
[17:08:29] smathy: The & has to be part of the method call though, so yeah, no closer to the splat.
[17:08:33] apeiros: ruby-lang191: that's not calling a method, that's defining it
[17:08:38] fabianfrz1: are some ruby developers here - I have a question about URI
[17:08:48] User458764: has joined #ruby
[17:08:57] smathy: fabianfrz1, best to just ask.
[17:09:01] apeiros: it defines the []= method for that single hash instance. and []= is what's invoked when you do: `some_hash[key] = value`
[17:10:08] fabianfrz1: I had to do this change because URI raises an exception if I would not do that: https://github.com/fabianfrz/ICAPrb-Server/commit/ae1cb025122d76f70bd41f480068c1996db96dc5
[17:10:30] dsimon: ruby-lang191, it's literally defining a method named "[]=" on h
[17:11:01] djbkd: has joined #ruby
[17:11:25] fabianfrz1: URI('host:port') should imho return a generic uri where the host and the port are set
[17:11:46] fabianfrz1: but my little workaround just works
[17:12:16] fabianfrz1: what is your opinion about that?
[17:12:20] spider-mario: has joined #ruby
[17:12:26] dsimon: fabianfrz1, what was the exception it raised, and the value of "str_uri" which it complained about?
[17:12:50] fabianfrz1: it is host:port_number
[17:13:48] fabianfrz1: it comes from the network protocol - in this case it is an http connect method
[17:14:14] Xiti: has joined #ruby
[17:14:33] bkxd: has joined #ruby
[17:14:41] smathy: fabianfrz1, works for me in 2.3 - which version of ruby did you see an exception in?
[17:15:15] bmurt: has joined #ruby
[17:15:24] dsimon: >> uri = URI("example.com:123")
[17:15:31] ruby[bot]: dsimon: # => undefined method `URI' for main:Object (NoMethodError) ...check link for more (https://eval.in/592934)
[17:15:36] dsimon: oh, need to require
[17:15:43] dsimon: >> require 'uri'; URI("example.com:123")
[17:15:46] ruby[bot]: dsimon: # => #<URI::Generic example.com:123> (https://eval.in/592935)
[17:16:11] Moosashi: has joined #ruby
[17:16:15] gettalong: has left #ruby: ()
[17:16:40] dsimon: >> require 'uri'; u = URI("example.com:123"); "host #{u.host}, port #{u.port}"
[17:16:50] fabianfrz1: URI('1.localhost:123')
[17:16:58] ruby[bot]: dsimon: # => "host , port " (https://eval.in/592936)
[17:17:02] fabianfrz1: this one fails
[17:17:04] Sashimi: has joined #ruby
[17:17:10] dsimon: oh, hm, it didn't work
[17:17:25] fabianfrz1: it is strange
[17:18:14] finisherr: has joined #ruby
[17:18:16] dsimon: >> require 'uri'; require 'pp'; u = URI("example.com:123"); u.pretty_inspect
[17:18:23] ruby[bot]: dsimon: # => "#<URI::Generic example.com:123>\n" (https://eval.in/592937)
[17:18:28] dsimon: well that wasn't helpful :-(
[17:18:29] smathy: fabianfrz1, still didn't raise an exception though, I'm struggling with the symptom report.
[17:18:44] mistermocha: has joined #ruby
[17:19:12] fabianfrz1: did you start it with 1.
[17:19:17] mistermocha: has joined #ruby
[17:19:17] smathy: URI is actually pretty crappy at parsing URIs
[17:19:34] tAn: has joined #ruby
[17:19:57] smathy: >> require "uri"; URI("example.com:443").scheme
[17:19:58] jetpackjoe: has joined #ruby
[17:20:02] fabianfrz1: irb(main):005:0> a = URI('1.localhost:123')
[17:20:03] fabianfrz1: URI::InvalidURIError: bad URI(is not URI?): 1.localhost:123
[17:20:16] ruby[bot]: smathy: # => "example.com" (https://eval.in/592938)
[17:20:27] dsimon: it thinks the first part is the protocol :-(
[17:20:36] smathy: Yep, the colon throws it.
[17:20:42] smathy: It's really not a URI parser at all.
[17:20:43] apeiros: 1 is not valid as a subdomain afair
[17:20:43] dsimon: i guess that is reasonable of it
[17:20:57] smathy: ...although: "example.com:443" is not a URI.
[17:20:59] dsimon: since without a protocol it's not a proper URI according to the rfc
[17:21:02] fabianfrz1: some CDNs are numbered this way
[17:21:07] Macaveli: has joined #ruby
[17:21:30] smathy: dsimon, I actually think your code isn't terrible, the CONNECT request does *not* provide a URI.
[17:21:31] dsimon: or a "scheme" as the official docs put it
[17:21:36] apeiros: and missing the scheme, yes
[17:21:37] smathy: ...it provides a host:port
[17:21:41] dsimon: smathy, s'not my code :-)
[17:21:48] smathy: Heh, sorry...
[17:21:52] smathy: fabianfrz1, ^
[17:21:52] apeiros: fabianfrz1: I doubt that
[17:23:18] smathy: fabianfrz1, just checking, you *do* understand that "1.localhost:123" *is* a bad URI right? As is "example.com:443" for that matter.
[17:23:34] hinbody: has joined #ruby
[17:24:21] Laxu5: has joined #ruby
[17:24:21] dopie2: has joined #ruby
[17:24:25] fabianfrz1: ok, so everything works as expected and this should not be used as an uri - however the server requires it as it decides which service it will call
[17:24:47] fabianfrz1: It works just fine now ;)
[17:24:50] jhack: has joined #ruby
[17:25:05] ramfjord: has joined #ruby
[17:27:23] SilverKey: has joined #ruby
[17:27:26] jottr: has joined #ruby
[17:28:02] gfvcastro: has joined #ruby
[17:28:32] KCmetro: has joined #ruby
[17:28:57] ocbtec: has joined #ruby
[17:29:59] enterprisey: has joined #ruby
[17:30:08] fabianfrz1: thanks for your help
[17:31:48] gatman: has joined #ruby
[17:36:35] shevy: I am having a blackout I think ...
[17:36:55] shevy: from code like: class Base; end; class A < Base; end ... is there a way to find out the direct superclass from class A?
[17:37:18] pilne: has joined #ruby
[17:37:20] havenwood: shevy: ask it
[17:37:39] shevy: ah... .superclass I guess
[17:37:40] havenwood: shevy: A.superclass
[17:37:51] shevy: I think I never used this so far, thanks
[17:38:02] jaguarmagenta: has joined #ruby
[17:39:46] vuoto: has joined #ruby
[17:40:23] k3rn31: has joined #ruby
[17:41:09] Moosashi: has joined #ruby
[17:41:10] havenwood: shevy: you're welcome, any time!
[17:42:29] wixad_: has joined #ruby
[17:42:41] havenwood: shevy: thanks back - i updated my method finding code to not bug out finding that answer :)
[17:43:42] dfockler: has joined #ruby
[17:44:11] conta: has joined #ruby
[17:46:33] AlexRussia: has joined #ruby
[17:46:34] KCmetro: has joined #ruby
[17:51:48] ruby-lang191: I'm still confused about https://gist.github.com/anonymous/52e0e7d130fdf02ca7e626f8d139dab2 and googling for []= and hash method isn't leading me anywhere
[17:52:08] mistermocha: has joined #ruby
[17:53:02] ruby-lang191: So it's creating a singleton method in a def, which is confusing. And is (k,v) the paramters for the method or is it the values taken from the hash after a key/value is assigned?
[17:53:43] malconis: it's overriding []= for h (hash)
[17:53:52] malconis: looks like it's just printing out what it's doing
[17:54:21] weaksauce: has joined #ruby
[17:54:24] malconis: so now whenever you're setting value for a key it'll print out "Setting hash key #{k} with #{v.inspect}"
[17:54:49] craigp: has joined #ruby
[17:56:29] ruby-lang191: what about the (k,v) part? is that the method param?
[17:56:58] toretore: it's just a method, like any other
[17:57:07] toretore: it takes two arguments
[17:57:37] k3rn31: has joined #ruby
[17:57:51] quakephil: has joined #ruby
[17:58:20] aeruder: has joined #ruby
[17:58:23] ruby-lang191: havent seen that kind of method def before and I'm still trying to understand it.
[17:58:46] ruby-lang191: are there similar examples I can search for? I don't know what to search for?
[17:59:21] quakephil: Greets all! How can I access an array inside a sort_by block? I'm getting "nil" when trying to use it here http://pastebin.ca/3649166
[17:59:26] nofxx: has joined #ruby
[17:59:26] nofxx: has joined #ruby
[18:00:01] quakephil: (line 22, sortedkeys.index(k) turns out to be nil)
[18:00:36] whathappens: has joined #ruby
[18:00:39] mistermocha: has joined #ruby
[18:00:42] dsimon: ruby-lang191, this seems to cover the topic pretty well: http://rubysnippets.com/2013/01/25/operator-overloading-in-ruby/
[18:01:05] dsimon: note that the other weird thing about the snippet you posted is that it's not only doing operator overloading, it's also defining a method on a singleton class
[18:01:08] Brian: has joined #ruby
[18:01:41] ramfjord: has joined #ruby
[18:02:08] dsimon: quakephil, it's a symbols vs strings problem
[18:02:12] dsimon: that's my guess anyways
[18:02:21] dsimon: try sortedkeys.index(k.to_sym)
[18:02:31] toretore: quakephil: it doesn't have anything to do with `sortedkeys` not being accessible
[18:02:50] memorasus1: has joined #ruby
[18:02:52] jhass: yes two problems there
[18:03:11] jhass: first is symbols vs strings, just the other way around than dsimon mentioned
[18:03:22] jhass: second is that sortedkeys doesn't have all keys you ask it for
[18:03:23] dsimon: oh, right, yeah
[18:03:34] `tim`: has joined #ruby
[18:03:38] dsimon: ACTION nods in agreement
[18:03:49] aegis3121: has joined #ruby
[18:03:50] quakephil: jhass: that's by design
[18:03:53] jhass: so .index returns nil in some (currently all) situations
[18:04:03] jhass: and you can't 0 <=> nil
[18:04:06] memorasus1: Would anyone be kind enough to review my code for a project I'm working on and suggest things I could do differently? It's the first script i'm writing in ruby so I don't know where it could be improved
[18:04:16] quakephil: can you help me write the sorter? I essentually want to get to the sorted hash, from unsorted hash, using sortedkeys as a guide
[18:04:25] quakephil: sortedkeys may or may not have all keys
[18:04:39] quakephil: any hints/pointers are welcome
[18:04:45] jhass: tbh I still consider depending on the order of a hash a code smell in itself
[18:05:10] memorasus1: https://github.com/bcoffey218/msf_rc is the project, if anyone has a minute to check it out
[18:05:13] quakephil: Ordering a hash is one of the basic functions of this data structure
[18:05:15] jhass: quakephil: what's the order of keys not in sortedkeys?
[18:05:17] hxegon: agreed, hashes should be order independant
[18:05:23] tAn: has joined #ruby
[18:05:28] quakephil: jhass: either as before, or doesn't matter
[18:05:52] quakephil: whichever is simpler to implement
[18:05:52] postmodern: has joined #ruby
[18:06:09] jhass: quakephil: wrong, Hash is Ruby's implementation of a map. The ADT map doesn't define order. Ruby's Hash was in fact unordered up to version 1.9
[18:06:20] quakephil: doesn't help
[18:06:31] jhass: just getting the misconceptions out of the way first
[18:06:42] ramfjord_: has joined #ruby
[18:07:45] dionysus69: has joined #ruby
[18:08:07] jhass: .sort {|(a, _), (b, _)| a_i = sortedkeys.index(a); b_i = sortedkeys.index(b); a_i && b_i ? a_i <=> b_i : a_i || b_i ? 1 : a <=> b } should be your solution
[18:09:08] agit0: has joined #ruby
[18:09:14] quakephil: Holy mother of god... let me give that a shot
[18:09:16] mikecmpbll: has joined #ruby
[18:10:26] quakephil: http://pastebin.ca/3649176 doesn't seem to be sorting; also returning a array whereas I should really want a hash in the same form back, but ordered
[18:10:46] dikaio: has joined #ruby
[18:11:03] quakephil: I'm on 2.3.0p0
[18:11:06] roamingdog: has joined #ruby
[18:11:06] jhass: yes you have to convert it back.
[18:11:18] jhass: Ruby's hash is insertion ordered. It does not support reordering in place
[18:11:54] phrozen77_: has joined #ruby
[18:11:57] kirun: has joined #ruby
[18:12:03] whathapp_: has joined #ruby
[18:12:11] quakephil: ok that's fine, but the ordering doesn't seem to be working either, the resulting array is still in the original order?
[18:13:00] araujo: has joined #ruby
[18:13:17] roamingdog: has joined #ruby
[18:14:03] jhass: you ignored the first problem I mentioned
[18:14:39] quakephil: I want to get this working. If I missed something, its not because I'm ignoring it
[18:14:59] quakephil: Its because I'm a noob who is trying to learn with your help
[18:15:18] quakephil: so what did I miss? Do I have to convert the hash to an array first?
[18:15:34] jhass: you have scrollback, reread what I and dsimon wrote
[18:16:03] quakephil: I thought "should be your solution" meant it should be my solution
[18:17:07] dsimon: jhass, why have them use sort instead of sort_by?
[18:17:31] jhass: because you can't compare Fixnum and nil
[18:17:38] ramfjord: has joined #ruby
[18:17:57] quakephil: http://pastebin.ca/3649186 using to_sym doesn't seem to help either
[18:18:19] dsimon: quakephil, i was wrong, i should've said "to_s"
[18:19:27] quakephil: Aha, that works
[18:19:30] dsimon: quakephil, if the key isn't present in sortedkeys, should that element go before everything eles, or after?
[18:19:41] xall_: has joined #ruby
[18:19:44] quakephil: It doesn't handle missing sortedkeys well, but for now I don't think you guys have the patience to help with any more of this
[18:19:50] quakephil: sorry to be such a burden
[18:20:26] arlek: has joined #ruby
[18:20:33] Authenticator: has joined #ruby
[18:20:45] [Butch]_: has joined #ruby
[18:21:07] jhass: quakephil: sorry I had a mistake, this one works https://carc.in/#/r/126w
[18:21:45] dsimon: jhack, quakephil, i would've probably done something like .sort_by{|k,v| sortedkeys.index(k.to_s) || -1}
[18:23:51] jhass: well if we're sorting already, it's good to have a deterministic result
[18:23:55] jhass: alternative: https://carc.in/#/r/126x
[18:24:45] dsimon: then maybe .sort_by{|k,v| [sortedkeys.index(k.to_s) || -1, k] }
[18:25:04] nankyokusei: has joined #ruby
[18:25:11] jhass: allocates N arrays more than necessary ;)
[18:25:20] nettoweb: has joined #ruby
[18:26:25] dsimon: maybe the best thing would be a sort_bys method that takes multiple blocks and executes them in sequence on ties...
[18:26:35] memorasus: anyone have any recommendations for my script ?
[18:26:55] dsimon: so like .sort_bys(Proc.new{|k| sortedkeys.index(k.to_s}, Proc.new{|k| k})
[18:27:08] dsimon: er, missing a paren, but you get the idea :-)
[18:27:08] shevy: memorasus looks great!
[18:27:25] shevy: your nick was memorasus1
[18:27:41] memorasus: shevy: is there anything you think I could do to make it faster/more efficient?
[18:27:42] nerium: has joined #ruby
[18:27:56] memorasus: yeah i noticed i was logged in on 2 computers, then logged out the other
[18:28:23] shevy: I did not notice the earlier link, I think you referred to https://github.com/bcoffey218/msf_rc but I am not sure which part you mean
[18:29:06] ruby-lang989: has joined #ruby
[18:29:43] memorasus: https://github.com/bcoffey218/msf_rc/blob/master/enumeration.rc
[18:29:43] memorasus: This is the main script, everything else is just nonsense / dependent directories
[18:30:17] moeabdol: has joined #ruby
[18:30:31] mtkd: has joined #ruby
[18:30:45] synthroid: has joined #ruby
[18:30:52] LoneHerm_: has joined #ruby
[18:31:47] dcunit3d: has joined #ruby
[18:32:14] shevy: I think you can simplify the various serv.name =~/sql/ lines
[18:34:03] `tim`: has joined #ruby
[18:34:34] memorasus: I don't even need it explained, just a link to that stuff would be tremendously helpful, I know virtually nothing about ruby lol
[18:34:52] Hanmac: shevy *now making an Uncle Sam pose' i need you to Dislike the Ghostbusters 2016 Trailer ... there are still a few numbers left until 1.000.000 ;P
[18:36:00] dsimon: memorasus, google "ruby case regex" :-)
[18:36:24] gfvcastro: has joined #ruby
[18:37:03] Macaveli: has joined #ruby
[18:37:18] memorasus: Perfect, muchas gracias
[18:37:30] tAn: has joined #ruby
[18:38:05] jgt1: has joined #ruby
[18:38:35] shevy: memorasus best way to build up a regex is at http://rubular.com/
[18:38:36] kareeoleez: has joined #ruby
[18:38:52] shevy: you can make a link to the solution from your script, to rubular
[18:38:55] shevy: click at "make permalink"
[18:39:04] memorasus: idk if you'd know this if you haven't worked with metasploit, but do you know if theres a way to interact with the framework / datastore without actually being in msf?
[18:39:24] shevy: no idea, I think the amount of people here who use or need metasploit is very very low
[18:39:58] memorasus: That's what I expected, but then in the offsec channel people just tell you to try harder lol
[18:40:13] shevy: memorasus here one of the regex possibilities: http://rubular.com/r/9ztKUTo1nE
[18:40:18] memorasus: thanks, so for the input in rubular, would it be like /ssh/
[18:40:37] User458764: has joined #ruby
[18:41:38] memorasus: perfect, will that still work to match any part of the string to match? example:
[18:41:39] memorasus: ssh version 1.02.12312312343 will be matched for ssh?
[18:42:36] DTZUBDUB: has joined #ruby
[18:43:50] crystal77: has joined #ruby
[18:45:56] alcy_: has joined #ruby
[18:45:58] memorasus: brb gotta restart my vm
[18:45:58] mattwashere: has joined #ruby
[18:46:29] memorasus: has joined #ruby
[18:46:33] alcy_: hello folks, is it possible to do multiple lines of code in erb templates ? I am trying to create a variable first, and then process that
[18:46:37] ruby-lang814: has joined #ruby
[18:46:43] aryaching_: has joined #ruby
[18:47:37] PaulePanter: Hi. Any idea how to improve readability and performance of
[18:47:40] PaulePanter: arr.reject{|l| l[:date].nil?}.sort_by{|v| v[:date]}.reverse?
[18:47:45] jackjackdripper: has joined #ruby
[18:47:54] PaulePanter: ? at end is part of the sentence.
[18:48:09] aegis3121: arr.compact.sort { |a, b| b[:date] <=> a[:date] }
[18:48:27] aegis3121: not compact, you'll still need #reject
[18:49:00] smathy: alcy_, yes.
[18:49:13] jhass: alcy_: yes but you shouldn't do it, your framework should offer you a way to extract that logic into a method external from the template and allow you to call it then
[18:49:18] aegis3121: though you could use select. arr.select { |thing| thing[:date] } if you prefer thinking about select rather than reject
[18:49:25] dikaio: has joined #ruby
[18:50:05] dsimon: i like PaulePanter's original version best
[18:50:23] jhass: Id add some spaces but it's pretty good already
[18:50:24] joonty: has joined #ruby
[18:50:44] alcy_: jhass: I am doing this in puppet's context, so my options are a little limited.
[18:50:50] ruby[bot]: Please join #puppet for help with it.
[18:51:37] Hanmac: ACTION is now known as "I'Mrakul"
[18:51:55] jhass: PaulePanter: posts.reject {|post| post[:date].nil? }.sort {|a, b| b[:date] <=> a[:date] } would save the reverse call
[18:52:43] nankyokusei: has joined #ruby
[18:52:50] aegis3121: And, yea: I think .select { |post| post[:date] } reads slightly better, but that's a matter of choice. Saves a method call on #nil?, though.
[18:54:04] dikaio: has joined #ruby
[18:54:08] chip_: has joined #ruby
[18:56:19] wigust: has joined #ruby
[18:56:52] PaulePanter: aegis3121, jhass: Thanks a lot.
[18:57:12] mercerist: has joined #ruby
[18:57:15] ytti: anyone have extra berlin/ietf venue hotel reservation they want to get rid of?
[18:57:18] CJKinni`: has joined #ruby
[18:57:34] Hanmac: i always wanted some kind of reverse sort, but that doesn't exist yet
[19:00:08] mattwashere: has joined #ruby
[19:01:01] dikaio: has joined #ruby
[19:01:57] edwinvdg_: has joined #ruby
[19:03:10] yfeldblum: has joined #ruby
[19:04:42] Pumukel: has joined #ruby
[19:05:18] CJKinni: has joined #ruby
[19:06:16] bluOxigen: has joined #ruby
[19:07:01] VeryBewitching: has joined #ruby
[19:07:07] mikecmpbll: has joined #ruby
[19:07:55] wigust: has joined #ruby
[19:08:30] dcunit3d: has joined #ruby
[19:08:33] gizmore: has joined #ruby
[19:09:15] ramfjord: has joined #ruby
[19:10:49] SilverKey: has joined #ruby
[19:11:32] zenlot: has joined #ruby
[19:12:03] elifoster: has joined #ruby
[19:12:36] dikaio: has joined #ruby
[19:15:19] bkxd: has joined #ruby
[19:15:38] giz|work: has joined #ruby
[19:16:26] Sashimi: has joined #ruby
[19:18:43] nofxx: has joined #ruby
[19:20:01] Madplatypus: has joined #ruby
[19:20:24] BrianJ: has joined #ruby
[19:22:51] replay: has joined #ruby
[19:23:20] Mia: has joined #ruby
[19:23:20] Mia: has joined #ruby
[19:24:05] yardenbar: has joined #ruby
[19:24:22] amcoder: has joined #ruby
[19:24:33] jmignault: has joined #ruby
[19:25:17] Endie: has joined #ruby
[19:25:39] Akuma: has joined #ruby
[19:26:40] dcunit3d: has joined #ruby
[19:27:35] nankyokusei: has joined #ruby
[19:27:43] hahuang61: has joined #ruby
[19:28:10] hays_: has joined #ruby
[19:28:40] havenwood: ruby-install --latest ruby-2.4.0-preview1
[19:29:54] marens_: has joined #ruby
[19:29:54] marens_: has joined #ruby
[19:30:04] Bish: has joined #ruby
[19:30:33] aibot: has joined #ruby
[19:31:26] kdisneur: has joined #ruby
[19:31:27] hiddenloop: has joined #ruby
[19:31:32] riceandbeans: has joined #ruby
[19:31:32] shaman42: has joined #ruby
[19:31:33] schlauberg: has joined #ruby
[19:31:34] ahuman: has joined #ruby
[19:31:36] ruisantos: has joined #ruby
[19:31:41] lianj: has joined #ruby
[19:31:41] lianj: has joined #ruby
[19:31:45] dionyziz: has joined #ruby
[19:31:45] AustinMatherne: has joined #ruby
[19:32:02] Janno: has joined #ruby
[19:32:05] bnjf: has joined #ruby
[19:32:07] timanema: has joined #ruby
[19:32:10] jzigmund: has joined #ruby
[19:32:15] olspookishmagus: has joined #ruby
[19:32:29] kloeri_: has joined #ruby
[19:32:58] ramblinpeck: has joined #ruby
[19:33:07] cardoni: has joined #ruby
[19:33:23] chrisseaton: has joined #ruby
[19:35:20] SenpaiSilver: has joined #ruby
[19:35:21] Trynemjoel: has joined #ruby
[19:35:23] okdas: has joined #ruby
[19:35:23] okdas: has joined #ruby
[19:35:23] chridal: has joined #ruby
[19:35:24] chee: has joined #ruby
[19:35:25] electrostat: has joined #ruby
[19:35:30] bumao: has joined #ruby
[19:35:49] Tristan-Speccy: has joined #ruby
[19:36:04] Satyajit: has joined #ruby
[19:36:05] ldnunes: has joined #ruby
[19:38:40] jgt1: has joined #ruby
[19:38:54] danostrowski: has joined #ruby
[19:39:13] gypsydave5: has joined #ruby
[19:39:21] tAn: has joined #ruby
[19:39:48] timanema: has joined #ruby
[19:39:55] jackjackdripper: has joined #ruby
[19:40:00] sambio: has joined #ruby
[19:40:30] Macaveli: has joined #ruby
[19:41:39] arlek: has joined #ruby
[19:41:57] aegis3121: has joined #ruby
[19:42:15] Dimik1: has joined #ruby
[19:42:17] kp666: has joined #ruby
[19:42:23] cdg: has joined #ruby
[19:43:50] K1SWR: has joined #ruby
[19:44:01] siovene: has joined #ruby
[19:44:11] havenwood: baweaver: This patch that landed in 2.4.0-preview1 made me think of our ivar/local speed convo re puma: https://bugs.ruby-lang.org/issues/12274
[19:44:54] cajone: has joined #ruby
[19:45:22] tildes: has joined #ruby
[19:45:40] Bugboy1028: has joined #ruby
[19:46:07] whathappens: has joined #ruby
[19:46:17] _mak_: has left #ruby: ("..")
[19:47:10] havenwood: It'd be nice to simplify the Puma thread pool code once pre-2.4 is past EoL at the very least! (Unless it's really worth doing even now. I haven't done thorough benchmarks.)
[19:48:37] modin: has joined #ruby
[19:49:42] whathappens: has joined #ruby
[19:50:54] ruby-lang191: Is there a rails IRC or people answer rails questions here also?
[19:51:05] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[19:51:10] shevy: ruby-lang191 #rubyonrails but you may have to register first on freenode
[19:51:37] ruby-lang191: has left #ruby: ()
[19:51:48] whathappens: has joined #ruby
[19:52:15] whathappens: has joined #ruby
[19:54:00] smathy: You don't ^
[19:56:00] KCmetro: has joined #ruby
[19:56:54] dcunit3d: has joined #ruby
[19:58:00] pwnd_nsfw: has joined #ruby
[19:59:23] Yiota: has joined #ruby
[20:00:20] tomchapin: has joined #ruby
[20:01:02] blackgoat: has joined #ruby
[20:01:13] jhass: well, Radar's switching it on and off all the time, can't be bothered to change the factoid each time
[20:02:59] smathy: No harm anyway :)
[20:05:02] centrx: has joined #ruby
[20:06:21] Guest48: has joined #ruby
[20:07:33] dhollinger: has joined #ruby
[20:10:26] lightt: has joined #ruby
[20:10:41] neo_: has joined #ruby
[20:11:49] modin: has joined #ruby
[20:12:41] apeiros: jhass: we could change it to "you may need to…"
[20:13:11] crystal77: has joined #ruby
[20:15:14] fabianfrz1: has left #ruby: ("Konversation terminated!")
[20:15:50] pawnbox: has joined #ruby
[20:17:30] ur5us: has joined #ruby
[20:17:41] moos3_: has joined #ruby
[20:17:46] edwinvdgraaf: has joined #ruby
[20:18:19] lightt: has joined #ruby
[20:18:42] lightt: has joined #ruby
[20:19:12] Lord_of_Life: has joined #ruby
[20:19:15] LoneHermit: has joined #ruby
[20:21:24] shevy: let unregistered users change factoids for you!!!
[20:22:46] timanema: has joined #ruby
[20:24:14] Jayson_Virissimo: has joined #ruby
[20:25:14] danostrowski: has joined #ruby
[20:25:24] timanema: has joined #ruby
[20:26:02] blandflakes: has joined #ruby
[20:26:37] deviation: has joined #ruby
[20:26:47] Endie: has joined #ruby
[20:29:10] aep-shoutlet: has joined #ruby
[20:29:27] deviation: I have a ruby question that I'm not sure how to ask properly... I have a hash with many optional items and I want to send its values to a method only if they're defined in the hash. The method I'm calling takes values named keyword arguments. Ie I would like to call: myMethod(id: data['id']) if data['id'] is set, otherwise I'd like to just call myMethod()
[20:29:41] deviation: is there a shorthand/clean way to do that?
[20:31:03] ldnunes_: has joined #ruby
[20:31:06] tobiasvl: deviation: well, if data['id'] is not set it will be nil, so handle nil as a special case inside myMethod?
[20:31:06] bier: has joined #ruby
[20:31:08] [Butch]: has joined #ruby
[20:31:13] mradmacher: How about something like myMethod(data.fetch('id', nil))
[20:31:27] tobiasvl: mradmacher: won't it already be nil?
[20:31:29] deviation: myMethod is in a 3rd party lib
[20:31:34] tobiasvl: as long as data is set of course
[20:31:50] deviation: that I can't (or don't want to) modify
[20:31:50] toretore: deviation: what is myMethod actually?
[20:31:51] jhass: deviation: does it require the arguments to be passed?
[20:31:52] havenwood: deviation: If open source, link to the code?
[20:32:08] deviation: im writing something for vagrant
[20:32:10] deviation: https://www.vagrantup.com/docs/synced-folders/basic_usage.html#mount_options
[20:32:10] tobiasvl: oh. well then what about data['id'] ? myMethod(data['id']) : myMethod
[20:32:29] gusrub: has joined #ruby
[20:32:43] deviation: I have config that populates a hash, and sometimes the 'owner' and 'group' will be set and sometimes they will not
[20:32:47] jhass: that says it takes an array, not keyword arguments?
[20:32:47] timanema: has joined #ruby
[20:32:50] deviation: if they're not set, vagrant defaults them to be the vagrant user
[20:33:44] deviation: i think OPTIONS are keyword arguments
[20:34:20] deviation: tobiasvl: I want to avoid having to specify all the permutations if that makes sense
[20:34:26] modin: has joined #ruby
[20:34:28] tAn: has joined #ruby
[20:34:35] deviation: like there are many potential arguments and I don't want to have to list them all out if I can avoid it
[20:34:40] havenwood: mount_options: [data['id']].compact
[20:34:42] toretore: deviation: show some actual code if you can
[20:34:48] jhack: has joined #ruby
[20:34:56] deviation: k, I'll write a gist if that helps
[20:34:57] toretore: code > words
[20:35:01] timanema: has joined #ruby
[20:35:44] mtkd: has joined #ruby
[20:35:44] timanema: has joined #ruby
[20:37:11] havenwood: love the 2.4 stuff!
[20:37:44] havenwood: i was jealous of Clojure/Elixir unicode case
[20:38:08] jhass: deviation: given it doesn't even show up in API docs it's probably not keyword arguments but a plain hash still
[20:38:25] Yiota: has joined #ruby
[20:38:53] jhass: so just symbolize your keys and pass your hash
[20:39:28] Endie: has left #ruby: ()
[20:39:44] lightt: python or java
[20:39:56] lightt: to make money
[20:40:04] lightt: medium income
[20:40:21] johnny56_: has joined #ruby
[20:40:23] ejnahc: has joined #ruby
[20:40:30] gse: has joined #ruby
[20:40:35] lightt: wrong room sry
[20:40:54] deviation: https://gist.github.com/deviation/cd9eea84f16c38537ec9443b0a221ed4
[20:41:20] jhass: deviation: as said I think you assumption is wrong
[20:41:24] deviation: ahh ok, I'm new to ruby
[20:41:38] deviation: I'll look up how to do that @jhass
[20:42:06] jhass: options = {owner: "foo"}; config.vm.synced_folder ..., options
[20:42:08] ornerymoose: has joined #ruby
[20:42:14] deviation: I was under the (apparently wrong) assumption that passing a hash or keywords to a method was the same idea
[20:42:44] jhass: it can look the same on the call side
[20:43:27] sdothum: has joined #ruby
[20:45:16] deviation: thanks jhass!
[20:47:41] raldu: is there any free or paid resource that I can consult to learn more about API development best practices?
[20:47:55] nettoweb: has joined #ruby
[20:47:57] raldu: including the API clients
[20:48:45] jhass: deviation: yeah it's all just big fat method_missing magic, no keyword arguments https://github.com/mitchellh/vagrant/blob/1f88a9737369eda3dede0d3aeb30928adf82a9f7/lib/vagrant/config/v2/root.rb#L24-L37
[20:49:01] Jayson_Virissimo: raldu: https://www.codeschool.com/courses/surviving-apis-with-rails
[20:49:28] Jayson_Virissimo: A bit dated by now, but was pretty decent when I went through it.
[20:50:12] gizless: has joined #ruby
[20:50:37] raldu: Jayson_Virissimo: looks like a nice guide, thanks.
[20:50:51] deviation: ahh thank you so much
[20:51:05] tao_: has joined #ruby
[20:52:08] eljimmy: has joined #ruby
[20:53:09] Masstodon: has left #ruby: ()
[20:53:12] whathappens: has joined #ruby
[20:54:04] pglombardo: has joined #ruby
[20:54:16] gizmore: has joined #ruby
[20:55:23] gizmore|2: has joined #ruby
[20:56:02] RegulationD: has joined #ruby
[20:56:24] gizmore|3: has joined #ruby
[20:59:58] mattwashere: has joined #ruby
[21:00:10] FooMunki: has joined #ruby
[21:01:26] shevy: lightt tell me more about how to make money! :)
[21:02:00] lightt: has left #ruby: ("Leaving")
[21:02:23] bmurt_: has joined #ruby
[21:03:51] moos3: has joined #ruby
[21:04:04] Gasher: has joined #ruby
[21:04:05] diegoviola: has joined #ruby
[21:04:09] moos3: has left #ruby: ()
[21:04:10] Neo--: has joined #ruby
[21:05:49] strigonLeader: has joined #ruby
[21:06:46] giz|work: has joined #ruby
[21:07:29] deviation: has joined #ruby
[21:09:10] smathy: You scared him off shevy
[21:09:30] vuoto: has joined #ruby
[21:09:58] caudill: has joined #ruby
[21:13:03] hahuang61: has joined #ruby
[21:13:44] yfeldblum: has joined #ruby
[21:13:57] hutch34: has joined #ruby
[21:14:04] ICantCook: has joined #ruby
[21:14:52] shevy: awww no money for me :(
[21:15:13] smathy: Not without mad python java skillz.
[21:15:16] millerti: has joined #ruby
[21:15:29] kimegede: has joined #ruby
[21:15:34] giz|work|2: has joined #ruby
[21:15:54] deviation: has joined #ruby
[21:16:06] bkxd: has joined #ruby
[21:16:34] dcunit3d: has joined #ruby
[21:16:38] Macaveli: has joined #ruby
[21:17:29] tomchapin: has joined #ruby
[21:17:54] xall_: has joined #ruby
[21:18:12] CJKinni: has joined #ruby
[21:19:19] Eiam: has joined #ruby
[21:22:35] ChiefAlexander: has joined #ruby
[21:24:37] Sashimi: has joined #ruby
[21:25:47] firstdayonthejob: has joined #ruby
[21:26:19] postmodern: has joined #ruby
[21:27:57] p0p0pr37: has joined #ruby
[21:28:05] spudowiar: wait... I haz mad python java skillz.
[21:28:16] spudowiar: LIGHTT, COME BACK!
[21:29:14] skweek: has joined #ruby
[21:30:25] AndyBotwin: has joined #ruby
[21:32:00] whathappens: has joined #ruby
[21:32:01] djbkd: has joined #ruby
[21:32:36] hxegon: before the money there was love
[21:34:58] mello: has joined #ruby
[21:35:39] AndyBotwin: has joined #ruby
[21:35:53] prestorium: has joined #ruby
[21:36:04] troulouliou_div2: has joined #ruby
[21:36:54] shevy: lol this is getting better and better
[21:37:23] GodFather: has joined #ruby
[21:37:42] mradmacher: but love for money is always
[21:39:18] jaguarmagenta: has joined #ruby
[21:42:40] pilne: has left #ruby: ("Leaving!")
[21:42:43] wigust: has joined #ruby
[21:42:52] moeabdol: has joined #ruby
[21:42:59] karapetyan: has joined #ruby
[21:44:51] lightt: has joined #ruby
[21:45:33] djbkd: has joined #ruby
[21:45:48] Radar: jhass: the registration thingo on #rubyonrails is now firmly on :)
[21:46:11] kimegede: has left #ruby: ("Linkinus - http://linkinus.com")
[21:47:46] karapetyan: has joined #ruby
[21:48:46] nankyokusei: has joined #ruby
[21:48:47] snowy: has joined #ruby
[21:49:44] shevy: good that nobody changed the factoid!
[21:50:35] allcentury: has joined #ruby
[21:53:27] tomeara: has joined #ruby
[21:58:57] jnoob22: has joined #ruby
[21:59:05] timanema: has joined #ruby
[22:00:29] neanderslob: has joined #ruby
[22:01:14] minimalism: has joined #ruby
[22:02:07] hahuang61: has joined #ruby
[22:06:27] al2o3-cr: has joined #ruby
[22:08:08] pawnbox: has joined #ruby
[22:08:13] gizmore: has joined #ruby
[22:11:30] minimalism: has joined #ruby
[22:14:00] ornerymoose: has joined #ruby
[22:15:18] elcontrastador: has joined #ruby
[22:17:08] edwinvdgraaf: has joined #ruby
[22:18:12] moeabdol: has joined #ruby
[22:18:16] banister: has joined #ruby
[22:19:17] kareeole_: has joined #ruby
[22:22:18] moeabdol: has joined #ruby
[22:22:29] Es0teric: has joined #ruby
[22:23:03] machinewar: has joined #ruby
[22:23:21] machinewar: anyone know what Rack#BodyProxy class is used for?
[22:24:44] Azure: has joined #ruby
[22:30:30] whathappens: has joined #ruby
[22:32:46] giz|work|2: has joined #ruby
[22:40:00] gnufied: has joined #ruby
[22:40:57] ereslibre: has joined #ruby
[22:40:57] ereslibre: has joined #ruby
[22:45:57] pawnbox: has joined #ruby
[22:51:58] allcentury: has joined #ruby
[22:52:37] rickmasta: has joined #ruby
[22:53:30] shevy: people are not patient anymore
[22:55:25] ledestin: has joined #ruby
[22:58:23] rkazak: has joined #ruby
[23:00:15] bmurt: has joined #ruby
[23:00:39] Gasher: has joined #ruby
[23:02:00] rickmasta: has joined #ruby
[23:03:37] mistermocha: has joined #ruby
[23:03:48] ramfjord: has joined #ruby
[23:04:07] nettoweb: has joined #ruby
[23:05:18] xall: has joined #ruby
[23:09:22] rkazak: has joined #ruby
[23:09:35] rickmasta: has joined #ruby
[23:10:24] marxarelli: has joined #ruby
[23:13:31] skweek: has joined #ruby
[23:13:38] tAn: has joined #ruby
[23:13:47] ramfjord: has joined #ruby
[23:16:18] rickmasta: has joined #ruby
[23:16:52] bkxd: has joined #ruby
[23:16:53] Guest48: has joined #ruby
[23:21:23] whathappens: has joined #ruby
[23:21:41] mattwashere: has joined #ruby
[23:25:54] pwnd_nsfw`: has joined #ruby
[23:26:39] koooge: has joined #ruby
[23:27:41] jottr: has joined #ruby
[23:30:37] glcx: has joined #ruby
[23:31:36] mattwashere: has joined #ruby
[23:32:44] tds5016: has joined #ruby
[23:32:51] tds5016: hey. is anyone here using ruby relay?
[23:33:52] infernix: has joined #ruby
[23:37:04] johnmilton: has joined #ruby
[23:37:32] mdw: has joined #ruby
[23:39:50] rkoller: has joined #ruby
[23:40:19] jaguarmagenta: has joined #ruby
[23:41:26] snsei: has joined #ruby
[23:42:22] nickjj: has joined #ruby
[23:42:43] madgen: has joined #ruby
[23:42:54] aeterne: has joined #ruby
[23:45:33] johnny56: has joined #ruby
[23:46:24] ruby[bot]: Just ask your question, if anyone has, is or can, they will respond.
[23:47:25] rickmasta: has joined #ruby
[23:47:31] Rodya_: has joined #ruby
[23:48:06] Neo--: does everyone like gorails.com ? I was thinking of starting my own rails learning site
[23:48:23] bougyman: but I don't like rails, so don't listen to me
[23:48:29] Hobogrammer: has joined #ruby
[23:55:36] rickmasta: has joined #ruby