Class: Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/documenter/ooo/converter.rb

Constant Summary collapse

@@initialized =
false

Class Method Summary collapse

Class Method Details

.convert(from, to) ⇒ Object



20
21
22
23
# File 'lib/documenter/ooo/converter.rb', line 20

def self.convert from, to 
  init if !@@initialized 
  system("java -jar #{File.dirname(__FILE__)}/jod/lib/jodconverter-cli-2.2.2.jar #{from} #{to}")
end

.initObject



12
13
14
15
16
17
# File 'lib/documenter/ooo/converter.rb', line 12

def self.init
  ooo = office_path
  system('"'+ooo+' " -headless -accept="socket,port=8100;urp;"')  
  @@initialized = true
  #todo - check if already running
end

.office_pathObject



4
5
6
7
8
# File 'lib/documenter/ooo/converter.rb', line 4

def self.office_path
  'c:\Program Files\OpenOffice.org 3\program\soffice.exe'
  #todo - search for installed
  #todo - check for small portable version
end