mexen has quit [Quit: Connection closed for inactivity]
sickdyd has joined #ruby
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
crespire1 has joined #ruby
sickdyd has quit [Ping timeout: 240 seconds]
crespire1 has quit [Ping timeout: 240 seconds]
Furai has quit [Quit: WeeChat 3.8]
crespire has joined #ruby
Furai has joined #ruby
grenierm has quit [Ping timeout: 245 seconds]
sickdyd has joined #ruby
reset has joined #ruby
sickdyd has quit [Ping timeout: 248 seconds]
sickdyd has joined #ruby
quintasan has quit []
quintasan has joined #ruby
sickdyd has quit [Ping timeout: 240 seconds]
shiru has joined #ruby
hwpplayer1 has joined #ruby
blackmetal has joined #ruby
<blackmetal>
havenwood: Pardon but have you ever setup async-websocket/async-redis on Rails? if so could you share your config?
<blackmetal>
(setting up a reduced testcase as we speak)
<blackmetal>
My websockets worked fine until switching from Puma to Falcon. Most Falcon examples are for Ruby apps in general and not Rails which goes beyond my understanding so
TomyWork has joined #ruby
<blackmetal>
Btw the script I'm working on now is INSANE
<blackmetal>
Converts audio to MIDI using AI, but since that process it not really reliable, it employs MIDI libs to quantize and turn stuff into proper chords
<blackmetal>
It then plays this off using a Ruby synth
<blackmetal>
Free unlimited MIDI and entertainment. Plus we can start adding arpeggiators to the new MIDI, change scales etc. and end up with original music
sickdyd has joined #ruby
sickdyd has quit [Ping timeout: 256 seconds]
markong has joined #ruby
Sankalp has quit [Ping timeout: 265 seconds]
Sankalp has joined #ruby
sickdyd has joined #ruby
hightower3 has quit [Quit: Leaving]
sickdyd has quit [Ping timeout: 240 seconds]
markong has quit [Ping timeout: 240 seconds]
sickdyd has joined #ruby
sickdyd has quit [Ping timeout: 240 seconds]
shiru has quit [Quit: leaving]
sickdyd has joined #ruby
<havenwood>
blackmetal: No, I haven't used it with Rails. Last I checked, there was still a bit of work that needed merging on Rails to support Fibers rather than Threads for the DB pooling.
<blackmetal>
i see
* blackmetal
using rails 7.1.alpha with the latest falcons (testrepo coming asap)
sickdyd has quit [Ping timeout: 246 seconds]
sickdyd has joined #ruby
sickdyd has quit [Ping timeout: 246 seconds]
gr33n7007h has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
moldorcoder7_ has quit [Ping timeout: 240 seconds]
ultralan has quit [Remote host closed the connection]
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
sickdyd has quit [Ping timeout: 268 seconds]
moldorcoder7 has joined #ruby
kokoro has quit [Ping timeout: 240 seconds]
<adam12>
My 'The Ruby Programming Language' book arrived today (Flanagan & Matz authors). I don't recall ever reading this one. Be interesting to look back to ~ 2008 when it was published and see what was different.
<adam12>
mooff: You know, I thought I'd go look at the genesis git commit (which is an svn import), but I don't see anything. The project structure is a lot different back then. I wonder if it's related to my git checkout.
___nick___ has joined #ruby
<adam12>
I think it was the commit. The genesis commit is kind of anemic.
<adam12>
This book has drawings from _why. Which is interesting. I wonder how it compares to the Poignant Guide drawings.
<mooff>
neat
John_Ivan has joined #ruby
John_Ivan_ has quit [Ping timeout: 268 seconds]
_ht has joined #ruby
desnudopenguino has joined #ruby
lena64t has quit [Remote host closed the connection]
sickdyd has joined #ruby
lena64t has joined #ruby
sickdyd has quit [Ping timeout: 268 seconds]
sickdyd has joined #ruby
TomyWork has quit [Remote host closed the connection]
<ox1eef_>
I support the use of for if only because there's too many opinionated Ruby tools and frameworks that squeeze the air out of the room.
<adam12>
LOL
roadie has quit [Quit: ERC 5.5 (IRC client for GNU Emacs 29.0.90)]
<johnjaye>
i thought i could do that instead of File.open(..) do |file|
<adam12>
johnjaye: No. It's the method that takes the block.
<johnjaye>
oh ok. meaning read
<adam12>
johnjaye: Tho maybe you could do f.then do |file|
<adam12>
johnjaye: That said, the purpose of the block in this case is to ensure you're closing the file and not leaking the file descriptor.
<johnjaye>
oh. so the f.close is not needed?
<adam12>
With a manual open/close, the block is providing you no real value.
<johnjaye>
ok
<adam12>
Well it is in your example. But if you did File.open("somefile") { |file| file.write "bar" } then it wouldn't be necessary. The file is closed at the block end.
<leftylink>
hmm... I can't see f.then having the desired effect here either
<adam12>
leftylink: Closing the file?
<leftylink>
right
<leftylink>
because I was assuming File.open was written in some way like
<leftylink>
pandabot rb def fileopen; if block_given?; "opened file, then did #{yield}, then closed file"; else "just opened file" end; end; f = fileopen; f.then { puts "yup #{_1}" }
<leftylink>
of course we must have self. there, or else it's just a syntax error
<leftylink>
so that's really interesting
<adam12>
Yeah. Originally I had `Object.then`
<adam12>
I thought I could cheat and use `then` but you're right, it is a keyword. I just forgot it was.
<mooff>
then is good
<mooff>
= self.then { x = 1; x }
<ruby-eval>
=> 1
<aesthetikx>
isn't there a #then alias
<mooff>
it was first called yield_self
<mooff>
then #then was added as an alias
<aesthetikx>
you can `tap { x = 1; x }; x` too :)
<aesthetikx>
I think tap is the shortest method on Object that takes a block, but lets verify
<mooff>
tap is a such a good method
<aesthetikx>
`->{ }[]` works too i guess but that is busy
tomtmym has quit [Quit: Gone.]
<aesthetikx>
back on topic though, the weird ruby scoping behavior is actually nice, because you can `if something; first_time_used_variable = 5; end` and then later `if first_time_used_variable`, even though the variable could never have been set if the original conditional was false
<aesthetikx>
I dont' think many other languages let you do that, you have to declare those variables as null or nil or undefined outside the first condition
<leftylink>
hmm, well, ->{}[] was actually the first thing that came to mind, since when I want a scope it is obvious that a function would do it, vs if I'd use a block with tap I have to stop to think about whether it does
<leftylink>
but perhaps if I had the rules more fully ingrained it may be the other way around
<leftylink>
so as the kids say these days... that's a skill issue on my part
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
ap4y has joined #ruby
<mooff>
aesthetikx: yeah, the scope of local variables is neat in Ruby. and not what you first expect
gr33n7007h has quit [Ping timeout: 268 seconds]
<mooff>
code in a def, class or module body can't see locals set outside of themselves
gr33n7007h has joined #ruby
<mooff>
it's like the parser scans to the end of the block, finds the "foo = " statements, then marks the names of local variables assigned in that scope
sickdyd has quit [Ping timeout: 264 seconds]
sickdyd has joined #ruby
<mooff>
it's hard to describe, but the way they're lexical is interesting
<ruby-eval>
ERROR: undefined local variable or method `hello' for main:Object
<leftylink>
hmm reading that statement in a cetain way makes it sound like the parser does it out-of-order or two passes but I don't think I see evidence for that
<mooff>
you can "set" a new local variable on a binding via local_variable_set(), but it's academic as the parser already decided it doesn't exist
<mooff>
in bytecode, i bet "foo" doesn't come out as "retrieve local, call method if not in locals"
<leftylink>
huh, didn't think that would happen. interesting
<mooff>
but either "retrieve local" or "send method" based on whether an assignment existed at parse time