Straaten, Onno van der
2006-Jan-24 09:05 UTC
[Rails] Looking for a Ruby, ROR code sample or info
Hi all, I am looking for a code sample that shows how to execute a host-command using Ruby or ROR and then read the output. Thanks, Onno This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060124/44a237e8/attachment.html
Mikkel Bruun
2006-Jan-24 09:14 UTC
[Rails] Re: Looking for a Ruby, ROR code sample or info
What kind of host are we talking about?? And what kind of command?? Mikkel Straaten, Onno van der wrote:> Hi all, > > I am looking for a code sample that shows how to execute a host-command > using Ruby or ROR and then read the output. > > Thanks, > > Onno > > > > > > This e-mail and any attachment is for authorised use by the intended > recipient(s) only. It may contain proprietary material, confidential > information and/or be subject to legal privilege. It should not be > copied, disclosed to, retained or used by, any other party. If you are > not an intended recipient then please promptly delete this e-mail and > any attachment and all copies and inform the sender. Thank you.-- Posted via http://www.ruby-forum.com/.
Straaten, Onno van der
2006-Jan-24 09:18 UTC
[Rails] Re: Looking for a Ruby, ROR code sample or info
Yes, sorry that is relevant. On windows platform I want to call a command line tool and read the output. Onno -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Mikkel Bruun Sent: dinsdag 24 januari 2006 10:13 To: rails@lists.rubyonrails.org Subject: [Rails] Re: Looking for a Ruby, ROR code sample or info What kind of host are we talking about?? And what kind of command?? Mikkel Straaten, Onno van der wrote:> Hi all, > > I am looking for a code sample that shows how to execute ahost-command> using Ruby or ROR and then read the output. > > Thanks, > > Onno > > > > > > This e-mail and any attachment is for authorised use by the intended > recipient(s) only. It may contain proprietary material, confidential > information and/or be subject to legal privilege. It should not be > copied, disclosed to, retained or used by, any other party. If you are> not an intended recipient then please promptly delete this e-mail and > any attachment and all copies and inform the sender. Thank you.-- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
NexusNeo - Niket Patel
2006-Jan-24 09:29 UTC
[Rails] Re: Looking for a Ruby, ROR code sample or info
>irbto access ruby prompt>ruby /script/commandfrom your rails project directory to access rails object from command line. On 1/24/06, Straaten, Onno van der <onno.van.der.straaten@logicacmg.com> wrote:> > Yes, sorry that is relevant. > On windows platform I want to call a command line tool and read the > output. > > Onno > > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Mikkel Bruun > Sent: dinsdag 24 januari 2006 10:13 > To: rails@lists.rubyonrails.org > Subject: [Rails] Re: Looking for a Ruby, ROR code sample or info > > > What kind of host are we talking about?? And what kind of command?? > > Mikkel > > Straaten, Onno van der wrote: > > Hi all, > > > > I am looking for a code sample that shows how to execute a > host-command > > using Ruby or ROR and then read the output. > > > > Thanks, > > > > Onno > > > > > > > > > > > > This e-mail and any attachment is for authorised use by the intended > > recipient(s) only. It may contain proprietary material, confidential > > information and/or be subject to legal privilege. It should not be > > copied, disclosed to, retained or used by, any other party. If you are > > > not an intended recipient then please promptly delete this e-mail and > > any attachment and all copies and inform the sender. Thank you. > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Best Regards, Niket Patel For NexusNeo Exim (A Div of NexusNeo System & Exim Pvt. Ltd) Tel: +91 79 23244557 Fax: +91 79 23246531 E-mail: info@nexusneo.com Web: www.nexusneo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060124/efd73912/attachment-0001.html
Johan Sörensen
2006-Jan-24 09:43 UTC
[Rails] Re: Looking for a Ruby, ROR code sample or info
Hi, On 1/24/06, Straaten, Onno van der <onno.van.der.straaten@logicacmg.com> wrote:> Yes, sorry that is relevant. > On windows platform I want to call a command line tool and read the > output.use ` irb(main):001:0> `df -h`.grep /disk0s3/ => ["/dev/disk0s3 81G 72G 8.0G 90% /\n"] $ ri Kernel#\` --------------------------------------------------------------- Kernel#` `cmd` => string ------------------------------------------------------------------------ Returns the standard output of running _cmd_ in a subshell. The built-in syntax +%x{...}+ uses this method. Sets +$?+ to the process status. `date` #=> "Wed Apr 9 08:56:30 CDT 2003\n" `ls testdir`.split[1] #=> "main.rb" `echo oops && exit 99` #=> "oops\n" $?.exitstatus #=> 99 also see `ri popen` and http://www.ruby-doc.org/stdlib/libdoc/open3/rdoc/ cheers, JS -- http://johansorensen.com http://theexciter.com