So, I'm doing a little app: a gui front end for ri.
I thought this would be so simple (yet useful) as to be twenty minutes work.
Well, yes and no.
It seems like the `ri -T ....` (the backquotes) or %x{ri -T....} aren't
working inside the App block.
I guess the first question to ask is, would the App block mess with a Kernel
method doing a system call?
IMO, Shoes is a little hard to grasp when you get to OS specific behaviors. Sometimes it's not Ruby and only looks like Ruby. Catching a voluminous stdout from a pipe into a variable didn't work for me. Might be a timeout or a buffer flushing. Try something simple like `date` and see what you get for status and end of line codes (if any). I vaguely remember having this problem when calling external commands/scripts. I resorted to writing tmp files from stdout and then reading them. It's also possible that 'ri' is not in the path that Shoes executes in. No solutions, Just hints. --Cecil On Sat, 2010-05-22 at 00:21 -0500, Patrick Smith wrote: > So, I'm doing a little app: a gui front end for ri. > > I thought this would be so simple (yet useful) as to be twenty minutes > work. Well, yes and no. > > > It seems like the `ri -T ....` (the backquotes) or %x{ri -T....} > aren't working inside the App block. > I guess the first question to ask is, would the App block mess with a > Kernel method doing a system call?
Hi Patrick and Cecil, I confirmed the following snippet on my Windows XP laptop with Shoes-0.r1421. Shoes.app do `ri -T Array#zip > ri_output.txt` para IO.read 'ri_output.txt' end When I used "ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mswin32]", it worked well. But when I used "ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]", it didn't (nothing was appeared on the Shoes app window). Umm.... I think this is not Shoes issue but my environment issue, though... BTW. The following snippet doesn't work. Because Shoes doesn't include ri data files. require 'rdoc/ri/driver' Shoes.app do s = RDoc::RI::Driver.run(['zip']) para s end If you copy c:\ruby\share\ri data files to the right place in Shoes directory, it might work well. I've never confirm, though. :-P Cheers, ashbb
This was my first app, btw. Well, first non-trivial app. Something simple... If, as Angela indicated, "system" works, then I can have it send a command that dumps the ri output to a temp file, and have a para display the contents of the file. I'll let you know.... There goes my Saturday. Patrick On Sat, May 22, 2010 at 4:38 AM, ashbb <ashbbb@gmail.com> wrote: > Hi Patrick and Cecil, > > I confirmed the following snippet on my Windows XP laptop with > Shoes-0.r1421. > > Shoes.app do > `ri -T Array#zip > ri_output.txt` > para IO.read 'ri_output.txt' > end > > When I used "ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mswin32]", it > worked well. > But when I used "ruby 1.9.1p243 (2009-07-16 revision 24175) > [i386-mingw32]", it didn't (nothing was appeared on the Shoes app window). > > Umm.... I think this is not Shoes issue but my environment issue, though... > > BTW. The following snippet doesn't work. Because Shoes doesn't include ri > data files. > > require 'rdoc/ri/driver' > Shoes.app do > s = RDoc::RI::Driver.run(['zip']) > para s > end > > If you copy c:\ruby\share\ri data files to the right place in Shoes > directory, it might work well. I've never confirm, though. :-P > > Cheers, > ashbb > -- Chapak Patrick Smith
It lives! Needs some serious upgrades to functionality (like a search or at least index function) but... IT LIVES! On Sat, May 22, 2010 at 11:51 AM, Patrick Smith <chapak@gmail.com> wrote: > This was my first app, btw. Well, first non-trivial app. Something > simple... > > If, as Angela indicated, "system" works, then I can have it send a command > that dumps the ri output to a temp file, and have a para display the > contents of the file. I'll let you know.... > > There goes my Saturday. > Patrick > > On Sat, May 22, 2010 at 4:38 AM, ashbb <ashbbb@gmail.com> wrote: > >> Hi Patrick and Cecil, >> >> I confirmed the following snippet on my Windows XP laptop with >> Shoes-0.r1421. >> >> Shoes.app do >> `ri -T Array#zip > ri_output.txt` >> para IO.read 'ri_output.txt' >> end >> >> When I used "ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-mswin32]", >> it worked well. >> But when I used "ruby 1.9.1p243 (2009-07-16 revision 24175) >> [i386-mingw32]", it didn't (nothing was appeared on the Shoes app window). >> >> Umm.... I think this is not Shoes issue but my environment issue, >> though... >> >> BTW. The following snippet doesn't work. Because Shoes doesn't include ri >> data files. >> >> require 'rdoc/ri/driver' >> Shoes.app do >> s = RDoc::RI::Driver.run(['zip']) >> para s >> end >> >> If you copy c:\ruby\share\ri data files to the right place in Shoes >> directory, it might work well. I've never confirm, though. :-P >> >> Cheers, >> ashbb >> > > > > -- > > Chapak Patrick Smith > -- Chapak Patrick Smith