Method: Documentalist::OpenOffice::Server.kill!

Defined in:
lib/backends/open_office.rb

.kill!Object

Kill running instance



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/backends/open_office.rb', line 92

def self.kill!
  raise "Not running!" unless running?

  begin
    Documentalist.timeout(3) do
      while(running?)
        system("pkill -9 office")
      end
    end
  rescue Timeout::Error
    raise "Mayday, mayday ! Could not kill OpenOffice !!"
  ensure
    # Remove user profile
    system("rm -rf ~/openoffice.org*")
  end
end