[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to run a terminal command from a Ruby app?

Victor Martin

5/21/2009 9:28:00 AM

Hi there.

I'm using Ruby and the great Processing implementation made for Ruby
(http://github.com/jashkenas/ruby-proces...). The "problem" is
that if you need to run anything of Ruby-Processing, you need to write:

#rp5 run app.rb

Instead of #ruby app.rb

So, what I need is executing the "rp5 run" command from another ruby
application, since I'm generating the Processing document in another
Ruby app which does not use Ruby-Processing.

I'm running Ruby from Mac Os X. Any idea?
--
Posted via http://www.ruby-....

3 Answers

Brian Candler

5/21/2009 9:49:00 AM

0

system("rp5 run foo")
--
Posted via http://www.ruby-....

Kyle Schmitt

5/21/2009 1:46:00 PM

0

On Thu, May 21, 2009 at 4:49 AM, Brian Candler <b.candler@pobox.com> wrote:
> system("rp5 run foo")
or, if you need the output what you ran,
foo=%x{rp5 run foo}
# note, you can use most paired symbols, like () [] <>, or quotes "" '',
#with %x, not just {}

--Kyle

Victor Martin

5/22/2009 3:36:00 PM

0

thanks! it worked perfect with "system("rp5 run foo")

--
Posted via http://www.ruby-....