RE: Re: Looking for a Ruby, ROR code sample or info


#1

Yes, sorry that is relevant.
On windows platform I want to call a command line tool and read the
output.

Onno


#2

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 removed_email_address@domain.invalid
wrote:

[mailto:removed_email_address@domain.invalid] 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: removed_email_address@domain.invalid
Web: www.nexusneo.com


#3

Hi,

On 1/24/06, Straaten, Onno van der removed_email_address@domain.invalid
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