hets.rb revision 574a02d837d442144fe066284dfed20e43a42053
58721b9d3a8cd6a624269ddf507f80af4417c9bdhenning mueller yaml = YAML.load_file(File.join(Rails.root, 'config', 'hets.yml'))
58721b9d3a8cd6a624269ddf507f80af4417c9bdhenning mueller @path = first_which_exists yaml['hets_path']
e062724b7bdbbe8c1ddfbc7f3bb5bdb6e129d82cDaniel Vale raise HetsError, 'Could not find hets' unless @path
e062724b7bdbbe8c1ddfbc7f3bb5bdb6e129d82cDaniel Vale raise ArgumentError, "Your version of hets is too old" if version.include?("2011")
58721b9d3a8cd6a624269ddf507f80af4417c9bdhenning mueller ENV[key.upcase] = first_which_exists value if key != 'hets_path'
58721b9d3a8cd6a624269ddf507f80af4417c9bdhenning mueller # Runs hets with input_file and returns XML output file path.
58721b9d3a8cd6a624269ddf507f80af4417c9bdhenning mueller def self.parse(input_file, output_path = '')
c34ca181e48d016718223de38106fdfbe8ffc65aDaniel Couto Vale output_path = "-O \"#{output_path}\"" unless output_path.blank?
c34ca181e48d016718223de38106fdfbe8ffc65aDaniel Couto Vale command = "#{config.path} -o xml -v2 #{output_path} '#{input_file}' 2>&1"
7ea9649883e1bbe8f2582db1a3c66af8b7206056henning mueller # nice runs the process with lower scheduling priority