hets.rb revision c34ca181e48d016718223de38106fdfbe8ffc65a
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.
705933deb08bc4269e8c08d50143af3cb5c1c670henning mueller Rails.logger.debug "#{config.path} -o sym.xml -v2 '#{input_file}'"
705933deb08bc4269e8c08d50143af3cb5c1c670henning mueller status = `#{config.path} -o xml -v2 '#{input_file}' 2>&1`
705933deb08bc4269e8c08d50143af3cb5c1c670henning mueller if $?.exitstatus != 0 or status.starts_with? '*** Error'