« Back to channel list

#ruby - 20 October 2018

« Back 1 day Forward 1 day »
[00:22:53] knight33: has joined #ruby
[00:29:20] marmotini: has joined #ruby
[00:30:38] RougeR: has joined #ruby
[00:38:19] kurko_: has joined #ruby
[00:38:58] kurko_: has joined #ruby
[00:39:57] kurko_: has joined #ruby
[00:40:40] kurko_: has joined #ruby
[00:41:29] kurko_: has joined #ruby
[00:42:27] kurko_: has joined #ruby
[00:43:13] kurko_: has joined #ruby
[00:43:49] dviola: has joined #ruby
[00:47:56] wojnar: has joined #ruby
[01:04:47] zwliew: has joined #ruby
[01:05:42] donofrio_: has joined #ruby
[01:16:29] orbyt_: has joined #ruby
[01:29:11] eckhardt: has joined #ruby
[01:32:21] patr0clus: has joined #ruby
[01:48:44] cagomez: has joined #ruby
[01:50:12] pskosinski: has joined #ruby
[01:52:52] joast: has joined #ruby
[01:53:11] Dimik: has joined #ruby
[01:57:07] dviola: has joined #ruby
[01:58:19] dinfuehr: has joined #ruby
[02:00:41] LightStalker: has joined #ruby
[02:10:53] cliluw: has joined #ruby
[02:17:29] Fusl: has joined #ruby
[02:21:40] arescorpio: has joined #ruby
[02:26:52] apparition: has joined #ruby
[02:29:53] JasonO: hello, I am trying to seed some data using rake. however, I receive the following error:
[02:30:06] JasonO: rake aborted!
[02:30:09] JasonO: NameError: uninitialized constant DeliveryPerson
[02:30:10] JasonO: db/seeds.rb:2:in `<top (required)>'
[02:30:40] JasonO: my models are accurate as well. any help would be appreciated
[02:40:35] fluxAeon: has joined #ruby
[02:42:09] patr0clus: has joined #ruby
[02:43:11] JasonO: anyone here?
[02:43:25] JasonO: I am trying to seed some data using rake. however, I receive the following error:
[02:43:28] JasonO: db/seeds.rb:2:in `<top (required)>'
[02:43:30] JasonO: my models are accurate as well. any help would be appreciated
[02:45:16] BTRE: has joined #ruby
[02:53:25] s3nd1v0g1us: has joined #ruby
[03:03:33] noobineer: has joined #ruby
[03:05:20] def_jam: has joined #ruby
[03:05:31] eb0t_: has joined #ruby
[03:06:24] za1b1tsu: has joined #ruby
[03:09:43] braincrash: has joined #ruby
[03:13:35] apparition: has joined #ruby
[03:16:29] nadir: has joined #ruby
[03:18:35] hahuang6-: has joined #ruby
[03:28:44] MoritaShinobu: has joined #ruby
[03:31:24] KeyJoo: has joined #ruby
[03:32:29] JasonO: figured it out
[03:52:38] qolq: has joined #ruby
[04:00:44] mangold: has joined #ruby
[04:11:42] eckhardt: has joined #ruby
[04:21:13] orbyt_: has joined #ruby
[04:40:25] xuanrui: has joined #ruby
[04:43:44] kurko_: has joined #ruby
[04:43:59] cagomez: has joined #ruby
[04:44:34] kurko_: has joined #ruby
[04:45:41] kurko_: has joined #ruby
[04:46:18] kurko_: has joined #ruby
[04:47:13] kurko_: has joined #ruby
[04:47:35] kurko_: has joined #ruby
[04:56:53] za1b1tsu: has joined #ruby
[05:00:17] _whitelogger: has joined #ruby
[05:15:54] johnny56: has joined #ruby
[05:39:19] reber: has joined #ruby
[05:39:36] petemoore: has joined #ruby
[05:42:20] leonthemisfit: has joined #ruby
[05:42:45] vdl: has joined #ruby
[05:51:21] segy: has joined #ruby
[05:57:15] eckhardt_: has joined #ruby
[05:58:04] jetchisel: has joined #ruby
[06:05:00] rippa: has joined #ruby
[06:05:00] kapil____: has joined #ruby
[06:05:33] venmx: has joined #ruby
[06:05:46] mangold: has joined #ruby
[06:06:22] dellavg_: has joined #ruby
[06:13:09] doubledup: has joined #ruby
[06:21:43] petemoore: has joined #ruby
[06:22:13] segy: has joined #ruby
[06:32:51] eckhardt_: has joined #ruby
[06:42:55] eckhardt_: has joined #ruby
[06:47:21] LiftLeft: has joined #ruby
[07:01:52] apparition: has joined #ruby
[07:10:47] tdy: has joined #ruby
[07:11:19] whysthatso: has joined #ruby
[07:12:35] chorler: has joined #ruby
[07:13:43] vondruch: has joined #ruby
[07:16:22] petemoore: has joined #ruby
[07:27:05] xuanrui: has joined #ruby
[07:56:24] sameerynho: has joined #ruby
[07:59:03] vondruch: has joined #ruby
[08:00:06] vondruch: has joined #ruby
[08:00:43] GodFather: has joined #ruby
[08:10:58] phaul: has joined #ruby
[08:12:31] doubledup: has joined #ruby
[08:23:13] venmx: has joined #ruby
[08:27:12] ellcs: has joined #ruby
[08:38:42] chorler: has left #ruby: ("Konversation terminated!")
[08:48:55] kurko_: has joined #ruby
[08:49:31] kurko_: has joined #ruby
[08:50:20] kurko_: has joined #ruby
[08:51:04] kurko_: has joined #ruby
[08:51:50] kurko_: has joined #ruby
[08:53:21] kurko_: has joined #ruby
[08:53:38] Nicmavr: has joined #ruby
[08:54:06] kurko_: has joined #ruby
[08:54:50] kurko_: has joined #ruby
[08:55:33] kurko_: has joined #ruby
[08:57:03] wojnar: has joined #ruby
[09:00:46] snickers: has joined #ruby
[09:05:19] RougeR: has joined #ruby
[09:54:16] rubydoc: has joined #ruby
[09:54:42] phaul: &ri http_default_port
[09:54:42] rubydoc: https://ruby-doc.org/stdlib-2.5.1/libdoc/net/http/rdoc/Net/HTTP.html#method-c-http_default_port
[09:55:50] phaul: Now everything is linked from core & stdlib.
[09:56:02] phaul: also everything is searchable
[09:56:16] phaul: &list %HTTP::%
[09:56:16] rubydoc: Net::HTTP::Copy (net/http), Net::HTTP::Delete (net/http), Net::HTTP::Get (net/http), Net::HTTP::Head (net/http), Net::HTTP::Lock (net/http), Net::HTTP::Mkcol...
[09:57:02] konsolebox: has joined #ruby
[10:00:57] lxsameer: has joined #ruby
[10:03:14] za1b1tsu: has joined #ruby
[10:12:33] mikecmpbll: has joined #ruby
[10:14:43] mangold: has joined #ruby
[10:21:06] Fusl: has joined #ruby
[10:22:03] venmx: has joined #ruby
[10:25:19] za1b1tsu: has joined #ruby
[10:29:26] ur5us: has joined #ruby
[10:48:14] apeiros_: has joined #ruby
[10:52:26] jetchisel: has joined #ruby
[10:56:27] desperek: has joined #ruby
[11:04:31] themsay: has joined #ruby
[11:26:00] JasonO: hello, I am creating am method to assign a random number to a value when iterating. however, I want to break out of the loop then resume to ensure all elements have different values. how can i do this?
[11:26:58] JasonO: break didn't help
[11:29:26] armyriad: has joined #ruby
[11:29:30] apeiros_: has joined #ruby
[11:30:35] evdubs_: has joined #ruby
[11:30:36] Hobbyboy: has joined #ruby
[11:31:09] apeiros_: JasonO: paraphrasing: you want to generate an array with N distinct random numbers?
[11:31:35] phaul: n.times.entries.shuffle
[11:32:42] snk: has joined #ruby
[11:32:45] apeiros_: `n.times.entries` can be shortened to `[*0...n]`
[11:33:23] apeiros_: and it assumes the pool of numbers is 0...N, but it might be unrelated to the size of the resulting array.
[11:33:47] apeiros_: (i.e. an array of 20 elements with random values 100..200)
[11:34:13] mangold: has joined #ruby
[11:35:48] JasonO: apeiros_ phaul something like this https://repl.it/repls/YouthfulGreenyellowCharactermapping nothing with arrays. I want to assign random ids to each user while iterating. but if I iterate at once all users will get the same random number. I need a way to break and continue so this does not happen
[11:36:29] apeiros_: eh, gotta go. boarding starts. cya :)
[11:38:53] xfbs: has joined #ruby
[11:38:58] phaul: so why don't you move random_post_office = ... into the loop.
[11:39:52] phaul: There is an other issue: I think you are iterating counter * counter times
[11:40:05] phaul: why do you need the double nested loops?
[11:41:23] JasonO: I removed some things. this is what I am working on now per your suggestion phaul https://repl.it/repls/YouthfulGreenyellowCharactermapping
[11:42:02] nadir: has joined #ruby
[11:43:04] phaul: don't put your local variables into the class scope. It's legal and valid, but it doesn't do what you think it does.
[11:44:56] phaul: The local var name inside the class does not propagate into the methods defined with def
[11:45:25] kapil____: has joined #ruby
[11:46:09] JasonO: okay I'll move them
[11:48:09] JasonO: no update
[11:48:43] phaul: post what you have so far
[11:48:44] JasonO: oops, forgot index
[11:49:03] JasonO: https://repl.it/repls/YouthfulGreenyellowCharactermapping
[11:49:38] JasonO: nice. it worked!
[11:49:43] JasonO: just needed the index
[11:49:47] JasonO: thanks phaul \
[11:49:52] phaul: &ri Array#rand
[11:49:53] rubydoc: Found no entry that matches class Array instance method rand
[11:49:53] JasonO: *thanks phaul
[11:50:08] phaul: &ri Array.sample
[11:50:08] rubydoc: Found no entry that matches class Array class method sample
[11:50:57] phaul: &ri Array#sample
[11:50:57] rubydoc: https://ruby-doc.org/core-2.5.1/Array.html#method-i-sample
[11:51:04] JasonO: aah. okay I'll use sample so no need for ikndex
[11:51:04] phaul: finally :)
[11:51:26] phaul: sad thing is that its my own bot :D
[11:53:30] tbuehlmann: has joined #ruby
[11:54:39] AJA4350: has joined #ruby
[11:56:33] Inline: has joined #ruby
[12:12:11] nowhere_man: has joined #ruby
[12:22:34] Puffball: has joined #ruby
[12:56:35] kurko_: has joined #ruby
[12:57:23] kurko_: has joined #ruby
[12:57:46] za1b1tsu: has joined #ruby
[12:58:16] kurko_: has joined #ruby
[12:58:42] kurko_: has joined #ruby
[12:59:42] kurko_: has joined #ruby
[13:00:32] kurko_: has joined #ruby
[13:01:16] kurko_: has joined #ruby
[13:04:11] marmotini_: has joined #ruby
[13:41:21] mikecmpbll: has joined #ruby
[13:44:15] Dbugger: has joined #ruby
[13:46:01] jetchisel: has joined #ruby
[13:47:57] Dimik: has joined #ruby
[13:52:12] DTZUZO: has joined #ruby
[14:00:29] jetchisel: has joined #ruby
[14:04:59] tAn: has joined #ruby
[14:09:07] discopatrick: has joined #ruby
[14:40:47] oleo2: has joined #ruby
[14:49:26] oleo2: has joined #ruby
[14:57:02] marmotini_: has joined #ruby
[15:01:29] phaul: has joined #ruby
[15:13:31] ule: has joined #ruby
[15:14:17] marmotini_: has joined #ruby
[15:41:03] houhoulis: has joined #ruby
[15:45:57] al2o3-cr: has joined #ruby
[15:46:35] sticaz: has joined #ruby
[15:54:34] marmotini_: has joined #ruby
[15:56:24] rivalomega: has joined #ruby
[16:09:13] dcope: has joined #ruby
[16:15:45] yxhuvud: has joined #ruby
[16:19:22] dcope: has left #ruby: ()
[16:20:24] Dbugger: has joined #ruby
[16:22:25] venmx: has joined #ruby
[16:58:21] akaiiro: has joined #ruby
[17:02:16] kurko_: has joined #ruby
[17:03:37] yxhuvud: has joined #ruby
[17:03:40] kurko_: has joined #ruby
[17:04:28] kurko_: has joined #ruby
[17:05:27] MoritaShinobu: has joined #ruby
[17:05:57] kurko_: has joined #ruby
[17:14:53] orbyt_: has joined #ruby
[17:22:44] akaiiro: has joined #ruby
[17:24:48] whysthatso_: has joined #ruby
[17:35:18] whysthatso: has joined #ruby
[17:35:33] bdnelson: has joined #ruby
[17:37:05] rkoller: has joined #ruby
[17:39:13] phaul: has joined #ruby
[17:43:18] armyriad: has joined #ruby
[17:45:29] uplime: has joined #ruby
[17:50:34] marmotini: has joined #ruby
[18:19:41] snickers: has joined #ruby
[18:25:59] rivalomega: has joined #ruby
[18:36:13] jackrandom: has joined #ruby
[18:41:11] yxhuvud: has joined #ruby
[18:46:38] rivalomega: has joined #ruby
[19:01:31] GodFather: has joined #ruby
[19:01:37] marmotini: has joined #ruby
[19:15:07] Dbugger: has joined #ruby
[19:20:39] RougeR: has joined #ruby
[19:23:08] patr0clus: has joined #ruby
[19:24:39] im0nde: has joined #ruby
[19:30:35] troulouliou_dev: has joined #ruby
[19:33:00] oleo2: has joined #ruby
[19:55:17] jiffe: has joined #ruby
[19:58:03] Fusl: has joined #ruby
[20:00:04] nowhere_man: has joined #ruby
[20:10:04] ua: has joined #ruby
[20:16:33] RougeR: has joined #ruby
[20:20:24] weaksauce: has joined #ruby
[20:24:01] cd: has joined #ruby
[20:25:50] tdy: has joined #ruby
[20:33:18] dinfuehr_: has joined #ruby
[20:36:15] apeiros_: has joined #ruby
[20:41:26] jiffe: so I am trying to get a ruby application [https://github.com/Mpompili/vibesky] going. I'm not familiar with ruby atm, but I was able to run through the setup which installed dependencies and created the necessary database. Running rails server I am able to get what looks like the api going, but I'm not sure how to get the frontend going which looks like it also runs through ruby
[20:42:50] jiffe: I can find the associated html, but I'm not sure what needs to be done to expose it, I don't know if anyone sees anything obvious that I'm missing
[20:47:12] c-c: has joined #ruby
[20:48:21] c-c: I have a mind-effing case-when problem, involving a string split into an array + call to a function from one when block.
[20:49:30] c-c: - For some reason I can p the arr[1] inside the when, but passing it as an argument to another method from inside the when statement causes an error --> proggy dies
[20:49:54] phaul: c-c: easiest way to describe it is to show us code
[20:52:25] phaul: topic these days suggests dpaste.de but gist.github is also fine. Channel bot will tell you off for pastebin. But honestly, whatever you are more familiar with
[20:52:32] c-c: - when making the paste, I noticed the method was declared outside the class
[20:52:38] bak1an: has joined #ruby
[20:53:04] phaul: https://en.wikipedia.org/wiki/Rubber_duck_debugging
[20:53:07] c-c: I usually use gist. Anyway, so found the problem: code blindness. Thank you
[21:02:42] s3nd1v0g1us: has joined #ruby
[21:04:34] jiffe: so I created a new rail, its listening on port 3000 and I see 'Yay! You’re on Rails!', trying to grep for that title in the created directory I don't see it anywhere, where does that come from?
[21:08:01] icarus: has joined #ruby
[21:09:51] jiffe: ah nm found it in a global template directory
[21:10:20] icarus: hello all, I have an endpoint that needs a post request (IE, curl --data '{"example":"data"}'), is anyone familiar with out to do this with httparty?
[21:11:31] icarus: with curl, this looks like: curl --data '{"example":"data"}' $url
[21:11:53] icarus: same for httparty via cli: httparty --data '{"example":"data"}' $url
[21:17:13] ur5us: has joined #ruby
[21:22:00] icarus: ah screw it, im just going to hard code `httparty --data '{"example":"data"}' $url`, yolo
[21:22:29] c-c: so "return if in_str == nil" errors, but "return if in_str==nil" doesn't?
[21:24:17] c-c: but "p in_str == nil" does not error?
[21:26:39] baweaver: c-c: what's the error?
[21:27:38] c-c: well the thing is I have the code running in a separate proc so I can't see the error (and thats why I'm confused)
[21:28:00] c-c: - All I see is the prog dying (it kills all procs if one fails)
[21:29:00] c-c: And, please note that my question 6 minutes before isn't correct, error was caused by something else
[21:36:20] fredlinhares: has joined #ruby
[21:36:46] phaul: "return if in_str == nil" is equivalent to "return if in_str==nil", https://gist.github.com/a02a1fd8a89858ea54c3426ecc1f5a68
[21:38:11] c-c: kewl, is that the tokenizer?
[21:38:42] c-c: onk parser
[21:39:19] phaul: you have access to the instruction sequence too :) https://www.nasseri.io/posts/1.html
[21:44:00] cagomez: has joined #ruby
[21:47:43] c-c: I have this endless nil testing when handling input from pipes https://gist.github.com/csmr/c114ae746f5ba531830ae553fe184544
[21:47:57] c-c: -even the read_line_nonblocking has to check for nil twice
[21:48:19] c-c: Any ideas how to avoid that in read_pipes (the method in the gist)
[21:48:40] phaul: well...maybe monad springs to mind :)
[21:50:23] phaul: there is &. inruby
[21:50:31] c-c: monads in ruby?
[21:50:58] phaul: I seen implementations.. but &. would be my first try
[21:51:18] orbyt_: has joined #ruby
[21:51:45] c-c: hm, I don't remember seeing "&.", how to use it?
[21:52:22] c-c: oh, its an operator
[21:52:41] phaul: https://github.com/tomstuart/monads
[21:54:16] baweaver: monads are overkill.
[21:54:24] c-c: hm, I think monads won't happen in my little game enginde
[21:54:38] phaul: we 3 are all agree
[21:55:15] baweaver: That's most of the reason I made Qo was to pipe input conditionally without breaking out of a flow
[21:55:43] phaul: rly? Can you show us a snippet?
[21:56:00] phaul: I never imagined Qo can do that
[21:56:02] kurko_: has joined #ruby
[21:56:07] baweaver: One sec, let me adapt to their code.
[21:59:11] c-c: So what I always get from read_line is nil, or a string key-value (separated by " "). So unless its a nil, it should be string, split by " ", and then case applied to [0].
[21:59:25] dviola: has joined #ruby
[21:59:56] phaul: read_line&.split(' ')
[22:01:20] baweaver: https://gist.github.com/csmr/c114ae746f5ba531830ae553fe184544
[22:01:47] baweaver: It's a bit silly with the debug pipe on it, but general idea is I use it to control dispatch much like a case statement
[22:02:01] baweaver: except with some more fine grained controls. It's be more useful if there were partial message matches or other factors.
[22:02:45] c-c: baweaver: whats 'Qo'?
[22:02:59] baweaver: Pattern matching and fluent querying in Ruby
[22:03:47] baweaver: people.select(&Qo[name: /^B/, age: 10..])
[22:04:04] baweaver: https://github.com/baweaver/qo
[22:05:31] phaul: baweaver: is the double m.when(Qo.not(nil)) intentional in the first block?
[22:05:47] baweaver: I suppose it's redundant
[22:06:14] phaul: I don't know :) I don't understand you code :)
[22:06:30] baweaver: that makes two of us
[22:07:49] icarus: has joined #ruby
[22:10:00] nadir: has joined #ruby
[22:15:51] c-c: I guess what I want to do is: if (msg=read_something_that_hopefully_isnt_nil).split(" ") { # do stuff with known non-nil array }
[22:16:10] c-c: Is that ugly? 8)
[22:16:21] c-c: suggest alternative syntax for this?
[22:16:47] phaul: read_something&.split(' ')&.yield_self { |obj| obj ... }
[22:17:21] phaul: it might be rough around the edges.. let me try if it works :)
[22:18:42] phaul: this worked 'alma korte'&.split(' ')&.yield_self { |alma, korte| p alma: alma, korte: korte }
[22:18:51] phaul: with nil it's just nil
[22:19:43] phaul: the former works too..
[22:20:01] phaul: but obj is the array of the pair..
[22:20:25] themsay: has joined #ruby
[22:21:32] c-c: >> def read_sim(arg=nil); return arg; end; read_sim("CMDstr FOOBAR")&.split(' ')&.yield_self {|o| p o} && read_sim()&.split(' ')&.yield_self {|o| p o }
[22:21:38] ruby[bot]: c-c: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[22:22:02] phaul: the site the bot is using is broken
[22:22:04] c-c: weird, my irb responds undefined method 'yield_self'
[22:22:17] phaul: ah. you are on old ruby
[22:22:27] baweaver: 2.5 intro'd it didn't it?
[22:22:56] c-c: ok, I'm on 2.3.3p222
[22:23:32] c-c: so much peeve
[22:24:01] c-c: - I have to test to for nil!
[22:29:13] phaul: you can suffix condition on the unhappy path... msg = read; return if msg.nil?; .... that way it's just 1 line and no end
[22:33:37] c-c: yeah have stuff like msg = rwe[0][0].gets.strip unless rwe == nil || rwe[0][0] == nil
[22:34:19] c-c: - which will fail if that returns nil
[22:35:48] phaul: https://gist.github.com/phaul/f25d512a88eb00ca5e02a078019fb2d3
[22:37:50] phaul: actually updated the gist . with &.tap it looks almost... good :)
[22:38:39] phaul: but I broke the funtion return value :( if you care about that
[22:39:20] phaul: I assume @msg_stack.push wasn't returning anything useful anyway
[22:42:51] phaul: surely not it was in an if with no else case...
[22:43:43] c-c: So, this works: msg = rwe[0][0] unless rwe == nil || rwe[0][0] == nil -- but rwe[0][0].gets.strip doesn't!
[22:43:58] c-c: its as if it ecals the strip before the unless
[22:44:56] phaul: c-c: have you seen my fork of your gist?
[22:45:01] phaul: what do you think?
[22:45:31] c-c: was struggling ther for 10 minutes with new syntax bugs
[22:46:17] c-c: aw, my ruby doesn't support &.
[22:46:49] phaul: that's a bummer :)
[22:48:25] c-c: ah well, I'll have to accept that
[22:49:05] phaul: my best is the revision before that then. still it shaves off a few lines
[22:51:52] c-c: let me revisit this nil syntax pet peeve with a more illustrative gist https://gist.github.com/csmr/177daf69dfaffed11306f9a5b6fa0cbf
[22:51:58] mangold: has joined #ruby
[22:52:19] c-c: Its like I have set nil or test for nil on every 2nd line all the time
[22:52:39] lupine: so don't?
[22:54:13] phaul: c-c: at least msg = nil lines are redundant
[22:54:52] phaul: I also posted a revision that should work on 2.3 before the &.tap revision..
[22:57:43] blackmesa: has joined #ruby
[22:58:44] c-c: interestingly &.split seems to work.. I think
[22:58:50] dviola: has joined #ruby
[23:05:51] phaul: c-c: if &.split works then every method works with &. even tap. What was the issue you had exactly?
[23:06:41] c-c: having to constantly ensure the wahtever is not nil
[23:07:05] phaul: no I mean with the code I posted on my gist
[23:07:13] phaul: you said you had syntax issues
[23:07:26] lupine: so don't return nil
[23:07:27] c-c: I still do
[23:07:50] phaul: can you post them?
[23:08:09] c-c: In fact this whole thing is "fragile" when I wanted it to just sit and run even if nothing is read
[23:08:11] lupine: aww, `undef nil` doesn't work :D
[23:10:39] rivalomega: has joined #ruby
[23:19:43] mikecmpbll: has joined #ruby
[23:20:08] pharma_joe: has joined #ruby
[23:23:15] raulp: has joined #ruby
[23:23:19] leah2: has joined #ruby
[23:25:06] phaul: ACTION sigh
[23:25:28] fredlinhares: has joined #ruby
[23:39:22] c-c: Ok finally managed to fix the regression
[23:40:23] c-c: I feel as if there maybe is whole another approach, but I keep ending in imperative land where I test if nil after/before IO: https://gist.github.com/csmr/177daf69dfaffed11306f9a5b6fa0cbf
[23:41:37] c-c: this seems bit exessive, given the input is always of format "VERB NOUN"
[23:42:53] c-c: - And I'm still not sure if read_line_nonblocking might return something funny when msg == nil
[23:45:07] phaul: as you seem to be completely ignoring my comments on this I am out..
[23:46:55] c-c: phaul thanks for input. I'm sorry but your comment on removing nils didnt seem to work, as "&."
[23:47:35] phaul: │235413 phaul | c-c: at least msg = nil lines are redundant
[23:47:59] c-c: yup, thats incorrect
[23:48:15] phaul: 000550 phaul | c-c: if &.split works then every method works with &. even tap. What was the issue you had │ bga57
[23:48:17] phaul: │ | exactly? y
[23:49:04] c-c: yeah, haven't managed to remove single nil yet
[23:50:04] c-c: I think this whole boat needs to be turned around
[23:50:26] phaul: I'm well aware. I posted something. You said it didn't work because &. Then you said &. works. Then I asked what was the error then
[23:51:11] c-c: well, stuff breaks if not watching out for nil explicitly in every turn
[23:52:09] phaul: my code was supposed to be functionally equivalent to yours. with all the ifs.
[23:52:23] mroutis: has joined #ruby
[23:52:36] phaul: I did not just post something where I just removed checks
[23:53:54] phaul: I can make an other attempt at rewriting your code. the newest gist. If you say it works at its current form.
[23:55:32] c-c: I think this whole thing is somehow wrong
[23:57:29] phaul: well. Null pattern. Maybe monad. &. . these are the tools. https://www.youtube.com/watch?v=J1jYlPtkrqQ
[23:57:33] c-c: The basic concept is a process reading input stream, store lines in msg_stack - unless none, then read the msg_stack to see what to do with state
[23:58:20] phaul: it's a relly great video, and he solves this exact problem.