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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Straaten, Onno van der (Guest)
on 2006-01-24 11:21
(Received via mailing list)
Yes, sorry that is relevant.
On windows platform I want to call a command line tool and read the
output.

Onno
NexusNeo - Niket P. (Guest)
on 2006-01-24 11:30
(Received via mailing list)
>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
Johan Sörensen (Guest)
on 2006-01-24 11:45
(Received via mailing list)
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
This topic is locked and can not be replied to.