views:

61

answers:

1

I have a rails app that needs to start a supporting Sinatra web service. I would like to invoke it via a rake task. But I want the Sinatra app to start inside a new terminal (command) window. Yes, I need to see it executing.

# rake task
namespace :daq_controller do
  desc "start the DAQ contoller web service"
  task :start do

    dir = File.expand_path(File.dirname(__FILE__))
    sh "cd #{dir}; rackup daq_controller.rb"
  end
end

Bonus points if it works on *nix and windows

A: 

Linux: gnome-terminal gnome-terminal --command

Bohdan Pohorilets
or --execute CMD ARGSSame as --command above, included for compatibility.
Bohdan Pohorilets