havenwood changed the topic of #ruby to: Ruby 3.2.2, 3.1.4, 3.3.0-preview1: https://www.ruby-lang.org | Rules: https://ruby-community.com | Logs: https://libera.irclog.whitequark.org/ruby
keypresser86 has quit [Quit: No Ping reply in 180 seconds.]
keypresser86 has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
flatne has joined #ruby
flatne has quit [Remote host closed the connection]
gh0st6 has quit [Quit: Connection closed for inactivity]
caedmon has joined #ruby
caedmon has quit [Client Quit]
caedmon has joined #ruby
caedmon has quit [Ping timeout: 272 seconds]
<johnjaye> in while loops can you use python style break statement?
<johnjaye> this example code only shows it doing "break if foo"
Sankalp has quit [Ping timeout: 264 seconds]
<ox1eef_> >> while 1 < 5; break "foo"; end
<ox1eef_> No bot. The answer is yes though.
<ruby[bot]> ox1eef_: I'm terribly sorry, I could not evaluate your code because of an error: JSON::ParserError:784: unexpected token at '<!DOCTYPE html>
<johnjaye> well. good thing you're not a bot then
<ox1eef_> Ruby also lets you pass a value with the break statement.
<johnjaye> i did recall that but wasn't sure what it meant
<ox1eef_> >> [1,2,3].find { break "foo" }
<johnjaye> meaning that the while statement itself returns a value?
<ruby[bot]> ox1eef_: # => "foo" (https://carc.in/#/r/fhot)
<ox1eef_> Yep, correct.
<ox1eef_> >> def foo; while 1 < 5; break "foo"; end; end; foo
<ruby[bot]> ox1eef_: # => "foo" (https://carc.in/#/r/fhou)
<ox1eef_> foo method in that case returns "foo".
<johnjaye> hmm
Sankalp has joined #ruby
caedmon has joined #ruby
caedmon has quit [Ping timeout: 246 seconds]
cu_th has joined #ruby
unelided has quit [Ping timeout: 264 seconds]
_ht has joined #ruby
Sankalp has quit [Ping timeout: 246 seconds]
infinityfye has joined #ruby
Sankalp has joined #ruby
Linux_Kerio has joined #ruby
Linux_Kerio has quit [Ping timeout: 272 seconds]
scotch77 has joined #ruby
CrazyEddy has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
ollysmith has quit [Quit: ZNC 1.8.2+deb3.1 - https://znc.in]
_ht has quit [Quit: _ht]
grenierm has joined #ruby
ollysmith has joined #ruby
ollysmith has quit [Ping timeout: 250 seconds]
ollysmith has joined #ruby
ollysmith has quit [Ping timeout: 260 seconds]
ollysmith has joined #ruby
___nick___ has joined #ruby
ollysmith has quit [Ping timeout: 250 seconds]
ollysmith has joined #ruby
ollysmith has quit [Ping timeout: 264 seconds]
ollysmith has joined #ruby
scotch77 has quit [Remote host closed the connection]
ollysmith has quit [Ping timeout: 272 seconds]
teclator has joined #ruby
ollysmith has joined #ruby
cxl_ is now known as cxl
MarvelousWololo has quit [Read error: Connection reset by peer]
cu_th has left #ruby [#ruby]
Guest17 has joined #ruby
<hightower3> Hey I forgot, which method in `GC` (or some other module) gives me access to all objects in memory?
<hightower3> (ah, ObjectSpace, not GC, thanks)
yCrazyEdd has joined #ruby
CrazyEddy has quit [Ping timeout: 264 seconds]
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
crespire has quit [Ping timeout: 272 seconds]
yCrazyEdd is now known as CrazyEddy
crespire1 has joined #ruby
grenierm has quit [Ping timeout: 246 seconds]
Guest17 has quit [Quit: Client closed]
shokohsc52 has joined #ruby
shokohsc5 has quit [Ping timeout: 245 seconds]
shokohsc52 is now known as shokohsc5
Linux_Kerio has joined #ruby
mbuf has joined #ruby
sagax has quit [Ping timeout: 272 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
sagax has joined #ruby
sagax has quit [Changing host]
sagax has joined #ruby
desnudopenguino has quit [Remote host closed the connection]
desnudopenguino has joined #ruby
<isene> I have a mindboggling oddity here; In my rsh (https://github.com/isene/rsh), I can do `echo "Hello World" | less`. But when I write a file hw.txt containing only "Hello World" and do this in rsh `less hw.txt` it hangs... nothing happens and I can't even exit the command, I have to kill the terminal. I'we tried all kinds of fixing, magick and even voodoo (however that is spelled). Not even crystals or
<isene> tea leaves seems to do any dent. Help?
markong has joined #ruby
<isene> It hangs on the system() call (https://github.com/isene/rsh/blob/main/rsh#L720) - but doing the alternatives `%x[#{@cmd}]` or simply enclosing in backticks makes no difference. Why is it behaving like this?
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
some14u has quit [Client Quit]
gr33n7007h has quit [Ping timeout: 246 seconds]
gr33n7007h has joined #ruby
brug has joined #ruby
Linux_Kerio has quit [Ping timeout: 240 seconds]
<gr33n7007h> isene: strace it and see where it hangs
<ox1eef_> isene: Try: Process.wait spawn("...")
<ox1eef_> Your shell should really use that, or fork & exec.
Shell has left #ruby [#ruby]
<ox1eef_> system uses "sh", so your shell depends on another shell. No good if you ask me.
<gr33n7007h> yeah, it needs a good overhaul tbh
markong has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
dionysus69 has quit [Client Quit]
brug has left #ruby [#ruby]
brug has joined #ruby
<ccooke> isene: It might be issues with blocking on STDIN.
<ccooke> Check to see if 'less -E hw.txt' has the same issue (that should exit after printing the file)
<isene> Cool tips, guys. Will check and test out later.
gr33n7007h has quit [Quit: WeeChat 4.0.2]
some14u has joined #ruby
some14u has quit [Client Quit]
brug has left #ruby [#ruby]
gr33n7007h has joined #ruby
TomyWork has joined #ruby
<ox1eef_> I would look into fork, and exec. That's most likely what #!/bin/sh is doing. But spawn is powerful too, just to be sure to use it in a such a way that it doesn't use a shell or you're back to square one.
teclator has quit [Ping timeout: 246 seconds]
brokkoli_origin has quit [Remote host closed the connection]
konsolebox has joined #ruby
brokkoli_origin has joined #ruby
octobear has joined #ruby
_ht has joined #ruby
<isene> I wouldn't mind having it use a shell, since for me, rsh serves the purpose of usability, not of rewriting shell basics. Almost like what a window manager does in adding a layer of functionality/usability on top. But if that is what it takes to remove this strange behaviour,...
eddof13 has joined #ruby
<dnadev2> going off my question above, this is my monkey patch attempt: https://pastes.io/sipr5atiri, think this is a good approach/safe?
John_Ivan has quit [Ping timeout: 272 seconds]
mbuf has quit [Remote host closed the connection]
John_Ivan has joined #ruby
John_Ivan_ has joined #ruby
John_Ivan has quit [Ping timeout: 246 seconds]
octobear has quit [Ping timeout: 245 seconds]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
peterweyand has joined #ruby
<peterweyand> Ok, I have a dumb ruby on rails question
<peterweyand> for some reason I can't install rails no matter what I do. I've installed ruby, and I've added rails to my path, but for some reason rails -v keeps saying it's not installed.
___nick___ has joined #ruby
<weaksauce> which ruby and where?
<peterweyand> it's the latest version of ruby from homebrew. I've also installed ruby using rbenv but that doesn't work either
<weaksauce> type which ruby
<peterweyand> /opt/homebrew/bin/ruby
<weaksauce> i'd advise you to use rbenv
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<weaksauce> type rbenv init and follow those instructions
<peterweyand> ok I'm doing that, but it should be able to work with either version imo
eddof13 has joined #ruby
<weaksauce> it should but if you want it to be robust use rbenv
<weaksauce> when you get that going open a new shell and type which ruby again
<peterweyand> ok, it works now. Not a fan of homebrew not working with rails; if someone smarter than me could look into that that would most likely help a bunch of people. Thanks!
<weaksauce> i have no clue what homebrew was doing but most serious rubyists use something like rbenv/chruby/asdf or the like
octobear has joined #ruby
octobear has quit [Ping timeout: 240 seconds]
infinityfye has quit [Read error: Connection reset by peer]
<leftylink> originally I wanted to make a very sarcastic remark about https://en.wikipedia.org/wiki/No_true_Scotsman
<leftylink> but I stopped myself
<leftylink> because I realised it would be too rash to make a sarcastic remark about a subject I know nothing about
infinityfye has joined #ruby
infinityfye has quit [Remote host closed the connection]
<leftylink> basically that I should check myself before I wreck myself
<leftylink> better to close my mouth and be thought a fool than to open it and remove all doubt
<leftylink> and in fact this statement doesn't even apply
<leftylink> if I close my mouth, nobody was going to think me a fool anyway
aesthetikx has quit [Ping timeout: 264 seconds]
___nick___ has quit [Ping timeout: 250 seconds]
Guest17 has joined #ruby
Guest17 has quit [Client Quit]
Pixi has quit [Read error: Connection reset by peer]
Pixi has joined #ruby
MarvelousWololo has joined #ruby
_ht has quit [Remote host closed the connection]
szkl has joined #ruby
kaivai has quit [Ping timeout: 245 seconds]
shokohsc59 has joined #ruby
shokohsc5 has quit [Ping timeout: 245 seconds]
shokohsc59 is now known as shokohsc5
ua_ has quit [Ping timeout: 245 seconds]
mexen has joined #ruby
kaivai has joined #ruby
aesthetikx has joined #ruby
Pixi` has joined #ruby
Pixi has quit [Ping timeout: 250 seconds]
peterweyand has quit [Ping timeout: 272 seconds]
ua_ has joined #ruby
<havenwood> weaksauce: Homebrew Ruby is nice in that it's a precompiled, well-maintained binary. A downside is brew gems not being in PATH, but chruby can fix that easy enough. :)
<havenwood> That's ^ a fine little script to get started, and you can add other Ruby versions as projects come up that need them.
<weaksauce> brew gems not being in the path seems like a pretty big deficiency
<weaksauce> can homebrew actually install multiple versions of ruby?
<havenwood> Indeed, makes it hard for folk just getting started to use it for much.
<weaksauce> at the same time that is
<havenwood> yup
<havenwood> I think they only do latest TEENY patch version, but I've had multiple.
mexen has quit []
<havenwood> At least with chruby you can switch to brew or ones you build yourself seemlessly.
<havenwood> jhass does similar with Arch Linux and chruby.
<weaksauce> idk seem more complicated and fragile for little gain
<weaksauce> but cest la vie
peterweyand has joined #ruby
c10l67 has joined #ruby
c10l6 has quit [Ping timeout: 245 seconds]
c10l67 is now known as c10l6
teclator has joined #ruby
peterweyand has quit [Quit: WeeChat 3.8]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
teclator has quit [Ping timeout: 264 seconds]
rvalue has quit [Quit: ZNC - https://znc.in]
rvalue has joined #ruby
tomtmym has quit [Quit: Gone.]
rvalue has quit [Quit: ZNC - https://znc.in]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rvalue has joined #ruby
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
szkl has quit [Quit: Connection closed for inactivity]