havenwood changed the topic of #ruby to: Ruby 3.3.0, 3.2.3, 3.1.4 https://www.ruby-lang.org | Rules https://ruby-community.com | Logs https://libera.irclog.whitequark.org/ruby
rvalue has quit [Ping timeout: 264 seconds]
rvalue has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 268 seconds]
Vonter has quit [Ping timeout: 256 seconds]
Vonter has joined #ruby
jenrzzz_ has joined #ruby
<zayd> Am I supposed to use #variable or #{variable} when I'm only printing one variable at a time with puts?
<sam113101> no
FetidToot has quit [Quit: Ping timeout (120 seconds)]
FetidToot has joined #ruby
<zayd> sam113101, what am i supposed to use then?
<weaksauce> zayd get in the habit of using p instead of puts
<weaksauce> but either way for single variables just use the name `p foo_bar`
<zayd> probably should have been more clear with this, but as in single variables i meant "Kernel: #{@kernel}"
<zayd> weaksauce, what do they do differently? sorry if this is a dumb question, i'm still kind of new to ruby
<weaksauce> zayd if you puts a string it will output in a human readable way where if you us p it will be the actual string with newlines listed etc
<weaksauce> technically puts calls to_s and the p calls inspect i think
<zayd> so i should use `p` in most cases?
<weaksauce> i do for most things
<weaksauce> sometimes puts is useful but most times p is more relevant
<weaksauce> zayd also for arrays it's different https://i.imgur.com/aBNHmbZ.png
<weaksauce> don't mind the splat
<weaksauce> same as if you were to do 1,2,3,4,5,6 etc
<weaksauce> but to answer your original question it's better to label it if you can like "kernel: #{@kernel}"
<weaksauce> i find that annoying to write though so i'll just do p [:kernel, kernel]
jenrzzz_ has quit [Ping timeout: 268 seconds]
Pixi has quit [Quit: Leaving]
Pixi has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 256 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 240 seconds]
grenierm has joined #ruby
Goodbye_Vincent has quit [Quit: ]
Goodbye_Vincent has joined #ruby
_ht has joined #ruby
user71 has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
jetchisel has quit [Ping timeout: 256 seconds]
jetchisel has joined #ruby
krocos has joined #ruby
krocos has quit [Client Quit]
jenrzzz_ has joined #ruby
<[0x1eef_]> Anyone from Uruguay here?
jenrzzz_ has quit [Ping timeout: 268 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 256 seconds]
grenierm has quit [Quit: Client closed]
Vonter has quit [Ping timeout: 268 seconds]
Vonter has joined #ruby
jenrzzz_ has joined #ruby
jmcantrell has quit [Ping timeout: 256 seconds]
patrick__ has quit [Ping timeout: 256 seconds]
patrick__ has joined #ruby
jmcantrell has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
jenrzzz_ has joined #ruby
gr33n7007h has quit [Quit: WeeChat 4.2.1]
weaksauc_ has joined #ruby
gr33n7007h has joined #ruby
havenwood4 has joined #ruby
havenwood has quit [Ping timeout: 268 seconds]
weaksauce has quit [Ping timeout: 268 seconds]
havenwood4 is now known as havenwood
<rapha> No, pero hay mi terceca (?) classe de Espanol manana!
<henk> zayd: you might also not know but be interested in 'pp'
<rapha> zayd: pp is what i mostly use for debugging when there's no debugger. puts for user-facing output.
jenrzzz_ has quit [Ping timeout: 256 seconds]
user71 has quit [Quit: Leaving]
infinity_fye has joined #ruby
infinity_fye has quit [Remote host closed the connection]
infinityfye has quit [Ping timeout: 276 seconds]
TomyWork has joined #ruby
cybniv has joined #ruby
weaksauce has joined #ruby
eoli3n_ has joined #ruby
adam127 has joined #ruby
havenwood0 has joined #ruby
meimei_ has joined #ruby
away has joined #ruby
cuppajoeman_ has joined #ruby
itok_ has joined #ruby
kapil_ has joined #ruby
wryishly has joined #ruby
olusx has joined #ruby
dannyAAM_ has joined #ruby
hexology- has joined #ruby
intellig1nt_boat has joined #ruby
mweckbec1er has joined #ruby
ghostbusters2 has joined #ruby
gcd has joined #ruby
weyhmueller_ has joined #ruby
havenwood has quit [*.net *.split]
weaksauc_ has quit [*.net *.split]
dannyAAM has quit [*.net *.split]
niv has quit [*.net *.split]
eoli3n has quit [*.net *.split]
whysthatso125070 has quit [*.net *.split]
gcd_ has quit [*.net *.split]
meimei has quit [*.net *.split]
pounce has quit [*.net *.split]
mweckbecker has quit [*.net *.split]
tweaks has quit [*.net *.split]
weyhmueller has quit [*.net *.split]
olus has quit [*.net *.split]
adam12 has quit [*.net *.split]
itok has quit [*.net *.split]
mx has quit [*.net *.split]
hexology has quit [*.net *.split]
kapil has quit [*.net *.split]
wryish has quit [*.net *.split]
ghostbuster has quit [*.net *.split]
cuppajoeman has quit [*.net *.split]
intelligent_boat has quit [*.net *.split]
havenwood0 is now known as havenwood
adam127 is now known as adam12
cuppajoeman_ is now known as cuppajoeman
eoli3n_ is now known as eoli3n
dannyAAM_ is now known as dannyAAM
itok_ is now known as itok
meimei_ is now known as meimei
pounce has joined #ruby
tweaks has joined #ruby
user71 has joined #ruby
Vonter has quit [Ping timeout: 268 seconds]
Vonter has joined #ruby
away is now known as mx
Goodbye_Vincent has quit [Ping timeout: 264 seconds]
FullMetalStacket has joined #ruby
Goodbye_Vincent has joined #ruby
xdminsy has joined #ruby
FullMetalStacket has quit [Quit: Konversation terminated!]
mweckbec1er has quit [Quit: leaving]
mweckbecker has joined #ruby
graywolf has joined #ruby
crespire has quit [Killed (NickServ (GHOST command used by crespire1))]
crespire1 has joined #ruby
<[0x1eef_]> rapha: Your spanish is better than mine.
Aminda has quit [Ping timeout: 255 seconds]
Aminda has joined #ruby
graywolf has quit [Quit: WeeChat 4.0.4]
hexology- is now known as hexology
user71 has quit [Quit: Leaving]
infinityfye has joined #ruby
Vonter has quit [Ping timeout: 246 seconds]
Vonter has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
Goodbye_Vincent has quit [Quit: ]
Goodbye_Vincent has joined #ruby
donofrio_ has quit [Ping timeout: 264 seconds]
donofrio has joined #ruby
Goodbye_Vincent has quit [Ping timeout: 256 seconds]
Goodbye_Vincent has joined #ruby
wyclif has joined #ruby
user71 has joined #ruby
user71 has quit [Client Quit]
jenrzzz_ has joined #ruby
wyclif has quit [Quit: leaving]
jenrzzz_ has quit [Ping timeout: 256 seconds]
fercell has joined #ruby
Vonter has quit [Ping timeout: 252 seconds]
Vonter has joined #ruby
Goodbye_Vincent has quit [Ping timeout: 252 seconds]
cek has joined #ruby
<rapha> well what can i say, i binge watched all of Narcos _and_ Narcos: Mexico
<rapha> (and no, Griselda)
<rapha> now*
Goodbye_Vincent has joined #ruby
dviola has joined #ruby
<[0x1eef_]> -_-
<adam12> O_o
<rapha> :P
reset has quit [Quit: reset]
Pixi has quit [Quit: Leaving]
Pixi has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 268 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
user71 has joined #ruby
nil78 has quit [Read error: Connection reset by peer]
nil78 has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
mexen has joined #ruby
dviola has quit [Quit: WeeChat 4.2.1]
joahim has joined #ruby
<joahim> hi
dviola has joined #ruby
jenrzzz has joined #ruby
Vonter has quit [Ping timeout: 256 seconds]
TomyWork has quit [Remote host closed the connection]
Vonter has joined #ruby
rvalue has quit [Ping timeout: 268 seconds]
rvalue has joined #ruby
joahim has quit [Ping timeout: 268 seconds]
Doc_X has quit [Ping timeout: 268 seconds]
Doc_X has joined #ruby
reset has joined #ruby
reset has quit [*.net *.split]
reset has joined #ruby
joahim has joined #ruby
jenrzzz_ has quit [Ping timeout: 252 seconds]
joahim has quit [Read error: Connection reset by peer]
jenrzzz_ has joined #ruby
<rapha> hola joahim
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz_ has quit [Ping timeout: 255 seconds]
yosafbridge has quit [Quit: Leaving]
jenrzzz_ has joined #ruby
yosafbridge has joined #ruby
dviola has quit [Ping timeout: 260 seconds]
howdoi has joined #ruby
pgib has joined #ruby
<rapha> weaksauce: alright, sooo ... it works when using webrick, either directly or through rackup. puma, unicorn and iodine do NOT work.
<adam12> rapha: what does not work
<adam12> Iodine buffers responses. I bet Unicorn does too.
<adam12> (taking a stab in the dark about what might be similar to both)
<adam12> Almost guarantee it's something related to buffering, but I am not familiar enough with Turbo.
<adam12> Oh. You said Puma doesn't work
<adam12> How many workers/threads for them?
<adam12> I'm not sure that matters since you stepped the code, but might as well ask.
<rapha> 1/1
<rapha> wait, with puma i forgot to specify
<adam12> Can you add a few? Perhaps the websocket connection is blocking.
<rapha> oh
<rapha> puma 10/10 and not working :P
<adam12> Weird.
<adam12> Small demo I can try?
<rapha> and `ruby -run -e httpd . --bind-address=0.0.0.0 --port=3000` is only 1/1, right?
<adam12> Oh I see it. I'll clone the one you shared.
<rapha> :)
<adam12> I doubt it. Webrick has an unbound number of threads, if I remember right.
<rapha> oh ok
<rapha> hmm even with webrick it won't work with the locally served javascript
<rapha> ah, that's because of my mimetype change code not working
<adam12> That's the issue
<adam12> Return `text/html` for the content URL
<adam12> get '/example-content' do
<adam12> + response.headers["Content-type"] = "text/html"
<rapha> yess!!
<rapha> even with just 1/1 workers/threads
<rapha> thank you for solving this riddle, adam12 :)
<adam12> Yeah. I thought it used websockets by default but I must have been mistaken.
<adam12> I used Iodine in a project where I proxied websockets, so I know that if you run it single-thread/single-worker, weird things happen
<adam12> Sadly that contract didn't renew this year :\ I need to find another contract or two to fill some time gaps.
<rapha> oh, sorry to hear that
<adam12> Thanks. It happens :)
<rapha> didn't know you were self-employed
<adam12> I've run my own agency sine 2006.
<rapha> sooo ... not self-employed, but having your own company, with employees and all?
<adam12> No employees.
<adam12> (not sure I'd want the stress of having to keep them employed too)
<rapha> so, self-employed but calling it agency because that sells better :)
<adam12> Exactly :)
<rapha> i understand about the stress of having to care for employees. there's other models, too, though. a few people i know are running a cargo bike manufacturing shop. carbon fibre and stuff. and it's entirely employee-run. they do have a "boss" but they elect him and he can step down from being the boss whenever he doesn't feel like being the boss anymore.
<adam12> Nice.
<adam12> I'm actually considering a full-time role this year for the first time .. ever.
<rapha> takes good communications skills on all sides, but then everything is shared, stress included, which gives a really strong backbone to the whole thing.
<adam12> Writing code and solving issues is a lot more interesting to me than sales, marketing, accounting, etc. I have bookkeeper + accountant to alleviate some pieces, but the grind as a solo is very hard.
<rapha> i tried to do it and it broke me.
<rapha> twice actually, once in 2003, once in 2008.
<rapha> now i'm happily (more or less) employed.
<rapha> and now, since i'm on sick leave, finally the next step in this little project ... figure out streams and add a C3 chart on top.
<rapha> and then figure out how to have a separate Thread push fresh data into it every second
<adam12> Nice.
<adam12> I need to do a project with Turbo just to see how much it's changed since I used it last.
<rapha> how about something that keeps stock of your pantry and fridge?
<adam12> rapha: Interesting :)
Guest40 has joined #ruby
xdminsy has quit [Read error: Connection reset by peer]
_ht has quit [Remote host closed the connection]
mmohammadi9812 has joined #ruby
pgib has quit [Remote host closed the connection]
mmohammadi9812 has quit [Remote host closed the connection]
pgib has joined #ruby
mmohammadi9812 has joined #ruby
Guest40 has quit [Ping timeout: 250 seconds]
mmohammadi9812 has quit [Ping timeout: 272 seconds]
<rapha> huh? it's almost as if github is down?
<rapha> since 45 minutes? o_O
pgib has quit [Ping timeout: 252 seconds]
jenrzzz_ has quit [Ping timeout: 240 seconds]
jenrzzz_ has joined #ruby
pgib has joined #ruby
<adam12> And it's not even Tuesday? Weird.
<adam12> All green here.
<adam12> Hmm.
<adam12> Looks like a routing issue maybe.
<rapha> From, of all places, downforeveryoneorjustme.com to, of all places, GH. That'd be funny.
jenrzzz_ has quit [Ping timeout: 246 seconds]
mange has joined #ruby
<weaksauce> so it was just a mime issue rapha ?
<rapha> yes, weaksauce. that was all.
<weaksauce> annoying
<rapha> indeed.
<rapha> now i'm annoyed at a new thing: using modern JS libraries without a bundler.
jenrzzz_ has joined #ruby
<weaksauce> yeah js not even once
jenrzzz_ has quit [Ping timeout: 255 seconds]
jenrzzz_ has joined #ruby
<rapha> hmm i think i just have to .gsub(/import\s+['"]@([\w+\/]/, 'import "nodes_modules/\1') the .js files before serving them
jenrzzz_ has quit [Ping timeout: 256 seconds]
justache has quit [Read error: Connection reset by peer]
user71 has quit [Quit: Leaving]
justache has joined #ruby
<rapha> argh. that doesn't work. it makes the browser thing it should access .../node_modules/...
<rapha> think*
<rapha> would have to map a path on the fly, not sure i want to do that.
pgib has quit [Read error: Connection reset by peer]
<adam12> rapha: download from esm.sh :P
<adam12> I'm planning on making a non-Rails version of importmaps-rails I think. I _hate_ bundlers for JS.
<adam12> (tho esbuild is OK)
jenrzzz_ has joined #ruby
<adam12> I already started on teh asset digest part. https://github.com/adam12/asset_digest
<rapha> interesting. i've never heard of ESM before yesterday or esm.sh until now. so i thought "let me try and see what rails does" which led to "can i make something like importmaps-rails myself?"
* rapha checks out adam12's project
<rapha> does it work a little already?
<rapha> hmm it knows about source and destination paths, have something that looks like it's doing something and something that looks like it's writing something.
jenrzzz_ has quit [Ping timeout: 272 seconds]
jenrzzz_ has joined #ruby
<rapha> adam12: even though i installed from github, AsssetDigest::Digester#new wants a `source' argument, but https://github.com/adam12/asset_digest/blob/main/lib/asset_digest/digester.rb#L15 says there is none. how does this trickery work?
<rapha> and there is no write_manifest. i'm so sure i must have an older version. *scratches head*
<rapha> alright, got it
cek has quit [Quit: Connection closed for inactivity]
<rapha> but it doesn't yet know how to deal with the '@' stuff, does it :/
<rapha> btw i looked at esm.sh and i don't want to use it as it's a CDN
<adam12> rapha: It's beta. I'm going to start using it on gemdocs.org.
<adam12> I wouldn't use esm.sh as CDN, but rather `curl esm.sh/some-dependency > vendor/some-dependency.js`
<rapha> ah, right
<rapha> but i like yours
<adam12> I haven't tested it with @ but that's a good idea.
<rapha> is it a good idea to go with something like importmap-rails paths when calling AssetDigest::Digest#new?
<rapha> as in, assets/config/manifest.js?
ruby[bot] has quit [Read error: Connection reset by peer]
ruby[bot] has joined #ruby
<rapha> ah, evidently not. atm it doesn't mkdir_p the path to the manifest.
Guest63 has joined #ruby
<rapha> hmm, and wouldn't such a digester have to output an importmap, as well?
Guest63 has quit [Client Quit]
jenrzzz_ has quit [Ping timeout: 240 seconds]
Vonter has quit [Ping timeout: 255 seconds]
Vonter has joined #ruby
<rapha> adam12: need to sleep, made it a good bit of the way further, but stuck here, if you get a chance to take another look: https://git.weitnahbei.de/sixtyfive/throughput/-/blob/main/index.html?ref_type=heads#L34-40
jenrzzz_ has joined #ruby
<adam12> rapha: I'd probably have it output an importmap too eventually, but for now I just do it manually.
jenrzzz_ has quit [Ping timeout: 252 seconds]
jenrzzz_ has joined #ruby