RE: 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

irb
to access ruby prompt
ruby /script/command
from your rails project directory to access rails object from command
line.

On 1/24/06, Straaten, Onno van der [email protected]
wrote:

[mailto:[email protected]] On Behalf Of Mikkel B.

Hi all,

ā€“
Best Regards,
Niket P.
For NexusNeo Exim
(A Div of NexusNeo System & Exim Pvt. Ltd)
Tel: +91 79 23244557
Fax: +91 79 23246531
E-mail: [email protected]
Web: www.nexusneo.com

Hi,

On 1/24/06, Straaten, Onno van der [email protected]
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