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?
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?
<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>
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. :)