baweaver changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first! | BLM ❤️
cnsvc has quit [Quit: WeeChat 2.9]
Technodrome has joined #ruby
ramfjord has quit [Ping timeout: 258 seconds]
Ai9zO5AP has quit [Remote host closed the connection]
Ai9zO5AP has joined #ruby
bruce_lee has quit [Ping timeout: 265 seconds]
i9zO5AP has joined #ruby
Ai9zO5AP has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
detectiveaoi has joined #ruby
TCZ has quit [Quit: Leaving]
mistergibson has quit [Quit: Leaving]
dionysus69 has quit [Ping timeout: 240 seconds]
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
i9zO5AP has quit [Remote host closed the connection]
i9zO5AP has joined #ruby
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 260 seconds]
roshanavand_ is now known as roshanavand
detective_aoi has joined #ruby
detectiveaoi has quit [Read error: Connection reset by peer]
drincruz has quit [Ping timeout: 260 seconds]
drincruz has joined #ruby
drincruz has quit [Ping timeout: 260 seconds]
detective_aoi has quit [Quit: Leaving]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drincruz has joined #ruby
meagar has joined #ruby
orbyt_ has joined #ruby
biggtimber has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
CommunistWolf has quit [Ping timeout: 260 seconds]
cthulchu_ has quit [Ping timeout: 256 seconds]
CommunistWolf has joined #ruby
drincruz has quit [Ping timeout: 272 seconds]
akem has quit [Ping timeout: 258 seconds]
stnly has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 258 seconds]
wallace_mu has quit [Remote host closed the connection]
meagar has quit []
ChmEarl has quit [Quit: Leaving]
donofrio has quit [Remote host closed the connection]
impermanence has quit [Ping timeout: 240 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
donofrio has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
bocaneri has joined #ruby
_whitelogger has joined #ruby
LtHummus has quit [Quit: ZNC 1.8.2 - https://znc.in]
LtHummus has joined #ruby
drincruz has joined #ruby
drincruz has quit [Ping timeout: 272 seconds]
burgestrand has joined #ruby
braincrash has joined #ruby
burgestrand has quit [Quit: burgestrand]
supercoven has joined #ruby
burgestrand has joined #ruby
imode has quit [Ping timeout: 240 seconds]
akem has joined #ruby
akem has quit [Client Quit]
burgestrand has quit [Quit: burgestrand]
yokel has quit [Read error: No route to host]
yokel has joined #ruby
akem has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
braincrash has quit [Ping timeout: 264 seconds]
dionysus69 has joined #ruby
_whitelogger has joined #ruby
davispuh has joined #ruby
davispuh has quit [Ping timeout: 272 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
Rudd0 has quit [Ping timeout: 265 seconds]
drincruz has joined #ruby
ellcs has joined #ruby
TCZ has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
johndotpub has quit [Quit: /dev/zero]
johndotpub has joined #ruby
greengriminal has joined #ruby
hiroaki has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
greengriminal has quit [Quit: Leaving]
Nahra has joined #ruby
<isene> Writing a file manager. I want to change the working directory of the parent process (the shell where the file manager was launched) to the directory that the user navigated to in the file manager. I know this is not generally possible within ruby, but I suspect there is some trick I can do... but how?
<jhass> I don't think it's possible at all
<jhass> maybe you can make your program print the directory and have a shell function that does cd $(your_program), but that's still quite ugly
ellcs has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
supercoven has quit [Ping timeout: 240 seconds]
<isene> jhass: Any ugly will do
semz has joined #ruby
<semz> Is there a detailed document about Marshal's format somewhere? I'm writing a parser for (a pretty large subset of) it and have considerable trouble nailing down the exact behavior of the object/symbol caches.
<isene> So, I source a script in my zsh that launches the said file manager. Now, how do I make that script respond to my ruby program doing ' puts Dir.pwd ' ? Or should I print the pwd to some other place where the parent script can catch it?
<jhass> isene: you want to change it while the subprogram is running? Why?
jmcgnh has quit [Ping timeout: 246 seconds]
<isene> No - I want to cd to a desired location when the program exits - but I need to catch that Dir.pwd in the parent script to do just that
<isene> Use case = Launch the file manager, move to directory X, move the user to directory X when she exits the file manager
<jhass> semz: tried to dig a bit but couldn't find much. https://github.com/ruby/ruby/blob/master/doc/marshal.rdoc seems to be the main one and not too detailed, especially about what you're asking for. Maybe some can be learned from the ruby spec (github.com/ruby/spec) and the jruby implementations in addition to the CRuby implementation
Technodrome has joined #ruby
<jhass> isene: that's where I say it's ugly, you gotta make sure your file manager only prints the directory as output, then you can just file-manager() { cd "$(actual-file-manager)" }
<jhass> alternatives are starting to parse the output of the command in the shell function and print the path with some marker that makes it easier (error prone) or as you say write some file to /tmp (easy to pollute things, racy for concurrent invocations)
jmcgnh has joined #ruby
<jhass> you probably also want to make use of exit codes in order to only try to cd on success
<isene> jhass: I source the simplest of scripts: function r { cd "$(rtfm)" } - but that went south in a second - the file manager got started (I think) but the terminal just halts. I know the fm responds since when I press "q" to exit, it does in fact exit and populates the screen with lots of curses code (the rtfm is a curses application).
<jhass> well, yeah, we're capturing the whole of stdout here
<jhass> I guess you gotta use one of stdout and stderr for each function, display and outputting the path and only capture one and leave the other connected to the shell's
<isene> So, we're one step closer - but we're not letting rtfm actually take over the terminal to draw on the screen
<isene> jhass: That reads like hebrew to me
<jhass> maybe it's possible to reopen the shell's pty for "drawing" but that's getting quite complex here
<jhass> well read up on stdin, stdout, stderr and I/O redirection, quite fundamental concepts on UNIX systems
<isene> sure - those are fine - what got me was "only capture one and leave the other connected to the shell's" - But - it seems to be a way... looking at how broot does it, I think I have a path now. Thanks for playing ball.
<jhass> broot seems to use a tmpfile
<jhass> passes it in as an option to avoid the concurrency problems
<semz> "(The first object has an index of 1)." aaaaaaaargh
<isene> jhass: yes
<semz> jhass: Thanks, I don't think I would have noticed that on my own during the trawl through CRuby.
<jhass> semz: fwiw I hope you know what you're doing, I think the Ruby team sees the marshal format largely as something internal :)
<jhass> I would always go for something else to transport data across programs
<semz> The format wasn't my choice unfortunately. The stuff that generates this is pretty old and outdated already, so I think breaking changes are unlikely at least.
<semz> Though outdated software is its own bag of worms of course
<jhass> mh, I see. Bummer
<jhass> I guess you evaluated the route of just having a ruby program (targeting the same ruby version as the source program) transform it into some sane transport format?
<semz> yeah
CustosLimen has quit []
Twemlow has joined #ruby
Twemlow has quit [Client Quit]
postmodern has quit [Quit: Leaving]
TCZ has quit [Quit: Leaving]
dionysus69 has joined #ruby
Nahra has quit [Quit: leaving]
weaksauce has quit [Ping timeout: 258 seconds]
howdoi has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
ChmEarl has joined #ruby
burgestrand has joined #ruby
TCZ has joined #ruby
burgestrand has quit [Quit: burgestrand]
ellcs has joined #ruby
hiroaki has quit [Ping timeout: 246 seconds]
dviola has quit [Ping timeout: 265 seconds]
hiroaki has joined #ruby
markong has quit [Remote host closed the connection]
markong has joined #ruby
FetidToot has quit [Quit: The Lounge - https://thelounge.chat]
FetidToot has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
helpa-bot has joined #ruby
helpa has quit [Remote host closed the connection]
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
dionysus69 has joined #ruby
TCZ has quit [Quit: Leaving]
Rudd0 has joined #ruby
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #ruby
alfiemax has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
adu has joined #ruby
akem has quit [Quit: Leaving]
fuzzface has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
CommunistWolf has quit [Ping timeout: 240 seconds]
CommunistWolf has joined #ruby
adu has quit [Quit: adu]
imode has joined #ruby
ellcs has joined #ruby
Inoperable has quit [Remote host closed the connection]
CustosLimen has joined #ruby
orbyt_ has joined #ruby
Inoperable has joined #ruby
mohsen_in has joined #ruby
mohsen_in has quit [Client Quit]
akem has joined #ruby
impermanence has joined #ruby
weaksauce has joined #ruby
impermanence has quit [Client Quit]
impermanence has joined #ruby
davispuh has joined #ruby
impermanence has quit [Quit: Connection closed]
lucasb has joined #ruby
impermanence has joined #ruby
ellcs has quit [Ping timeout: 244 seconds]
alfiemax has quit [Remote host closed the connection]
cd has joined #ruby
ellcs has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<isene> jhass: Got the problem solved - it's working great now.
alfiemax has joined #ruby
akem has quit [Quit: Leaving]
akem has joined #ruby
akem has quit [Remote host closed the connection]
dviola has joined #ruby
davispuh has quit [Read error: Connection reset by peer]
braincrash has joined #ruby
davispuh has joined #ruby
gr33n7007h has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
cahoots has quit [Quit: leaving]
alfiemax has quit [Ping timeout: 246 seconds]
gr33n7007h is now known as al2o3-cr
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
GankMove has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
akem has joined #ruby
hagabaka has quit [Remote host closed the connection]
hagabaka has joined #ruby
claw23 has quit [Read error: Connection reset by peer]
ur5us has quit [Ping timeout: 244 seconds]
ur5us has joined #ruby
dviola has quit [Quit: WeeChat 2.9]
ellcs has quit [Ping timeout: 240 seconds]
Twemlow has joined #ruby
Twemlow has left #ruby ["Twemlow has now left the arena!"]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hiroaki has quit [Ping timeout: 272 seconds]
ellcs has joined #ruby
Technodrome has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure|dc has joined #ruby
roshanavand has quit [Ping timeout: 246 seconds]
dasher00 has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 240 seconds]
infernix has quit [Quit: ZNC - http://znc.sourceforge.net]
braincrash has quit [Ping timeout: 260 seconds]