Background option like script/server -d has

D

Daniel Waite

Hi. I'm curious to know how I can type something like the following:

$ ruby my_program.rb

Press enter, and gain immediate control of the terminal again, as
happens when you supply the -d option when running the script/server
command from inside a Rails app.

Any ideas?
 
S

Saji N. Hameed

* Daniel Waite said:
Hi. I'm curious to know how I can type something like the following:

$ ruby my_program.rb

Press enter, and gain immediate control of the terminal again, as
happens when you supply the -d option when running the script/server
command from inside a Rails app.

Any ideas?

The 'daemons' library may help
http://rubyforge.org/projects/daemons/

require 'daemons'
Daemons.run_proc('a string for identifier') do
...your code
end

saji

--
Saji N. Hameed

APEC Climate Center +82 51 668 7470
National Pension Corporation Busan Building 12F
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 (e-mail address removed)
KOREA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,196
Messages
2,571,036
Members
47,631
Latest member
kukuh

Latest Threads

Top