Class: QuickStart::Program

Inherits:
Object
  • Object
show all
Defined in:
lib/quick_start/program.rb

Constant Summary collapse

@@map =
{ 
  :firefox => '/usr/bin/firefox', 
  :evolution => '/usr/bin/evolution',
  :skype => '/usr/bin/skype',
  :terminal => '/usr/bin/gnome-terminal'
}

Class Method Summary collapse

Class Method Details

.mapObject



13
14
15
# File 'lib/quick_start/program.rb', line 13

def map
  @@map
end

.run(name) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/quick_start/program.rb', line 17

def run( name )
  puts "running #{name} #{@@map[name.to_sym]}"
  pid = Kernel.fork do
    exec( @@map[name.to_sym] )
  end
  Process.detach(pid)
end