« Back to channel list

#ruby - 09 February 2018

« Back 1 day Forward 1 day »
[00:00:09] n0m4d1c_: has joined #ruby
[00:01:30] n0m4d1c: has joined #ruby
[00:02:03] n0m4d1c: has joined #ruby
[00:02:26] rasterick_: newbie to Rake ... rakefile gives error instead of compiling prog after config ... any ideas please
[00:06:03] alfiemax: has joined #ruby
[00:06:12] aguestuser: has joined #ruby
[00:11:41] n0m4d1c_: has joined #ruby
[00:14:14] apeiros_: has joined #ruby
[00:14:37] miah: gist your rakefile as well as the error
[00:14:53] mtkd: has joined #ruby
[00:15:11] rasterick_: line 3: syntax error near unexpected token `'ALRM''
[00:15:32] Asher: has joined #ruby
[00:17:56] rasterick_: am using Ruby v2.5.0 .... should i use v2.4 instead maybe ?
[00:18:38] alfiemax: has joined #ruby
[00:20:00] Mia: has joined #ruby
[00:20:00] Mia: has joined #ruby
[00:22:49] jnyw: has joined #ruby
[00:23:53] zigzig: has joined #ruby
[00:24:45] white_lilies: has joined #ruby
[00:26:17] John_Ivan: has joined #ruby
[00:26:17] John_Ivan: has joined #ruby
[00:27:15] elphe: has joined #ruby
[00:28:18] vutral|kali: has joined #ruby
[00:28:19] vutral|kali: has joined #ruby
[00:29:24] miah: https://gist.github.com/
[00:29:31] miah: i cant help without details
[00:30:33] apeiros_: has joined #ruby
[00:30:38] maum: has joined #ruby
[00:31:17] chouhoulis: has joined #ruby
[00:31:18] rasterick_: i appreciate your help miah ... there are only 2 lines of errors ... so far , if i comment them out, i get more at line 7
[00:31:28] rasterick_: here are the 2 error lines :
[00:31:29] alfiemax: has joined #ruby
[00:31:41] rasterick_: line 3: syntax error near unexpected token `'ALRM''
[00:31:52] rasterick_: line 3: ` if Signal.list.key?('ALRM')'
[00:32:19] nowhere_man: has joined #ruby
[00:33:05] rasterick_: i get those errors when typing rakefile in the dir of the configured program .. what am i missing ?
[00:36:01] rasterick_: what other info would be helpful ?
[00:36:52] milardovich: has joined #ruby
[00:36:57] rasterick_: i have never used Ruby b4 ... i use GCC which produces a Makefile ... type 'make' and it compiles
[00:38:01] rasterick_: this program config produced a 'Rakefile' .. documentation says just type rake to compile
[00:38:12] rasterick_: i am lost .. thank you for your help
[00:38:31] leitz: has joined #ruby
[00:40:08] rasterick_: google has been unproductive also *sigh*
[00:45:27] cschneid: has joined #ruby
[00:45:41] rasterick_: is that the proper way to execute a rakefile ??? just type rakefile in the console ?
[00:47:33] sameerynho: has joined #ruby
[00:49:33] marmorkreb: has joined #ruby
[00:50:15] konsolebox: has joined #ruby
[00:50:43] leitz: I just type rake
[00:50:50] leitz: But I'm a newbie.
[00:50:52] safetypin: has joined #ruby
[00:52:06] apeiros_: has joined #ruby
[00:52:12] Papierkorb: has left #ruby: ("Konversation terminated!")
[00:53:29] rasterick_: yeah, it seemed simple to me also, but i am a newbie and it did not work, so i went here for help
[00:54:58] rasterick_: actually i thought it would be a laughable easy question
[00:55:19] rasterick_: for ppl that use Ruby
[00:56:10] hahuang65: has joined #ruby
[00:56:13] leitz: what is it you're trying to do?
[00:56:22] noobineer: has joined #ruby
[00:57:09] leitz: Here's my rakefile. It just runs the tests for me. https://github.com/makhidkarun/2d6_ogl_chargen/blob/master/rakefile
[00:57:19] aguestuser: has joined #ruby
[00:58:28] rasterick_: leitz, i am building a program, configure created a 'rakefile' instead of a 'makefile'
[00:59:00] rasterick_: so to compile i need to run the 'rakefile' .. docs say just type rake
[00:59:03] white_lilies: has joined #ruby
[00:59:27] rasterick_: but i get errors: line 3: syntax error near unexpected token `'ALRM'' line 3: ` if Signal.list.key?('ALRM')'
[00:59:56] rasterick_: i am lost as how to fix this
[01:00:42] leitz: How much ruby do you know?
[01:01:26] rasterick_: how much Ruby ? well, i installed it last night ... so very much a newbie
[01:02:00] rasterick_: google has been no help either *sigh* so i went here for help
[01:02:28] leitz: Ruby code isn't usually "compiled", more run. It is interepreted as it goes.
[01:03:38] leitz: So, if you write "my_code.rb" that is just "puts 'hello'" you run it with ruby my_code.rb
[01:03:48] rasterick_: all i am finding on google is how to write Ruby code ... your code looks nice btw
[01:04:11] leitz: Thanks! Don't look at it as the best way to code, but I enjoy it.
[01:04:36] rasterick_: as long as you enjoy, that is the main thing i think
[01:04:38] leitz: Are you trying to use rake to compile?
[01:05:12] leitz: Is your code on github or a gist?
[01:06:17] rasterick_: no, i took source code to build a program, configured it ... it produced a 'rakefile' to make the compiler (GCC) to compile the code
[01:07:25] rasterick_: i am using a released tarball, but the snapshot does the same ... it is designed to produce a rakefile
[01:07:48] leitz: Okay, I'm not sure I understand what that code is trying to do. Unless you're just using a rake file vice a makefile. Which is not something i'd understand.
[01:08:09] rasterick_: i have never used a rakefile b4 .. all my past compiles produce a 'Makefile' .. just type 'make' and it compiles the prog
[01:09:15] leitz: Have you tried "rake"
[01:09:42] leitz: And yeah, make files can be "fun", for various interpretations of the word...
[01:09:54] rasterick_: yes, i tried rakefile, rake, rake rakefile, rake --trace ... i am stumped
[01:10:12] leitz: Odd guess, try "ruby rakefile"
[01:10:21] leitz: Probably won't work, but you never knwo.
[01:10:28] leitz: Did the rake work at all?
[01:10:34] rasterick_: let me find the readme link for the program, it may help a bit
[01:10:54] rasterick_: rakefile gives me errors : line 3: syntax error near unexpected token `'ALRM'' line 3: ` if Signal.list.key?('ALRM')'
[01:10:59] leitz: Also, if you run "gem list" do you see "rake" in there?
[01:11:43] tomphp: has joined #ruby
[01:12:02] rasterick_: yes rake is in there
[01:12:17] rasterick_: is it ok to paste links in here ?
[01:12:41] leitz: Links here, yes.
[01:12:47] rasterick_: or should it be in a pvt window
[01:12:52] leitz: Some folks don't like pastebin, most use gist.
[01:13:08] rasterick_: ok, here is the prog readme : https://mkvtoolnix.download/doc/README.md
[01:13:15] leitz: Post it here. Just the linik. I accidently posted a few pages of code once...
[01:13:20] leitz: Only once.
[01:13:29] rasterick_: it is a simple txt page
[01:14:21] rasterick_: i think i have never used pastebin or gist ... i usually just email stuff or DCC
[01:14:26] sanscoeur: has joined #ruby
[01:16:16] leitz: No worries, that page was fine.
[01:16:56] tomphp: has joined #ruby
[01:17:07] leitz: Let's try gist. Go to gist.github.com and paste the rakefile into it. "Create a secret gist", and then cut and paste the really long URL here.
[01:18:44] alfiemax: has joined #ruby
[01:19:25] milardovich: has joined #ruby
[01:19:28] rasterick_: ok, lemme try
[01:19:45] rasterick_: are we able to send files directly here ?
[01:19:47] DTZUZO: has joined #ruby
[01:20:16] apeiros_: has joined #ruby
[01:20:21] rasterick_: you want the entire rakefile pasted there ?
[01:20:46] leitz: Posted in the gist, not here.
[01:20:55] leitz: Just post the gist URL here.
[01:21:01] rasterick_: ok, rakefile is 41kb
[01:21:04] leitz: Don't be a leitz. :)
[01:21:18] leitz: Or, just the first few dozen lines. :)
[01:22:14] rasterick_: add the file or paste ... i pasted entire file
[01:23:27] schneide_: has joined #ruby
[01:23:35] leitz: Paste is fine.
[01:23:59] rasterick_: ok, where do i get the url to send
[01:24:24] pocketprotector: has joined #ruby
[01:25:00] rasterick_: try this: https://gist.github.com/anonymous/6c54ed164a8f824e31c47a69c6944420
[01:25:19] cdg: has joined #ruby
[01:26:05] rasterick_: that github is really cool, i never used it b4
[01:28:48] leitz: Okay, maybe a "make clean" and restart the configure? Line 3-11 seem indented, like there's something before it missing.
[01:29:51] leitz: That, however, is just a wild guess. The "key?" is looking to see if there's an 'ALRM' in the list generated by Signal. So, what's generating the Signal?
[01:30:06] leitz: Or more to the point, why aren't the smart folks saying anything?
[01:30:12] white_lilies: has joined #ruby
[01:30:59] rasterick_: ohmy, that has been a problem, impossible to 'make clean' without a 'makefile' and only a 'Rakefile' but i can do this: reconfigure the program
[01:31:14] rasterick_: this will make a NEW 'Rakefile'
[01:31:28] rasterick_: gimme a few moments to do this
[01:33:01] rasterick_: you are very keen! i did mess with the first few lines of that code, was going to re.configure anyway
[01:33:36] mcr1: has joined #ruby
[01:35:02] rasterick_: done, here is the freshly created Rakefile: https://gist.github.com/anonymous/28030c5f0a862e81cace7e88b56f2f53
[01:35:09] leitz: Their git page says use make. https://github.com/Matroska-Org/libmatroska
[01:35:18] leitz: Unless I'm on the wrong thing.
[01:35:24] orbyt_: has joined #ruby
[01:36:28] rasterick_: well, that is why i did not mention the name of the prog ... it is rather comprehensive: libmatroska is one of about 8 libs that you must build BEFORE you configure
[01:36:37] mcr1: https://gist.github.com/mcr/a0e003af6d3e400a7553543c19da8b95 I think that URI should strip [] from IPv6 literals. Or is it Addrinfo's fault? Where/how to file bug?
[01:37:01] xcesariox: has joined #ruby
[01:37:09] rasterick_: that url was no good ???
[01:38:06] rasterick_: i am using Ruby v2.5.0 btw .. not sure if it matters
[01:38:41] leitz: This? https://bugs.ruby-lang.org/issues/3788
[01:39:40] rasterick_: but, yes you are correct ... ALL the libs use 'make' to compile them .. it is only the final prog build that uses a Rakefile
[01:40:20] rasterick: has joined #ruby
[01:40:37] bigblind: has joined #ruby
[01:40:40] rasterick: drat, clicked the link and closed the freenode
[01:41:11] leitz: Okay, so, you have a differnet issue.
[01:41:22] rasterick: well, it was not me that used the ipv6
[01:41:29] mcr1: leitz, thanks.....
[01:41:38] leitz: I don't have a great answer, but here's something to note.
[01:42:04] rasterick: i appreciate your time and help leitz
[01:42:45] leitz: CHeck this out. https://gist.github.com/LeamHall/a79d1f6e0715666f0b60ef7c7115df18
[01:43:00] leitz: Happy to help, BTW. I get a lot of help here myself.
[01:43:43] drewmcmillan: has joined #ruby
[01:43:53] rasterick: what does that snippet do ?
[01:44:28] mcr1: leitz, so hostname rather than host.
[01:45:06] leitz: It says that the syntax error isn't in your Signal.list.key? bit.
[01:45:22] dinfuehr: has joined #ruby
[01:45:47] rasterick: can you translate that to english for me please ?
[01:46:12] govg: has joined #ruby
[01:46:55] leitz: Sure. Your error was "syntax error". I ran the code straight in Ruby's interactive interpreter; irb. No syntax error. So my guess is that something else is trying to parse your rakefile and isn't Ruby.
[01:47:41] leitz: Make sense?
[01:48:06] leitz: If you're on Linux, try: which rake
[01:48:14] rasterick: yes, makes very much sense
[01:48:37] rasterick: well, get ready for a clear confusion ... here goes
[01:49:18] rasterick: i am on windows 7 64bit , running a 32bit linux bash shell, that compiles with GCC 7.2
[01:49:48] rasterick: and Ruby and rake are running INSIDE that bash console
[01:50:09] leitz: In theory. That error makes me think something else is off.
[01:50:27] rasterick: maybe that is the prob? should i be running ruby from a CMD prompt ? but then it could not access the GCC compiler
[01:50:44] rasterick: what do you think is off ?? ... listening
[01:51:46] govg: has joined #ruby
[01:52:22] rasterick: the only preprocessors that i know of that i have are g++ and bison
[01:52:54] leitz: If you run rake then it should be the ruby tool. In the directory with the rakefile you should be able to just run "rake".
[01:53:30] leitz: The 32 vs 64 bit version thing bothers me less than the syntax error. We've shown that the syntax is fine.
[01:54:18] rasterick: i think i installed the Ruby 64bit version
[01:55:15] rasterick: but that is a good experiment .. i will install Ruby in the same tree as the program and run rake from the '.root dir
[01:55:46] rasterick: if that does not work i will try the 32bit ver of Ruby
[01:56:10] leitz: Can you install ruby via the bash shell? I don't know windows, but the issue seems to be you're not acutally using ruby/rake.
[01:56:34] leitz: That, and it's about my nappy time so I'm making less sense as I go.
[01:56:55] rasterick: yep, the 64bit Ruby is what i installed
[01:57:34] rasterick: oh !! you were VERY helpful and knowledgeable about this leitz ! Thank You! so very much!
[01:58:09] rasterick: at lease i have some ideas how to approach this problem now .. thank you again
[01:58:11] drewmcmillan: has joined #ruby
[01:58:13] leitz: Wish I could have helped more. The test is just run "rake" in the directory with the rakefile.
[01:58:20] rasterick: and enjoy your nap ;)
[01:58:31] leitz: All 8 hours of it. Enjoy!
[01:58:52] xcesariox: has joined #ruby
[01:59:08] rasterick: 8pm here, im just getting started :> imma niteowl
[02:00:48] rasterick: lemme go try these experiments ... bbl
[02:01:24] white_lilies: has joined #ruby
[02:06:25] orbyt_: has joined #ruby
[02:10:04] xcesariox: has joined #ruby
[02:10:34] aguestuser: has joined #ruby
[02:11:13] alfiemax: has joined #ruby
[02:17:19] marmorkreb: has joined #ruby
[02:17:47] xcesariox: has joined #ruby
[02:19:02] mtkd: has joined #ruby
[02:19:44] Jameser: has joined #ruby
[02:20:42] MzrE: has joined #ruby
[02:22:54] herbmillerjr: has joined #ruby
[02:23:50] apeiros_: has joined #ruby
[02:28:59] osvico: has joined #ruby
[02:29:51] aguestuser: has joined #ruby
[02:35:12] apeiros_: has joined #ruby
[02:36:26] white_lilies: has joined #ruby
[02:39:27] orbyt_: has joined #ruby
[02:49:19] ramfjord: has joined #ruby
[02:51:58] sedawkvim: has joined #ruby
[02:52:05] vutral|kali: has joined #ruby
[02:52:06] vutral|kali: has joined #ruby
[02:52:29] cdg_: has joined #ruby
[02:58:18] safetypin: has joined #ruby
[03:00:16] cadillac_: has joined #ruby
[03:00:22] pastorinni: has joined #ruby
[03:01:25] apeiros_: has joined #ruby
[03:01:31] woodruffw: has joined #ruby
[03:01:31] woodruffw: has joined #ruby
[03:02:14] white_lilies: has joined #ruby
[03:02:54] kies: has joined #ruby
[03:04:55] xcesariox: has joined #ruby
[03:09:08] white_lilies: has joined #ruby
[03:12:18] davidcsi: has joined #ruby
[03:18:58] amirite: has joined #ruby
[03:20:21] aguestuser: has joined #ruby
[03:25:36] LastWhisper____: has joined #ruby
[03:29:22] safetypin: has joined #ruby
[03:29:37] suhdood: has joined #ruby
[03:31:22] govg: has joined #ruby
[03:31:38] elphe: has joined #ruby
[03:36:56] elphe: has joined #ruby
[03:43:12] white_lilies: has joined #ruby
[03:44:28] zigzig: has joined #ruby
[03:44:39] ledestin: has joined #ruby
[03:45:12] jnollette: has joined #ruby
[03:45:33] _aeris_: has joined #ruby
[03:47:15] cdg: has joined #ruby
[03:49:54] darkhanb: has joined #ruby
[03:50:27] alex``: has joined #ruby
[03:53:39] safetypin: has joined #ruby
[03:59:13] amirite: has joined #ruby
[03:59:41] zigzig: has joined #ruby
[04:00:30] apeiros_: has joined #ruby
[04:01:53] jnollette: has joined #ruby
[04:01:57] _aeris_: has joined #ruby
[04:02:02] rasterick: has joined #ruby
[04:09:57] cschneid: has joined #ruby
[04:11:28] apeiros_: has joined #ruby
[04:13:41] gix: has joined #ruby
[04:19:38] white_lilies: has joined #ruby
[04:19:40] aguestuser: has joined #ruby
[04:20:46] apeiros_: has joined #ruby
[04:22:56] ramfjord: has joined #ruby
[04:23:52] mtkd: has joined #ruby
[04:24:31] pastorin_: has joined #ruby
[04:25:14] trautwein: has joined #ruby
[04:30:56] apeiros_: has joined #ruby
[04:38:39] JoshS: has joined #ruby
[04:47:02] ozzloy: has joined #ruby
[04:47:02] ozzloy: has joined #ruby
[04:49:29] apeiros_: has joined #ruby
[04:52:52] white_lilies: has joined #ruby
[04:55:35] x77686d: has joined #ruby
[05:04:23] apeiros_: has joined #ruby
[05:09:05] xrlk: has joined #ruby
[05:11:55] xcesariox: has joined #ruby
[05:18:45] apeiros_: has joined #ruby
[05:23:56] pombreda: has joined #ruby
[05:31:41] white_lilies: has joined #ruby
[05:32:41] nowhereman_: has joined #ruby
[05:34:12] apeiros_: has joined #ruby
[05:45:30] d5sx43: has joined #ruby
[05:47:32] davidcsi: has joined #ruby
[05:55:51] halt: has joined #ruby
[05:57:50] apeiros_: has joined #ruby
[05:58:06] Slyda1: has joined #ruby
[06:00:02] x77686d: has joined #ruby
[06:00:17] danielpclark: has joined #ruby
[06:01:26] xuyuheng: has joined #ruby
[06:01:52] rasterick: well, i am learning about Ruby ... gem install drake worked
[06:02:27] rasterick: downgraded to ruby 2.3 with same results .. *sigh*
[06:03:02] white_lilies: has joined #ruby
[06:03:48] rasterick: drake will not run the rakefile either ... im lost
[06:03:54] rasterick: anyone have an idea ?
[06:20:26] apeiros_: has joined #ruby
[06:26:01] naprimer: has joined #ruby
[06:27:39] mtkd: has joined #ruby
[06:34:36] conta: has joined #ruby
[06:34:46] apeiros_: has joined #ruby
[06:39:12] marmorkr_: has joined #ruby
[06:40:01] white_lilies: has joined #ruby
[06:44:44] guardianx: has joined #ruby
[06:46:07] aufi: has joined #ruby
[06:48:35] Dimik: has joined #ruby
[06:53:11] za1b1tsu: has joined #ruby
[06:56:11] apeiros_: has joined #ruby
[06:58:44] white_lilies: has joined #ruby
[07:03:29] amatas: has joined #ruby
[07:06:41] Terens: has joined #ruby
[07:08:52] x77686d: has joined #ruby
[07:09:10] darkhanb: has joined #ruby
[07:10:06] cadillac_: has joined #ruby
[07:13:33] white_lilies: has joined #ruby
[07:13:48] jshjsh: has joined #ruby
[07:17:16] LocaMocha: has joined #ruby
[07:19:44] apeiros_: has joined #ruby
[07:20:46] LocaMocha: has joined #ruby
[07:22:15] zigzig: has joined #ruby
[07:24:21] dionysus69: has joined #ruby
[07:24:21] dminuoso: Without running this, what do you think this will do? f = proc{ return }; G = lambda{ f.(); puts "bla"}; def h; G.(); puts "woo"; end;
[07:24:31] dminuoso: Im so close to filing a bug report.
[07:24:44] dminuoso: This has got to be one of the weirdest inconsistencies around.
[07:25:31] dminuoso: And I meant what happens if you call :h
[07:27:31] harris: has joined #ruby
[07:28:01] apeiros_: dminuoso: I'd expect it to raise (return in the proc)
[07:28:35] dminuoso: apeiros: And why?
[07:28:46] apeiros: because return in a proc returns from the closure context
[07:29:04] apeiros: can I run it now? getting anxious over whether I'm having this correct :D
[07:29:22] dminuoso: apeiros: No you can not.
[07:29:27] apeiros: with lambda iirc the return would work
[07:29:37] dminuoso: def f proc{ return }; end; G = lambda{ f.(); puts "bla"}; def h; G.(); puts "woo"; end; h()
[07:29:58] apeiros: the proc{return} returns from closure context, so returns from f
[07:30:02] dminuoso: apeiros: It's surprising as heck that dont think it will properly return from the lambda.
[07:30:52] apeiros: so not entirely sure how that'd work. probably still a jumperror since f is gone at the point you run the proc?
[07:31:29] apeiros: oh wow, the first one doesn't raise
[07:31:34] apeiros: my world is shaking :D
[07:31:53] dminuoso: No both throw.
[07:31:55] dminuoso: >> f = proc{ return }; G = lambda{ f.(); puts "bla"}; def h; G.(); puts "woo"; end; h()
[07:31:56] ruby[bot]: dminuoso: # => unexpected return (LocalJumpError) ...check link for more (https://eval.in/952631)
[07:32:03] dminuoso: >> def f; proc{ return }; end; G = lambda{ f.(); puts "bla"}; def h; G.(); puts "woo"; end; h()
[07:32:04] apeiros: which ruby?
[07:32:05] ruby[bot]: dminuoso: # => unexpected return (LocalJumpError) ...check link for more (https://eval.in/952632)
[07:32:17] dminuoso: ruby[bot]: All of them
[07:32:21] Kero: has joined #ruby
[07:32:23] bauruine: has joined #ruby
[07:32:40] apeiros: I copy pasted your first one and get :h in both, 2.3.5 and 2.5
[07:32:44] apeiros: I'm confused now
[07:33:10] ahrs: has joined #ruby
[07:33:21] andikr: has joined #ruby
[07:33:46] dminuoso: apeiros: I forgot h() in the inital example.
[07:33:55] dminuoso: The :h is just from defining that method at the end.
[07:34:30] apeiros: mind you, I just got up. literally 5min ago :D
[07:34:59] dminuoso: That's fine, I got up 30 minutes ago
[07:35:10] alex``: has joined #ruby
[07:35:19] apeiros: my bootup process > 30min
[07:35:37] apeiros: and I haven't had coffee yet!
[07:35:58] apeiros: (though, I don't drink coffee, at all. that might have something to do with it…)
[07:41:29] Slyda1: has joined #ruby
[07:41:34] x77686d: has joined #ruby
[07:44:15] white_lilies: has joined #ruby
[07:47:52] guardianx: has joined #ruby
[07:49:00] clemens3: has joined #ruby
[07:49:22] guille-moe: has joined #ruby
[07:51:14] TomyLobo: has joined #ruby
[07:52:34] dminuoso: apeiros: I think return is so weird and hard to understand.
[07:52:51] apeiros: just use lambda instead of proc and be happy :-p
[07:53:20] dminuoso: apeiros: That's what Im doing already. However, core forces me to use blocks left and right which behave just as badly.
[07:53:29] dminuoso: apeiros: And I dont use my Q library everywhere yet.
[07:56:49] dminuoso: But.. that reminds me. One more thing to test.
[07:57:33] dminuoso: >> def f; lambda{ return }; end; G = lambda{ yield }; def h; G.(&f()); puts "woo"; end; h()
[07:57:34] ruby[bot]: dminuoso: # => no block given (yield) (LocalJumpError) ...check link for more (https://eval.in/952669)
[07:58:29] schneide_: has joined #ruby
[07:59:06] dminuoso: >> G = lambda{ yield }; def h; G.(&->{ return }); puts "woo"; end; h()
[07:59:07] ruby[bot]: dminuoso: # => no block given (yield) (LocalJumpError) ...check link for more (https://eval.in/952670)
[07:59:17] dminuoso: I guess yield only works in methods
[07:59:39] dminuoso: >> def f; lambda{ return }; end; def g; yield; end; def h; g(&f()); puts "woo"; end; h()
[07:59:40] ruby[bot]: dminuoso: # => woo ...check link for more (https://eval.in/952671)
[07:59:43] dminuoso: >> def f; proc{ return }; end; def g; yield; end; def h; g(&f()); puts "woo"; end; h()
[07:59:44] ruby[bot]: dminuoso: # => unexpected return (LocalJumpError) ...check link for more (https://eval.in/952672)
[08:00:01] ozzloy: has joined #ruby
[08:00:02] ozzloy: has joined #ruby
[08:00:10] dminuoso: >> def f; proc{ return }; end; def g(&blk); blk.call; end; def h; g(&f()); puts "woo"; end; h()
[08:00:11] ruby[bot]: dminuoso: # => unexpected return (LocalJumpError) ...check link for more (https://eval.in/952673)
[08:00:13] apeiros: yes, with proc/lambda &block syntax is required
[08:00:35] dminuoso: So I guess I could live if I used &lambdas
[08:00:39] apeiros: yield too works with the context. otherwise things like `def foo; @bar.each do |x| yield(x) end; end` would not work
[08:00:39] dminuoso: That seems to behave nicely.
[08:01:07] dminuoso: I want list comprehensions. :(
[08:01:32] dminuoso: apeiros: https://gist.github.com/andkerosine/3356675
[08:01:41] darkhanb: has joined #ruby
[08:01:58] apeiros: I'm not sure I should read that code
[08:02:09] dminuoso: That's one heck of a trick.
[08:02:10] dminuoso: You should.
[08:02:13] apeiros: I mean it starts with $stack, $draws
[08:02:14] dminuoso: Its freaking amazing.
[08:02:53] dminuoso: Somethings going on. What are +@ and -@ ?
[08:03:20] dminuoso: Ohh unary nevermind.
[08:03:29] arkinor: has joined #ruby
[08:04:31] x77686d: has joined #ruby
[08:06:34] orbyt_: has joined #ruby
[08:07:07] dminuoso: Especially this is cool: [i ** 2 / 3 | i <- [3,6..100], :even?]
[08:09:56] cschneid: has joined #ruby
[08:12:52] konsolebox: has joined #ruby
[08:13:35] za1b1tsu: has joined #ruby
[08:16:05] white_lilies: has joined #ruby
[08:19:18] _main_: has joined #ruby
[08:19:45] oetjenj: has joined #ruby
[08:20:06] konsolebox: has joined #ruby
[08:22:55] ramfjord: has joined #ruby
[08:23:14] apeiros: andkerosine… that nick sounds familiar
[08:24:01] phate408: has joined #ruby
[08:25:33] claudiuinberlin: has joined #ruby
[08:26:13] xuyuheng_: has joined #ruby
[08:27:48] traxnov: has joined #ruby
[08:28:16] romain_t: has joined #ruby
[08:29:08] vondruch: has joined #ruby
[08:30:50] schneide_: has joined #ruby
[08:31:03] reber: has joined #ruby
[08:32:48] mtkd: has joined #ruby
[08:34:32] guille-moe: has joined #ruby
[08:36:01] aupadhye: has joined #ruby
[08:42:57] Sylario: has joined #ruby
[08:43:46] x77686d: has joined #ruby
[08:45:55] agent_white: has joined #ruby
[08:48:34] tvw: has joined #ruby
[08:49:29] devil_tux: has joined #ruby
[08:53:12] KeyJoo: has joined #ruby
[08:53:57] Mike11: has joined #ruby
[08:54:39] white_lilies: has joined #ruby
[08:55:21] xuyuheng_: has joined #ruby
[08:58:58] zapata: has joined #ruby
[09:00:30] guille-moe: has joined #ruby
[09:03:09] bijan_: has joined #ruby
[09:04:38] mikecmpbll: has joined #ruby
[09:06:29] zigzig: has joined #ruby
[09:07:53] n13z: has joined #ruby
[09:08:59] skarlso: has joined #ruby
[09:09:06] bijan__: has joined #ruby
[09:09:29] yitsushi: has joined #ruby
[09:09:46] TomyWork: has joined #ruby
[09:17:29] x77686d: has joined #ruby
[09:19:01] bijan__: has joined #ruby
[09:20:18] m4rCsi: has joined #ruby
[09:21:37] conta1: has joined #ruby
[09:22:22] livcd: has joined #ruby
[09:22:33] ramfjord: has joined #ruby
[09:22:52] anisha: has joined #ruby
[09:28:27] _main_: has joined #ruby
[09:29:49] oetjenj: has joined #ruby
[09:32:35] white_lilies: has joined #ruby
[09:33:00] RougeR: has joined #ruby
[09:33:00] RougeR: has joined #ruby
[09:37:21] romain_t: has joined #ruby
[09:38:20] Terens: Suppose I have a class called Client. This class can be instantiated. Also It will create instances for some XYService classes. Now lets suppose I have a generic MessageHandler class.When a MessageHandler will process a message how can it find the instance of services in client?
[09:39:56] dminuoso: terens: Look into reactor pattern, like with em.
[09:41:54] Terens: I use EM but I dont get how it would help
[09:42:28] Terens: My problem is more like "dependecy injection"
[09:42:31] iron_houzi: has left #ruby: ("WeeChat 2.0.1")
[09:42:43] dminuoso: terens: No my point is: The pattern itself, not the gem.
[09:43:23] dminuoso: terens: You could simply maintain a registry in your dispatcher.
[09:45:04] dminuoso: terens: It's not exactly the dispatchers job to "be able and find all services", it's rather the consumers job to register any desired handlers.
[09:47:07] Terens: Yeah handlers is ok. But lets say I have a handler XYMessageHandler... So this handler should call XYService instance. My problem is how it is better to get this instance from Client class.
[09:48:21] guille-moe: has joined #ruby
[09:50:22] tomphp: has joined #ruby
[09:53:06] marr: has joined #ruby
[09:58:15] Serpent7776: has joined #ruby
[10:08:29] white_lilies: has joined #ruby
[10:09:18] jaruga: has joined #ruby
[10:13:05] Cavallari: has joined #ruby
[10:15:05] x77686d: has joined #ruby
[10:18:03] za1b1tsu: has joined #ruby
[10:26:30] Mia: has joined #ruby
[10:26:30] Mia: has joined #ruby
[10:28:25] r3dc0d3r: has joined #ruby
[10:29:49] ldnunes: has joined #ruby
[10:30:02] Junaos: has joined #ruby
[10:31:37] guille-moe: has joined #ruby
[10:37:26] mtkd: has joined #ruby
[10:38:35] ramfjord: has joined #ruby
[10:38:53] Junaos: has joined #ruby
[10:40:44] jaruga_: has joined #ruby
[10:40:44] heftig: has joined #ruby
[10:41:55] white_lilies: has joined #ruby
[10:47:45] cdg: has joined #ruby
[10:54:31] mikecmpbll: has joined #ruby
[10:54:36] AJA4350: has joined #ruby
[10:55:40] im0nde: has joined #ruby
[10:57:46] milardovich: has joined #ruby
[10:58:04] soahccc: I already thought that it might not work but is it "right" that constants defined in an instance_eval vanish into nothingness?
[11:01:19] white_lilies: has joined #ruby
[11:01:37] soahccc: ups, rather class_eval, `self::CONSTANT = value` works though smh
[11:08:15] jamesaxl: has joined #ruby
[11:11:55] dminuoso: soahccc: Can you give a concrete code example?
[11:12:03] white_lilies: has joined #ruby
[11:15:49] xfbs: has joined #ruby
[11:16:36] soahccc: dminuoso: I'm just playing with an idea so bear with me and this dirtyness :) https://gist.github.com/2called-chaos/2fd69601962e7e0866fd9fc49ccfb3af
[11:17:13] soahccc: dminuoso: I get that constants are lexically scoped but after the class eval the non-self:: constants are just gone, not in Module.constants anymore
[11:20:34] dminuoso: soahccc: Can you make a working testcase?
[11:20:52] dminuoso: There's some stray constant Tcomp in there. I'd like to understand what you are doing
[11:22:24] dminuoso: soahccc: Because my minimal testcase for "setting constants in class_eval" works just fine:https://eval.in/952858
[11:22:26] dminuoso: https://eval.in/952858
[11:23:22] dminuoso: https://eval.in/952859
[11:23:27] dminuoso: For a really minimal testcase.
[11:25:32] tomphp: has joined #ruby
[11:25:49] ferr1: has joined #ruby
[11:27:28] soahccc: dminuoso: hmm is it possible that pry is causing that?
[11:29:25] ferr1: has left #ruby: ()
[11:30:47] soahccc: I don't have this issue with a minimal example but what on earth could cause them to vanish here? It's one process, one thread, nothing fancy... https://gist.github.com/2called-chaos/c27eb8fc0b7e3fb179c978f286e81145
[11:32:15] dminuoso: soahccc: You are in different contexts.
[11:32:26] dminuoso: soahccc: Please check the current
[11:32:32] dminuoso: &ri Module#nesting
[11:32:32] `derpy: No results
[11:32:39] dminuoso: #ri nesting
[11:32:44] dminuoso: &ri nesting
[11:32:44] `derpy: http://ruby-doc.org/core-2.4.1/Module.html#method-c-nesting
[11:33:05] dminuoso: &ri Module.nesting
[11:33:05] `derpy: http://ruby-doc.org/core-2.4.1/Module.html#method-c-nesting
[11:33:13] Ishido: has joined #ruby
[11:33:24] eroux: has joined #ruby
[11:33:37] dminuoso: ACTION kicks `derpy
[11:33:56] dminuoso: soahccc: http://ruby-doc.org/core-2.5.0/Module.html#method-c-nesting
[11:34:18] dminuoso: soahccc: This is also hinted at by different `self` inspection in pry
[11:35:36] dminuoso: [1] pry(SMR::Plugin::MapchooserExtended)>
[11:35:36] dminuoso: [2] pry(SMR)>
[11:36:01] amatas_: has joined #ruby
[11:36:06] soahccc: yeah but Module.constants always shows a list of top level constants, no?
[11:36:15] dminuoso: soahccc: No.
[11:36:25] dminuoso: soahccc: It shows the constants available from the current nesting.
[11:36:40] dminuoso: Whereas Module.nesting shows the current nesting.
[11:37:59] soahccc: Alright, I mean I have to use self:: anyway I suppose but I was curious as to where those constants ended up since it wasn't on self context
[11:38:11] dminuoso: soahccc: constants are basically class instance variables if you want.
[11:38:44] soahccc: yeah but this lexical scope lookup thing is confusing sometimes
[11:41:41] dminuoso: There's no "top level constants" so to speak
[11:41:41] dminuoso: In truth ::Foo is just shorthand for ::Object::Foo
[11:42:54] desperek: has joined #ruby
[11:43:27] soahccc: yeah now that I think about it. But what I meant is that even though code get's eval'd somewhere, constant lookup is not relative to that context but where it was defined, e.g. the lookup scope is defined by where the code is written
[11:44:20] soahccc: and the quirk with constant lookup and "shorthand class/module notation" aka class Foo::Bar::Baz
[11:44:43] dminuoso: soahccc: I dont follow.
[11:44:44] white_lilies: has joined #ruby
[11:45:02] justinweiss: has joined #ruby
[11:45:37] dminuoso: soahccc: Do you mean const lookup when you explicitly name constants?
[11:46:13] avdi: has joined #ruby
[11:46:16] soahccc: dminuoso: if you define a nested class or module in one line with the double colons the lookup/nesting is different as if you write them in multiple lines without the colons, you know what I mean? :D
[11:46:32] dminuoso: soahccc: Yes.
[11:46:39] ruby[bot]: dminuoso: I don't know anything about nesting
[11:46:45] dminuoso: Mmm. We have a factoid for this.
[11:47:23] dminuoso: soahccc: const lookup is a non-intuitive
[11:48:17] dminuoso: soahccc: and its not about where the code is defined
[11:48:32] dminuoso: soahccc: nesting is essentially a stack that is modified according to ruby code
[11:48:49] dminuoso: it doesn't relate to what a class _is_, but its a context of the current execution
[11:49:10] dminuoso: asm>> class Foo; puts 1; end
[11:49:12] ruby[bot]: dminuoso: I have disassembled your code, the result is at https://eval.in/952911
[11:49:55] dminuoso: soahccc: defining a class causes :Foo to be pushed to nesting, leaving :Foo pops it.
[11:50:30] dminuoso: same goes with `class << foo` (there the singleton class gets pushed)
[11:50:38] dminuoso: soahccc: and for class_eval the receiver is pushed
[11:51:15] dminuoso: but only if you specify a string arugment
[11:51:16] thinkpad: has joined #ruby
[11:51:33] soahccc: I guess that's the gotcha with my evals :)
[11:52:03] apparition: has joined #ruby
[11:52:41] soahccc: Btw I'm trying to evaluate if I'm capable of writing a sortof transcompile from and with ruby... Guess I'm missing a grade for that
[11:53:18] dminuoso: soahccc: So basically instance/class_eval with blocks _dont_ push nesting.
[11:53:21] dminuoso: and thats what trips you up
[11:53:32] gr33n7007h: has joined #ruby
[11:53:57] soahccc: and what about `class Foo::Bar` vs `class Foo; class Bar` and nesting?
[11:54:00] dminuoso: soahccc: It might be easier to compile straight to YARV
[11:54:07] Jameser: has joined #ruby
[11:54:30] dminuoso: soahccc: Like I said: Each time a "class is opened" that class is pushed to nesting.
[11:54:30] apeiros: soahccc: they differ in how a constant is searched
[11:54:47] apeiros: Module.nesting can be used to inspect the "search path" for constants
[11:54:54] dminuoso: soahccc: the first pushes "Foo::Bar", the second pushes "Foo", and when it opens Bar it pushes "Bar"
[11:55:25] apeiros: be aware though that it, similarly to e.g. __LINE__, depends on the location it's being called
[11:56:14] dminuoso: Not exactly location
[11:56:23] soahccc: I see, i find that kindof annoying at times to be honest, so much indentation just for that
[11:56:29] dminuoso: more like it depends on how you end up in the line of code
[11:56:41] schaary: has joined #ruby
[11:56:54] adambeynon: has joined #ruby
[11:57:09] dminuoso: soahccc: Just fully qualify constant names.
[11:57:27] dminuoso: class Foo::Bar; puts ::Foo::M; end
[11:57:29] dminuoso: This is fine
[11:57:30] soahccc: dminuoso: and I was hoping to get away with a DSL but starting with keywords I'm kinda screwed already
[11:58:06] soahccc: yeah I know but do you really do that? fully address every class everytime?
[11:59:09] apeiros: dminuoso: if by "how you end up" you mean "callstack", then I disagree. Module.nesting depends on lexical locality.
[11:59:35] gr33n7007h: has joined #ruby
[11:59:58] dminuoso: apeiros: Let me prove this.
[12:00:33] bigblind: has joined #ruby
[12:00:49] John_Ivan: has joined #ruby
[12:00:49] John_Ivan: has joined #ruby
[12:01:06] ams__: has joined #ruby
[12:01:32] dminuoso: apeiros: https://eval.in/952935
[12:01:34] dminuoso: apeiros: It's a runtime thing.
[12:01:47] dminuoso: Not lexical.
[12:02:04] John_Ivan: has joined #ruby
[12:02:04] John_Ivan: has joined #ruby
[12:02:08] dminuoso: apeiros: Ruby has a stack machine hidden somewhere that manages soley the nesting.
[12:02:13] Jameser: has joined #ruby
[12:03:25] dminuoso: Same goes for `class << a` as a less exotic example
[12:05:04] apeiros: string interpolation seems to be handled differently. interesting. I did not expect that to result in [A]
[12:05:23] apeiros: compare with: `A.class_eval do p Module.nesting end`
[12:05:23] pizzaops: has joined #ruby
[12:05:29] dminuoso: apeiros: indeed.
[12:05:50] dminuoso: apeiros: yield_under is very different from eval_under
[12:06:58] apeiros: haven't played with yield_under/eval_under yet
[12:07:18] dminuoso: apeiros: They are the underyling implementations for eval'ing blocks/strings
[12:07:41] apeiros: thought it was a ruby 2.5 thing
[12:08:22] apeiros: string eval is actually the first thing I see manipulating nesting. none of the block form evals do afaik.
[12:08:27] thinkpad: has joined #ruby
[12:08:41] dminuoso: apeiros: But I kind of love that "class_eval" kind of runs inside the class context. But only kind of. Keeps you awake.
[12:09:06] apeiros: I still want an universal eval, where you can set all the scopes ruby has.
[12:10:09] dminuoso: apeiros: May be simplest to show how nesting is determined: https://github.com/ruby/ruby/blob/trunk/eval.c#L329-L344
[12:10:19] dminuoso: those crefs are a runtime thing
[12:12:11] Psybur: has joined #ruby
[12:12:11] Psybur: has joined #ruby
[12:14:17] Strepsils: has joined #ruby
[12:14:39] Psybur_: has joined #ruby
[12:14:40] dminuoso: apeiros: And from browsing through the source code, it might be possible to have weird interaction when dealing with iseq streams too.
[12:18:38] white_lilies: has joined #ruby
[12:19:20] dminuoso: https://eval.in/952962
[12:19:21] dminuoso: More fun stuff
[12:20:26] oetjenj: has joined #ruby
[12:21:02] dminuoso: Likewise lexical scope couldn't explain this, apeiros: https://eval.in/952964
[12:24:17] drewmcmillan: has joined #ruby
[12:24:35] apeiros: dminuoso: why not?
[12:25:10] apeiros: nesting is precisely [a.singleton_class], which is where you lexically are at
[12:25:31] zautomata: has joined #ruby
[12:25:34] zautomata: has joined #ruby
[12:26:05] goatish: has joined #ruby
[12:26:07] dminuoso: apeiros: `a` being some dynamic value
[12:26:09] dminuoso: this is kind of the definition of dynamic scope
[12:26:37] dminuoso: `a` could even be any valid ruby expression
[12:26:38] apeiros: ok, I guess we have a terminology issue here.
[12:28:01] dminuoso: lexical scope means if you can resolve bindings or whatever based on lexical context, i.e. it can happen during compilation
[12:28:35] dminuoso: kind of how variables are lexically resolved in ruby
[12:28:37] apeiros: point is: you can't create a nesting (other than string eval, which makes some sense since that's the same, or at least immitating, how literal code is interpreted)
[12:29:08] apeiros: the way your code is written matters, not how you invoke it. it's not the callstack which matters.
[12:29:18] dminuoso: yes you can.
[12:29:18] apeiros: I don't have any better terms to explain what I mean
[12:29:32] apeiros: other than string eval?
[12:29:41] dminuoso: class << a; class << b; class << c; /* execute code with your arbitrary fun nesting */ end; end; end;
[12:29:59] dminuoso: Albeit, whether this is sensible is a different question entirely
[12:30:33] apeiros: yes, you're using syntax there. not callstack.
[12:30:50] dminuoso: asm>> class << a; end
[12:30:51] ruby[bot]: dminuoso: I have disassembled your code, the result is at https://eval.in/952971
[12:31:10] dminuoso: apeiros: `class` is not just syntax, it compiles into `defineclass`, which is callstack.
[12:31:36] apeiros: which is *not reachable from ruby*
[12:31:55] dminuoso: apeiros: I suppose you could just gen yarv ops? :P
[12:32:07] dminuoso: We can load arbitrary ISeqs nowadays
[12:32:31] dminuoso: apeiros: But I get your point
[12:32:35] apeiros: I give up :-p
[12:33:32] lipoqil: has joined #ruby
[12:35:18] guille-moe: has joined #ruby
[12:37:01] dminuoso: apeiros: https://eval.in/952979
[12:37:05] dminuoso: This should be a pattern.
[12:39:12] cdg: has joined #ruby
[12:41:31] deimos: has joined #ruby
[12:42:37] mtkd: has joined #ruby
[12:42:56] moei: has joined #ruby
[12:44:58] charles81_: has joined #ruby
[12:45:26] manveru: has joined #ruby
[12:45:31] bcavileer: has joined #ruby
[12:48:05] tomeaton17: has left #ruby: ("WeeChat 2.0.1")
[12:49:31] rfv: has joined #ruby
[12:49:32] white_lilies: has joined #ruby
[12:49:39] RougeR: has joined #ruby
[12:49:39] RougeR: has joined #ruby
[12:51:32] skmp: has joined #ruby
[12:54:26] cstrahan: has joined #ruby
[12:54:45] ziadoz: has joined #ruby
[12:55:07] drewmcmillan: has joined #ruby
[12:58:11] ewilliam: has joined #ruby
[12:58:46] bijan__: has joined #ruby
[13:00:26] BuildTheRobots: has joined #ruby
[13:01:35] pfg: has joined #ruby
[13:04:33] Psybur_: has joined #ruby
[13:05:33] nowhereman_: has joined #ruby
[13:08:27] jcalla: has joined #ruby
[13:08:40] TvL: has joined #ruby
[13:09:30] yohji: has joined #ruby
[13:09:58] synthroid: has joined #ruby
[13:11:41] Psybur: has joined #ruby
[13:13:51] stormpack: has joined #ruby
[13:18:46] tcopeland: has joined #ruby
[13:21:19] Yonk: has joined #ruby
[13:21:31] Xentil: has joined #ruby
[13:22:15] white_lilies: has joined #ruby
[13:27:53] drewmcmillan: has joined #ruby
[13:31:26] shinnya: has joined #ruby
[13:32:22] codepete: has joined #ruby
[13:32:33] jeffreylevesque: has joined #ruby
[13:35:12] bosma: has joined #ruby
[13:36:59] danzilio: has joined #ruby
[13:38:59] stormpack_: has joined #ruby
[13:39:39] Travis-42: has joined #ruby
[13:40:18] ltt: has joined #ruby
[13:41:29] tao_: has joined #ruby
[13:42:02] Jameser`: has joined #ruby
[13:44:51] rrutkowski: has joined #ruby
[13:45:36] jimeh: has joined #ruby
[13:48:13] rrutkowski: has joined #ruby
[13:50:59] cdg: has joined #ruby
[13:52:25] oleo: has joined #ruby
[13:54:39] jottr: has joined #ruby
[13:55:36] govg: has joined #ruby
[13:56:45] c0mrad3: has joined #ruby
[13:56:55] conta: has joined #ruby
[13:57:48] haylon: has joined #ruby
[13:58:54] konsolebox: has joined #ruby
[14:00:34] white_lilies: has joined #ruby
[14:01:08] jcalla: has joined #ruby
[14:01:23] bigblind: has joined #ruby
[14:02:22] amirite: has joined #ruby
[14:03:49] giraffe: has joined #ruby
[14:04:37] tpendragon: has joined #ruby
[14:05:16] ferox: has joined #ruby
[14:06:12] cdg: has joined #ruby
[14:06:57] rwb: has joined #ruby
[14:08:22] Jameser: has joined #ruby
[14:10:30] xuyuheng_: has joined #ruby
[14:15:12] kke: is there some thread safe shared hash-like thing that can be used with eventmachine?
[14:16:20] dminuoso: kke: check out concurrent-ruby
[14:16:42] dionysus69: has joined #ruby
[14:24:20] iloveitaly: has joined #ruby
[14:25:28] kke: hmm, right, so i can use Concurrent::Hash without using the rest of the concurrent-ruby package
[14:26:08] DLSteve_: has joined #ruby
[14:26:51] n0m4d1c: has joined #ruby
[14:27:10] gnufied: has joined #ruby
[14:29:38] oetjenj: has joined #ruby
[14:30:48] ptr4ce: has joined #ruby
[14:32:24] white_lilies: has joined #ruby
[14:36:20] ferox_hacker: has joined #ruby
[14:38:14] dminuoso: kke: You can simply just require 'concurrent/hash'
[14:38:52] ramfjord: has joined #ruby
[14:40:39] marmorkreb: has joined #ruby
[14:41:01] griffindy: has joined #ruby
[14:41:47] amatas_: has joined #ruby
[14:45:06] white_lilies: has joined #ruby
[14:46:06] guille-moe1: has joined #ruby
[14:47:20] ltt: has joined #ruby
[14:47:21] mtkd: has joined #ruby
[14:47:52] JJonah: has joined #ruby
[14:48:44] Papierkorb: has joined #ruby
[14:51:59] Diabolik_: has joined #ruby
[14:52:45] Rapture: has joined #ruby
[14:53:09] banisterfiend: has joined #ruby
[14:56:50] Jameser: has joined #ruby
[14:57:38] workmad3: has joined #ruby
[14:59:45] LastWhisper____: has joined #ruby
[15:00:16] raggi: has joined #ruby
[15:01:16] schneide_: Hey guys, how can I check if I'm inside a ruby project and get the main project path
[15:01:46] Papierkorb: has left #ruby: ("Konversation terminated!")
[15:01:49] schneide_: I'm thinking into searching for Gemfile backwards in every directory
[15:02:14] schneide_: and if found one to return the patch where it's found
[15:02:37] schneide_: but I'm new to ruby and don't know how to implement that
[15:04:18] apeiros: what defines whether you're inside "a ruby project"?
[15:04:49] apeiros: and what is "I"? the currently evaluated file? the working directory? something else?
[15:05:45] bijan__: has joined #ruby
[15:06:29] schneide_: well as I said, the presence of Gemfile, if found in parents directories then return that one path
[15:07:19] apeiros: ok. and the second part? parent directory of what?
[15:07:24] apeiros: working directory?
[15:07:48] schneide_: for example if I'm running the script from /home/me/project/ruby/lib/scripts/ and Gemfile lives in /home/me/project/ruby/Gemfile then the function should return /home/me/project/ruby
[15:08:11] brendan-: has joined #ruby
[15:08:21] micalexander: has joined #ruby
[15:08:49] schneide_: it should recursively check every directory: /home/me/project/ruby/lib/scripts/, /home/me/project/ruby/lib/, /home/me/project/ruby/, /home/me/project/, /home/me/, /home/, / and raise something if no Gemfile found
[15:09:14] apeiros: I'll repeat: every directory *relative to what*?
[15:09:31] r3my: has joined #ruby
[15:09:36] schneide_: to the $(pwd)
[15:09:38] apeiros: you can run /home/me/project/ruby/lib/scripts/foo from /
[15:10:20] apeiros: Dir.getwd + File.dirname will help you. Pathname might have useful methods too.
[15:10:29] bigblind: has joined #ruby
[15:10:32] ecuanaso: has joined #ruby
[15:11:40] schneide_: is there a better terminal for ruby than irb?
[15:12:07] schneide_: I use IPython when working with python and it's powerful
[15:12:15] schneide_: is there something similar for ruby?
[15:12:42] apeiros: I don't know ipython. but pry is generally regarded as the better irb
[15:12:54] ruby[bot]: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[15:12:59] dminuoso: See. It's better.
[15:13:28] schneide_: oh, thank you
[15:13:40] schneide_: I had it installed already :D
[15:16:35] mikecmpbll: i know style guides are just guides blah blah blah, but when i come across something that is discouraged, it makes me wonder if there's a better way to do it. i have a case statement with an empty `when` clause, e.g. https://gist.github.com/mikecmpbll/ca1a60c6621a2b7ef9b8b32a4bd3cc89
[15:16:52] mikecmpbll: however, with the else clause the empty when clause becomes important.
[15:17:32] mikecmpbll: one of the causes in my when is genuinely a 'no-op' case..
[15:18:42] ltt: has joined #ruby
[15:18:42] apeiros: mikecmpbll: there's IMO value in exhaustive listing of options. I really like how rust even enforces this.
[15:19:00] apeiros: so noop when is IMO not just fine, but even good
[15:19:00] mikecmpbll: i think i agree.
[15:19:10] ferox_hacker: has joined #ruby
[15:19:15] dminuoso: mikecmpbll: I would argue it to be required.
[15:19:30] mikecmpbll: :O ok i'll turn that cop off.
[15:19:36] apeiros: as for alternatives: in case of only 3 options like in your example, if/elsif
[15:19:45] dminuoso: mikecmpbll: Personally I view it from a totality point of view.
[15:19:50] dminuoso: mikecmpbll: Code needs to be clear that its total.
[15:19:58] dminuoso: Hiding empty when clauses hides bugs.
[15:20:18] apeiros: i.e. if x == "foo" elsif x != "bar"; end
[15:20:33] dminuoso: mikecmpbll: Good languages require either mathematical proof of totality, or at least produce a runtime crash if all patterns are exhausted.
[15:20:46] dminuoso: apeiros: What does Rust do?
[15:20:51] apeiros: but that's not exhaustive, and as a reader of such code I always wonder "is there intentionally no else, or is that a bug?"
[15:21:10] safetypin: has joined #ruby
[15:21:20] dminuoso: mikecmpbll: For consistency I would do something like `when foo then nil` though
[15:21:35] apeiros: dminuoso: referring to its match operator. https://doc.rust-lang.org/book/second-edition/ch06-02-match.html
[15:21:39] schneide_: has joined #ruby
[15:22:10] apeiros: mikecmpbll: I go as far as having a Kernel#unreachable in my code and doing `case …; else unreachable; end`
[15:22:14] bijan_: has joined #ruby
[15:22:33] dminuoso: Kernel#unreachable?
[15:22:34] apeiros: noops I just leave a comment, as in your example: `when "foo"; # noop`
[15:22:39] dminuoso: &ri Kernel#unreachable
[15:22:39] `derpy: No results
[15:22:40] soahccc: I have this mostly in iterations and I then to `when x then next`
[15:22:45] dminuoso: You sir monkey patch Kernel?
[15:22:48] dminuoso: ACTION slaps apeiros
[15:23:46] phate408: has joined #ruby
[15:24:13] dminuoso: apeiros: Yeah things become saner if you think of case/pattern matching as a kind of `mapping` rather than a big `if/elseif construct. Rust seems to enforce this nicely.
[15:25:00] dminuoso: apeiros: Curious how good pattern matching works in Rust.
[15:25:08] Psybur: has joined #ruby
[15:25:09] Psybur: has joined #ruby
[15:25:13] apeiros: dminuoso: so far pretty well. but I'm a very early beginner still.
[15:26:24] dminuoso: apeiros: If Rust had HKTs, I'd rewrite my kernel in Rust immediately.
[15:26:40] apeiros: your kernel?
[15:26:43] apeiros: and what's HKT?
[15:26:46] dminuoso: higher kinded types
[15:26:58] woodruffw: has joined #ruby
[15:26:59] woodruffw: has joined #ruby
[15:26:59] dminuoso: Yeah, the C++ kernel I wrote over a year ago
[15:27:13] apeiros: we're sooo far OT I can't even tell :D
[15:29:37] johnny56_: has joined #ruby
[15:34:04] krawchyk: has joined #ruby
[15:35:07] kapil___: has joined #ruby
[15:38:31] bijan_: has joined #ruby
[15:40:06] bijan_: has joined #ruby
[15:40:35] jsaak: schneide_: chruby does exactly what you are looking for: https://github.com/postmodern/chruby
[15:42:43] za1b1tsu: has joined #ruby
[15:43:09] schneide_: jsaak: why? https://pastebin.com/4c8X8BZS
[15:43:11] ruby[bot]: schneide_: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/09cba33d02b84bb801aea514169c0c2d
[15:43:12] ruby[bot]: schneide_: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[15:47:57] jsaak: schneide_: that is fine, chruby does the same with the file .ruby-version in https://github.com/postmodern/chruby/blob/master/share/chruby/auto.sh
[15:48:51] CrazyEddy: has joined #ruby
[15:49:52] marmorkreb: has joined #ruby
[15:51:32] damonf: has joined #ruby
[15:52:24] alfiemax: has joined #ruby
[15:53:52] bijan_: has joined #ruby
[15:57:37] alfiemax: has joined #ruby
[16:01:04] cschneid: has joined #ruby
[16:01:06] zleap: has joined #ruby
[16:01:13] white_lilies: has joined #ruby
[16:03:34] alfiemax: has joined #ruby
[16:05:00] troys: has joined #ruby
[16:07:12] rippa: has joined #ruby
[16:08:07] schneide_: has joined #ruby
[16:08:40] Kero: has left #ruby: ("quit")
[16:09:09] poutyredlips: has joined #ruby
[16:10:31] white_lilies: has joined #ruby
[16:10:40] so_so_fresh: has joined #ruby
[16:11:06] nicosmaris: has joined #ruby
[16:14:41] alfiemax: has joined #ruby
[16:16:44] alfiemax: has joined #ruby
[16:24:24] poutyredlips: has joined #ruby
[16:30:58] ltt: has joined #ruby
[16:34:11] so_so_fresh: has joined #ruby
[16:38:04] jordanm: has joined #ruby
[16:39:29] bigblind: has joined #ruby
[16:42:07] white_lilies: has joined #ruby
[16:46:23] synthroid: has joined #ruby
[16:46:49] [Butch]: has joined #ruby
[16:47:59] npgm: has joined #ruby
[16:49:11] oetjenj: has joined #ruby
[16:49:24] schneide_: has joined #ruby
[16:51:25] pastorinni: has joined #ruby
[16:52:12] mtkd: has joined #ruby
[16:57:18] ledestin: has joined #ruby
[17:00:40] naquad: has joined #ruby
[17:01:18] orbyt_: has joined #ruby
[17:02:22] alfiemax: has joined #ruby
[17:04:14] alfiemax: has joined #ruby
[17:07:27] cagomez: has joined #ruby
[17:08:26] d10n-work: has joined #ruby
[17:08:41] TomyLobo: has joined #ruby
[17:08:47] zleap: has joined #ruby
[17:13:00] white_lilies: has joined #ruby
[17:14:39] t0m: has joined #ruby
[17:16:11] za1b1tsu: has joined #ruby
[17:22:30] guacamole: has joined #ruby
[17:22:30] guacamole: has joined #ruby
[17:24:31] yohji: has joined #ruby
[17:28:08] zleap: i am working through codecademy ruby course if I use
[17:28:09] zleap: my_array.each { |num| puts num unless num % 2 !=0 }
[17:29:02] zleap: so an array of 1,2,3,4 up to 10, I then use the above expression to pick out even numbers is the !=0 equal to zero on the remainder or not = to zero
[17:29:12] ldnunes: has joined #ruby
[17:29:40] marmorkreb: has joined #ruby
[17:29:50] jottr: has joined #ruby
[17:30:46] apeiros: zleap: `unless` = `if not`, and `!= 0` means `is not equal to zero`
[17:31:34] darkhanb: has joined #ruby
[17:32:12] jobewan: has joined #ruby
[17:32:19] zleap: so modulus is about the remainder in a division
[17:32:38] zleap: so in this case if the remainder is not zero then print the numbers
[17:32:44] zleap: 2,4,6,8,10
[17:32:59] apeiros: you have double negation there
[17:33:09] apeiros: if the remainder is not not equal to zero
[17:33:19] zleap: the code is
[17:33:22] zleap: my_array.each { |num| puts num unless num % 2 !=0 }
[17:33:30] apeiros: and yes, that's stupid, use `if num % 2 == 0` instead. much more readable.
[17:33:43] x77686d: has joined #ruby
[17:33:59] zleap: my_array.each { |num| puts num unless num % 2 ==0 }
[17:33:59] apeiros: because "reminder is not not equal" is "remainder is equal"
[17:34:06] zleap: prints odd numbers
[17:34:14] zleap: 1,3,5,7,9
[17:34:28] apeiros: also newer rubies have .even? and .odd?
[17:34:36] apeiros: so `puts num if num.even?`
[17:35:16] zleap: so what the origianl code said was if there is no remainder print the number
[17:35:21] zleap: just in a way that was confusing
[17:35:27] white_lilies: has joined #ruby
[17:35:37] zleap: thanks for that, i'll be back shortly
[17:35:50] apeiros: mathematicians wouldn't like that phrasing ;-o
[17:36:02] apeiros: (zero is not nothing)
[17:36:30] apeiros: but yes, that's what the original code said.
[17:36:50] zleap: back shortly, i'll get the hang of this stuff soon
[17:37:18] zleap: so if using .odd i can have if num.odd print num
[17:37:28] apeiros: not `odd`, `odd?`
[17:37:56] soahccc: Anyone ever used net-scp? Is it any faster than net-sftp?
[17:37:58] apeiros: and yes, you can use that in the condition instead of % 2 == 0
[17:39:56] gr33n7007h: has joined #ruby
[17:46:28] n0m4d1c: has joined #ruby
[17:48:09] Slyda1: has joined #ruby
[17:51:31] zleap: has joined #ruby
[17:51:31] zleap: has joined #ruby
[17:51:41] sanscoeur: has joined #ruby
[17:52:00] soahccc: Meh, net-scp is indeed way faster but still CPU bound... any idea on how to find out where the bottleneck is? I assume somewhere in net-ssh
[17:52:14] jrafanie: has joined #ruby
[17:52:38] soahccc: Or an alternative plan for fast and secure data transfer? Already thought about exposing the files via https, don't really want to shell out in the script
[17:53:31] sanscoeur: has joined #ruby
[17:53:44] oo_func: has joined #ruby
[17:55:21] za1b1tsu: Hello, anybody using mongodb ruby driver? Do you need to do batch size it wont load all the data at once?
[17:56:44] Terens: has joined #ruby
[17:59:54] alfiemax: has joined #ruby
[18:00:58] ldnunes: has joined #ruby
[18:01:31] schneide_: has joined #ruby
[18:02:24] ptr4ce: has joined #ruby
[18:04:04] nowhereman_: has joined #ruby
[18:05:07] danguita: has joined #ruby
[18:09:34] alfiemax: has joined #ruby
[18:13:03] schneide_: has joined #ruby
[18:13:14] chouhoulis: has joined #ruby
[18:13:21] dminuoso: 18:35 apeiros | mathematicians wouldn't like that phrasing ;-o
[18:13:32] dminuoso: Id say given the context, these two statements are extensionally equivalent.
[18:13:39] Guest2: has joined #ruby
[18:14:55] dminuoso: >> 1.step.lazy.select(&:odd?).take(10)
[18:14:56] ruby[bot]: dminuoso: # => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:select>:take(10)> ...check link for more (https://eval.in/953260)
[18:15:00] dminuoso: >> 1.step.lazy.select(&:odd?).take(10).to_a
[18:15:01] ruby[bot]: dminuoso: # => [1, 3, 5, 7, 9, 11, 13, 15, 17, 19] (https://eval.in/953261)
[18:23:00] ltem: has joined #ruby
[18:23:56] havenwood: >> 1.step(by: 2).lazy.take(10).force
[18:24:09] ruby[bot]: havenwood: # => [1, 3, 5, 7, 9, 11, 13, 15, 17, 19] (https://eval.in/953262)
[18:25:12] dminuoso: >> add = ->(a, b) { a + b }.curry; inc = add.(1); 1.step(by: 2).lazy.map(&inc).take(10).force
[18:25:13] ruby[bot]: dminuoso: # => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] (https://eval.in/953263)
[18:25:42] dminuoso: havenwood: Lazy enums are so weird in Ruby. Feels like a lot of effort :D
[18:26:07] mikecmpbll: has joined #ruby
[18:27:04] havenwood: dminuoso: It'd be interesting to try to go a bit further with lazy enums and parallel execution.
[18:27:41] alfiemax: has joined #ruby
[18:27:52] havenwood: dminuoso: I like the looks of what Elixir is doing with Flow.
[18:27:53] havenwood: Stream is to Flow as lazy enum is to what I want.
[18:28:00] havenwood: https://github.com/elixir-lang/flow
[18:28:27] dminuoso: havenwood: take 10 [1,3..]
[18:28:38] dminuoso: take that against 1.step(by: 2).lazy.take(10)
[18:28:49] havenwood: Alchemists use Stream a lot more than I see Rubyists use Lazy Enumerators though.
[18:29:01] havenwood: dminuoso: mm
[18:29:04] dminuoso: Alchemists is the term for elixir programmers?
[18:29:46] nowhereman_: has joined #ruby
[18:30:16] raynold: has joined #ruby
[18:30:18] havenwood: dminuoso: A bunch of the Elixir core team use emacs, and the most popular Elixir plugin is Alchemy.
[18:30:22] drewmcmillan: has joined #ruby
[18:30:41] white_lilies: has joined #ruby
[18:31:06] dminuoso: 19:28 havenwood | Alchemists use Stream a lot more than I see Rubyists use Lazy Enumerators though.
[18:31:14] dminuoso: Most Rubyists dont know much about FP so..
[18:31:40] dminuoso: havenwood: Btw I finally grasped why I hate transducers.
[18:31:52] cagomez: has joined #ruby
[18:31:57] havenwood: dminuoso: why?
[18:31:58] dminuoso: Transducers merely exist because the execution model of Ruby is so bad, that you cant expect loop fusion to happen on its own.
[18:32:13] dminuoso: So you kind of need to holds Ruby's hand.
[18:32:44] cagomez: has joined #ruby
[18:34:03] dminuoso: Also lack of currying and compose..
[18:34:24] RubyTester00: has joined #ruby
[18:36:55] dminuoso: havenwood: I mean if you could do `sum * map(double) * filter(odd)` and expect this to be fused into a single loop, then I think that's tons more readable.
[18:37:44] larcara: has joined #ruby
[18:37:51] white_lilies: has joined #ruby
[18:40:22] xuyuheng_: has joined #ruby
[18:43:40] claudiuinberlin: has joined #ruby
[18:44:27] sameerynho: has joined #ruby
[18:47:32] flak: has joined #ruby
[18:48:39] chouhoulis: has joined #ruby
[18:49:07] nogic: has joined #ruby
[18:49:15] oo_func: has joined #ruby
[18:53:17] bigblind: has joined #ruby
[18:53:24] rrutkowski: has joined #ruby
[18:53:40] Dimik: has joined #ruby
[18:53:58] chouhoulis: has joined #ruby
[18:54:12] alex``: has joined #ruby
[18:55:43] white_lilies: has joined #ruby
[18:56:13] rrutkowski: has joined #ruby
[18:57:23] mtkd: has joined #ruby
[18:58:30] c0ncealed: has joined #ruby
[18:58:55] eckhardt: has joined #ruby
[18:59:38] bijan_: has joined #ruby
[19:03:18] dinfuehr: has joined #ruby
[19:07:13] chouhoulis: has joined #ruby
[19:10:38] cadillac_: has joined #ruby
[19:12:16] ziadoz: has joined #ruby
[19:12:38] Lytol: has joined #ruby
[19:12:58] ogres: has joined #ruby
[19:13:01] white_lilies: has joined #ruby
[19:14:38] jaruga_: has joined #ruby
[19:15:03] Rapture: has joined #ruby
[19:18:02] marmorkreb: has joined #ruby
[19:21:04] dionysus69: has joined #ruby
[19:21:14] cadillac_: has joined #ruby
[19:21:27] schneide_: has joined #ruby
[19:24:16] darkhanb_: has joined #ruby
[19:32:53] jottr: has joined #ruby
[19:33:22] ziadoz: has joined #ruby
[19:34:03] cadillac_: has joined #ruby
[19:35:31] ziadoz: has joined #ruby
[19:38:52] white_lilies: has joined #ruby
[19:38:57] ramfjord: has joined #ruby
[19:39:29] alfiemax: has joined #ruby
[19:39:33] darkhanb: has joined #ruby
[19:42:44] cthulchu: has joined #ruby
[19:43:10] bigblind: has joined #ruby
[19:44:51] cadillac_: has joined #ruby
[19:45:01] ali_g: has joined #ruby
[19:48:04] biberu: has joined #ruby
[19:48:51] vutral|kali: has joined #ruby
[19:48:52] vutral|kali: has joined #ruby
[19:48:56] ali_g: hello all! not sure if proper channel but i'm using jekyll. I'm trying to put a list of items in 3 different divs. It shouldn't be so difficult but I'm printing a single concatenated line with all the items of the list and don't understand why. Can anybody help? here's the gist: https://gist.github.com/ponentesincausa/760b687acbd76c35665f4b87466a4b7f
[19:52:23] alfiemax: has joined #ruby
[19:56:17] Toggi3: has joined #ruby
[19:57:15] leitz: has joined #ruby
[19:58:52] cadillac_: has joined #ruby
[19:59:22] cadillac_: has joined #ruby
[20:00:01] pastorinni: has joined #ruby
[20:04:55] leitz: How do you pass a symbol hash key to a method? https://gist.github.com/LeamHall/86d3e66f0247d0487eb4b888af9af4f0
[20:05:27] leitz: So far sending as a symbol and as a variable don't seem to work.
[20:06:28] chouhoul_: has joined #ruby
[20:06:49] ramfjord: has joined #ruby
[20:09:02] cagomez: has joined #ruby
[20:10:40] cadillac_: has joined #ruby
[20:10:46] xuyuheng_: has joined #ruby
[20:13:22] white_lilies: has joined #ruby
[20:13:28] tcopeland: has joined #ruby
[20:15:00] x77686d: has joined #ruby
[20:18:27] alfiemax: has joined #ruby
[20:19:05] ecuanaso: has joined #ruby
[20:20:15] amirite: has joined #ruby
[20:20:19] RougeR: has joined #ruby
[20:20:34] apeiros: leitz: I assume in `def upp_mod(upp, :stat)` you meant `def upp_mod(upp, stat)`
[20:20:57] apeiros: :stat is a value, it makes as little sense as e.g. `def upp_mod(upp, 12)`, as 12 is a value too.
[20:20:59] ramfjord: has joined #ruby
[20:21:46] oo_func: has joined #ruby
[20:23:31] nogic: has joined #ruby
[20:23:37] fp-: has joined #ruby
[20:24:58] oo_func_: has joined #ruby
[20:25:20] leitz: apeiros, I tried that too. The easy way would be to send "upp[:int]" but I'm trying to not make the method caller know about the method.
[20:25:28] leitz: Could be futile on my part.
[20:25:39] bigblind: has joined #ruby
[20:27:44] leitz: You know, it helps to not be real tired and forget that a hash uses {}...
[20:28:43] Vapez: has joined #ruby
[20:29:19] leitz: Hmm....upp[:int] seems to be the way to go.
[20:30:08] leitz: ACTION steps away for a few minutes.
[20:30:51] xuyuheng_: has joined #ruby
[20:30:53] alfiemax: has joined #ruby
[20:32:08] chouhoulis: has joined #ruby
[20:33:26] apeiros: leitz: "I tried that", and what went wrong?
[20:37:21] drewmcmillan: has joined #ruby
[20:37:31] cschneid: has joined #ruby
[20:39:18] alfiemax: has joined #ruby
[20:41:20] knight33: has joined #ruby
[20:41:37] guille-moe: has joined #ruby
[20:41:38] John_Ivan: has joined #ruby
[20:41:38] John_Ivan: has joined #ruby
[20:41:50] cagomez: has joined #ruby
[20:44:06] ldepandis: has joined #ruby
[20:50:27] ramfjord: has joined #ruby
[20:50:53] xuyuheng_: has joined #ruby
[20:51:31] minimalism: has joined #ruby
[20:53:38] cagomez: has joined #ruby
[20:55:37] chouhoulis: has joined #ruby
[21:00:29] yokel: has joined #ruby
[21:01:14] n0m4d1c: has joined #ruby
[21:01:52] schneide_: has joined #ruby
[21:02:40] mtkd: has joined #ruby
[21:04:25] x77686d: has joined #ruby
[21:05:03] pharo-user: has joined #ruby
[21:06:12] Strepsils: has joined #ruby
[21:09:35] rasterick: has joined #ruby
[21:11:07] synthroid: has joined #ruby
[21:11:19] rasterick: cool, my friend leitz is here :) .. are you awake ?
[21:15:23] rasterick: i have been learning about ruby .. i downgraded to v2.3 with same results .. was worth a try tho
[21:15:30] ramfjord: has joined #ruby
[21:16:08] rasterick: and did the gem install rake and drake ... same results
[21:17:02] rasterick: i noticed a folder with 13 .rb files and other errors i forgot to mention
[21:17:47] rasterick: rake aborted! LoadError: cannot load such file -- pty
[21:18:12] rasterick: rake.d/pch.rb:21:in `<top (required)>'
[21:18:20] qyliss: rasterick: pty usually comes with Ruby. How did you install it?
[21:18:43] rasterick: with installer
[21:19:10] alfiemax: has joined #ruby
[21:19:31] cschneid: has joined #ruby
[21:20:09] apeiros: oh, qyliss - you use the same nick on twitter?
[21:20:26] apeiros: nice, didn't know you were on irc as well
[21:20:37] leitz: rasterick, you might want to explain your setup. In a "normal" environment running rake in the directory with a rakefile works.
[21:20:38] qyliss: a fairly recent development
[21:20:41] qyliss: rasterick: which installer?
[21:20:49] qyliss: apeiros: do I know you from twitter?
[21:21:09] leitz: ACTION is stil groggy from the current nap.
[21:21:13] apeiros: I don't think you do, no, since I use the same nick on twitter too :D
[21:22:06] apeiros: I follow you on twitter. iirc through some retweets which piqued my interest.
[21:22:25] atchoum: has joined #ruby
[21:22:44] chouhoulis: has joined #ruby
[21:23:46] rasterick: has joined #ruby
[21:24:04] rasterick: got dc i think
[21:24:08] rasterick: https://gist.github.com/anonymous/6f44868f05e6c82f2ae532ba07d3b7c5
[21:24:58] rasterick: only 5 lines but nicer to see all on one page instead of here
[21:27:19] baweaver: >> M = -> *a { -> b { a.each_with_index.all? { |e, i| e === b[i] || e == :* }}}; case ['Bob', 25]; when M[/^B/, :*] then 'B name!' else 'Not B!' end
[21:27:20] ruby[bot]: baweaver: # => "B name!" (https://eval.in/953480)
[21:27:55] alfiemax: has joined #ruby
[21:27:58] rasterick: at least you know this stuff
[21:30:32] leitz: Yeah, baweaver and apeiros are my external "genius Ruby brains".
[21:30:51] rasterick: the situation is: building a prog, the config gives me a Rakefile instead of a Makefile ... i cannot seem to get Ruby rake or drake to compile the prog ... any help is appreciated
[21:31:07] xuyuheng_: has joined #ruby
[21:31:35] leitz: he's using bash on Winderz.
[21:32:40] leitz: Not seeing the rakefile in there.
[21:33:43] baweaver: What's the actual script?
[21:34:41] rasterick: the rakefile is in the root dir .. that is a subdir with the .rb files
[21:35:25] rasterick: what is actual script ?? i do not understand the question
[21:36:00] leitz: rasterick, keep in mind they haven't read your set up and the error.
[21:36:10] mattwc: I might just be blind, but does anyone know where the documentation for socket.gets is?
[21:36:38] baweaver: mattwc: I'd bank on it using IO somehow
[21:36:41] `derpy: http://ruby-doc.org/stdlib-2.4.1/libdoc/socket/rdoc/Socket.html
[21:36:54] apeiros: mattwc: probably in IO
[21:36:56] rasterick: i just ran: gem install drake ... worked ! :)
[21:37:01] banisterfiend: baweaver how are your emus
[21:37:08] banisterfiend: or lemers or dolphins or whatever they are
[21:37:20] mattwc: ah yeah its in IO
[21:37:39] rasterick: hello leitz! hope all is well for you today
[21:38:07] baweaver: yep: "From: io.c (C Method):"
[21:38:39] baweaver: me and havenwood are working out the book deal details banisterfiend :D
[21:38:59] banisterfiend: baweaver pretty soon that delving is going to get a lot deeper homie
[21:39:59] banisterfiend: baweaver http://g.recordit.co/upGqTjoP4q.gif
[21:40:40] baweaver: Ah, pry, right
[21:40:48] baweaver: Kinda like you wrote the thing or something
[21:40:58] banisterfiend: baweaver no i mean that you can now explore MRI source code
[21:41:10] banisterfiend: previously pry would stop at the method/c-function interface
[21:41:14] banisterfiend: now you can explore the entire MRI code base
[21:41:23] leitz: apeiros, "tried that": changing the method to use (upp, stat) and then trying to access it via upp[:stat].
[21:41:24] banisterfiend: structs, enums, functions, macros etc
[21:41:57] banisterfiend: well i'll release it on monday
[21:42:28] apeiros: leitz: yes, got that. and as asked before, what went wrong when you used `def upp_mod(upp, stat)`?
[21:42:56] leitz: ACTION is still waking up and checking.
[21:44:13] leitz: apeiros, okay. "def upp_mod(upp, stat)" and called with "upp_mod(upp, :int)" works.
[21:44:48] leitz: The issue is, should the caller know the stats are stored as symbols?
[21:45:16] leitz: I just changed upp from a struct back to a hash.
[21:45:44] apeiros: is the signature all you changed? if so, it won't work the way you expect it to. look at line 11 (https://gist.github.com/LeamHall/86d3e66f0247d0487eb4b888af9af4f0#file-symbol-rb-L11 )
[21:46:12] cdg: has joined #ruby
[21:46:37] apeiros: using smybols as identifiers is fine. it also does not mean that the caller knows anything about how it's internally stored. all it knows is how the stat is identified.
[21:46:59] apeiros: and you're correct. the *how* it is stored is none of the caller's business
[21:47:28] eckhardt: has joined #ruby
[21:49:06] leitz: apeiros, after the "### Redo" https://gist.github.com/LeamHall/86d3e66f0247d0487eb4b888af9af4f0
[21:50:11] leitz: That works.
[21:50:19] apeiros: leitz: that looks correct. also IMO you should prefer a struct over a hash.
[21:50:21] pastorinni: has joined #ruby
[21:50:26] apeiros: you can access the values just the same too
[21:50:41] leitz: And I can mostly understand it. Tried the struct, it was beyond my ability to use well.
[21:50:47] apeiros: i.e. `stat = :int; upp[stat]` will work just fine with upp being a Struct
[21:51:38] apeiros: and it'll properly complain if you make typos, i.e. `upp[:innt]` will raise
[21:52:50] rrutkowski: has joined #ruby
[21:52:52] apeiros: (and it's a good first stop before making it a proper class, which should be your end goal)
[21:54:24] Axsuul: has joined #ruby
[21:54:49] jxf: has joined #ruby
[21:55:12] Mendel: has joined #ruby
[21:55:35] leitz: Prefer upp to be simple, it's a part of Character class.
[21:56:14] pastorinni: has joined #ruby
[21:56:24] leitz: Current use case is that a task will pass in the chacracter and the stat that would modify the roll, and the method would return the modifier.
[21:56:39] cdg: has joined #ruby
[21:58:16] chouhoul_: has joined #ruby
[21:58:39] cardoni: has joined #ruby
[22:00:01] apeiros: leitz: simple can take different forms. IMO a struct is far simpler than a hash.
[22:00:09] minimalism: has joined #ruby
[22:00:48] apeiros: the other aspects of simple will become more visible when you make upp a full class and don't have to distribute knowledge about how it works, and instead can organize it within said class.
[22:02:39] Tony-St4rk: has joined #ruby
[22:03:24] leitz: apeiros, I'm trying to figure out how to show old code on Github. The upp was a struct and I was having issues with needing to define methods inside and outside of the struct to do the same thing.
[22:03:53] leitz: Never fear, I have plenty of challenges lined up for the group, mentally planning my first "large app".
[22:04:20] John_Ivan: has joined #ruby
[22:04:20] John_Ivan: has joined #ruby
[22:04:29] rasterick: ... dons his coding gloves ...
[22:05:11] John_Ivan: has joined #ruby
[22:05:11] John_Ivan: has joined #ruby
[22:05:41] chouhoulis: has joined #ruby
[22:06:12] alfiemax: has joined #ruby
[22:08:53] leitz: Philosophical question: "How much magic to include?"
[22:09:17] rwb: has joined #ruby
[22:09:38] oo_func: What kind of magic are you talking about?
[22:09:42] leitz: Ruby can do all sorts of cool stuff. I write basic code and invite other newbies to join in. In Ruby this works, but I'm not sure it's the best due do being very Ruby specific. https://github.com/makhidkarun/2d6_ogl_chargen/blob/master/lib/character_tools.rb#L46
[22:10:51] rasterick: looks like a WoW game script
[22:10:59] leitz: If you rank Ruby skill on a 1-10, I may be growing into a 2. There's a lot of 0's and 1's who don't yet know the fun of Ruby so I try to encourage.
[22:11:43] rasterick: i think i am at the -0 level right now
[22:11:44] leitz: rasterick, a Ruby method returns the last result. In other languages that might be "return 3". Which works in Ruby, but you don't have to.
[22:12:16] leitz: Hey, I have about three months of experience gained over the last couple years.
[22:12:19] apeiros: leitz: any sufficiently analyzed magic is indistuingishable from science
[22:12:40] nadir: has joined #ruby
[22:13:16] rasterick: ... offers lietz his top hat, wand, and white rabbie for the magic show
[22:13:17] apeiros: but regarding code - it depends on the audience. if you're the sole developer, that audience is your future you.
[22:13:33] rasterick: the pretty female assistant stays with me tho *grin*
[22:13:47] leitz: Yeah, that's why I use {} vice "do...end"
[22:13:55] apeiros: i.e., include as much magic as you think you can understand one month, three months, 6 months, one year from now.
[22:14:02] apeiros: s/vice/versus/
[22:14:31] leitz: vice can also mean versus.
[22:14:35] apeiros: though that makes little sense too in that phrase?
[22:14:38] alfiemax: has joined #ruby
[22:14:44] leitz: Sorry, though, it's an older English'ism.
[22:14:58] leitz: I'm older and Americanism'd.
[22:15:35] leitz: If rasterick gets the pretty female assistant I get to keep a vice or two.
[22:15:46] apeiros: you're thinking of vice versa, I think
[22:15:56] leitz: ACTION pities those who have to learn English...
[22:16:27] leitz: "This thing, vice that thing" == "This thing, versus that thing."
[22:16:29] apeiros: but I don't speak english natively, much less old english, so maybe I'm wrong.
[22:17:01] leitz: English has its good points. "Follow the Rules of English" isn't one of them.
[22:17:52] rasterick: .... gets the lexicon ready ...
[22:18:07] eckhardt: has joined #ruby
[22:18:19] ecuanaso: has joined #ruby
[22:18:59] nowhereman_: has joined #ruby
[22:19:18] leitz: rasterick, don't worry. I have tried to learn other human languages. Because of that I try to keep my English direct and clear.
[22:20:25] marmorkreb: has joined #ruby
[22:20:31] nowhere_man: has joined #ruby
[22:20:33] leitz: ACTION has heard American college students with native English worse than aperios'...
[22:20:38] boxrick: has joined #ruby
[22:21:07] apeiros: thanks, I guess?
[22:21:51] jabreity: has joined #ruby
[22:21:54] leitz: You are welcome. Your English is very good.
[22:22:54] leitz: In the entire time I have known you I have seen less than half a dozen phrases that made me think you were not a native speaker.
[22:23:16] leitz: Most American college students wouldn't get "vice" either.
[22:23:26] s1detracking: if i learn ruby do i get a pretty female assistant
[22:23:51] s1detracking: HEEEEEEEEEEEEES A REEEEEEEEEEEEEEEEEEL nowhere_man
[22:24:37] leitz: s1detracking, maybe. At the old Linux World they had models in BSD Demon suits.
[22:24:55] leitz: Long ago.
[22:25:16] qyliss: I’m native Scottish English and have never heard “vice”
[22:25:28] s1detracking: any linux expos nowadays?
[22:26:37] andersh: has joined #ruby
[22:26:58] leitz: qyliss, I'm an introvert with a speech impediment. As a kid I read a lot of older books. Much easier on the ego.
[22:29:38] leitz: vice: https://www.grammarphobia.com/blog/2009/09/vice-isnt-nice.html
[22:29:56] rasterick: models in demon suits ? *perk*
[22:31:09] rasterick: outta those suits may be better
[22:31:53] solidsnack: has joined #ruby
[22:32:09] cttttt: has joined #ruby
[22:32:23] rasterick: i used to enjoy old books about fur trappers from the 1800s
[22:32:42] rasterick: but now i have computers :>
[22:33:00] guardianx: has joined #ruby
[22:33:08] chouhoul_: has joined #ruby
[22:33:50] leitz: ACTION bets the demon suits made rasterick forget his syntax error.
[22:34:04] ryandv: has joined #ruby
[22:34:09] rasterick: what syntax error
[22:34:16] ryandv: Why does precision need to be specified for a Float but not a String in `BigDecimal::new`?
[22:34:19] rasterick: oh yeah , the syntax error
[22:34:20] pwillard: has joined #ruby
[22:34:52] ryandv: is it because we want to omit possible imprecisions from the IEEE 754 representation of Floats?
[22:34:58] ryandv: whereas Strings are "exact" in some sense?
[22:35:07] apeiros: ryandv: because floats are based on the binary system which can only approximate most decimal values
[22:35:09] rasterick: btw, i just DL and installed this: rubysl-pty 2.0.3 Ruby standard library pty
[22:35:23] apeiros: whereas with a string you can just use the arbitrary precision the string already provides
[22:35:45] leitz: rasterick, make sure it works with the current version of Ruby you're using.
[22:35:50] ryandv: apeiros: I see, thanks!
[22:35:54] rasterick: is that like -0 is NAN ?
[22:35:58] apeiros: >> "%.60f" % 0.3
[22:35:59] ruby[bot]: apeiros: # => "0.299999999999999988897769753748434595763683319091796875000000" (https://eval.in/953520)
[22:36:29] apeiros: rasterick: -0 isn't nan
[22:37:09] rasterick: leitz, it said patching gem
[22:37:48] rasterick: does this make me patched now ? .. hmm
[22:38:10] leitz: Perky and Patched. Sounds like a new IRC /nick
[22:38:30] leitz: ACTION really needs to get focussed on his coding...
[22:38:46] rasterick: i guess it would be -0 divided by 1 to be nan
[22:39:09] rasterick: ... checks the syntax lexicon ...
[22:39:24] qyliss: rasterick: other way round
[22:39:35] rasterick: i was close ;>
[22:39:54] rasterick: pesky dislexyia
[22:40:06] qyliss: Actually, in Ruby, it might be -Float::INFINITY
[22:40:16] qyliss: Not at a computer I can check with
[22:40:28] rasterick: that sounds like an open loop
[22:40:36] apeiros: >> 0.0/0 # rasterick
[22:40:37] ruby[bot]: apeiros: # => NaN (https://eval.in/953521)
[22:40:56] apeiros: division by zero in float domain is treated as if it was a limes, and hence results in ±∞
[22:41:03] rasterick: ah, thank you apeiros
[22:41:05] xuyuheng_: has joined #ruby
[22:41:14] apeiros: there are a couple of other operations which result in NaN
[22:41:24] peteretep: has joined #ruby
[22:41:26] apeiros: though IMO a language like ruby should rather raise :-|
[22:41:50] rasterick: ... gets the NAN lexicon out ...
[22:43:03] cagomez: has joined #ruby
[22:43:10] rasterick: ... wades thru all the prime numbers ...
[22:43:48] apeiros: that'll take a while
[22:45:16] rasterick: remember friends in past wrote linux script that would find prime numbers ... runs for months!, never ends
[22:46:13] apeiros: oh, then they wrote it well, means they implemented it in a way to exceed native integer representation (or terrible, because after months it wouldn't reach those limits)
[22:46:37] rasterick: btw, leitz, Ruby works in windows cmd prompt for me just as well
[22:46:54] apeiros: or they used ruby or a language similarly natively being able to go beyond 64bit ints :D
[22:47:19] rasterick: prob so, these were some very intelligent linux geeks from SoCal
[22:48:06] rasterick: as best i remember it was a linux script , sorta like a prog i guess
[22:48:16] alfiemax: has joined #ruby
[22:48:30] apeiros: well, a linux script can be in about any language ;-)
[22:50:02] rasterick: oh, ok. they would for fun write smaller scripts to do tasks , eg.. parse a dir and sort by size,date, etc.
[22:50:44] rasterick: these were command line scripts , too long ago to remember actual chars
[22:52:21] DTZUZO: has joined #ruby
[23:00:17] schneide_: has joined #ruby
[23:00:36] leitz: Sort by size: ls -l | sort -n -k 5
[23:00:51] leitz: ACTION just got back from building a fire in the fireplace.
[23:01:00] Toggi3: has joined #ruby
[23:01:38] ramfjord: has joined #ruby
[23:05:00] andywojo: has joined #ruby
[23:05:17] rasterick: leitz is good at this coding stuff ! :)
[23:05:40] rasterick: ... gets the marshmallows ready by the fireplace
[23:05:56] leitz: rasterick hasn't compared leitz to a lot of people...
[23:06:35] rasterick: well, ls -l | sort was quite good imo
[23:07:30] rasterick: dir o w p works in winders
[23:07:30] mtkd: has joined #ruby
[23:07:37] leitz: That was sort of plain. A better one is "du -xk . | sort -n | tail -10" to find the direcotries taking up all the space in your filesystem.
[23:08:07] rasterick: aha! leitz is an intelligent linux geek
[23:08:23] leitz: ACTION is an old linux geek.
[23:08:36] rasterick: over 30 eh?
[23:09:25] rasterick: i got into linux heavy last year, peppermint was my fav, even installed it on a HDD
[23:10:03] alfiemax: has joined #ruby
[23:10:21] claudiuinberlin: has joined #ruby
[23:10:21] rasterick: it would not run any of my exe.s so i removed and put w2kSP4 on it ... works fine now
[23:10:47] leitz: apeiros, here's my results: https://gist.github.com/LeamHall/5d5920fb99f6e283a634bdcd6ecbedf6
[23:11:12] Paraxial: has joined #ruby
[23:11:34] leitz: From: https://github.com/makhidkarun/2d6_ogl_chargen/blob/master/toys/get_dragon.rb#L22-L30
[23:12:14] goepsilongo: has joined #ruby
[23:14:02] leitz: ACTION thinks it's about time to enjoy the fire with his wife.
[23:14:25] ryandv: has joined #ruby
[23:14:37] rasterick: enjoy the evening Mr. Leitz
[23:15:11] rasterick: ... just had a handrolled NF cig with fresh Boho coffee .. yum!
[23:16:27] rasterick: 73F here btw
[23:17:27] ecuanaso: has joined #ruby
[23:30:10] shinnya: has joined #ruby
[23:31:39] alfiemax: has joined #ruby
[23:35:52] rann: has joined #ruby
[23:42:45] eb0t: has joined #ruby
[23:42:53] eblip: has joined #ruby
[23:50:52] bigblind: has joined #ruby
[23:52:57] goepsilongo: has joined #ruby
[23:53:57] comet23: has joined #ruby
[23:54:10] guacamole: has joined #ruby
[23:54:11] guacamole: has joined #ruby
[23:54:55] schneide_: has joined #ruby
[23:56:13] bijan_: has joined #ruby
[23:57:40] amirite: has joined #ruby