_docker/lib/export/export_inspector.rb
#
# Inspects the export to see if everything is there as expected.
#
Inspects the export to see if everything is there as expected.
Inspects the export to see if everything is there as expected .
def inspect_export(url_list, export_directory)
    puts '================================ EXPORT SUMMARY ================================'
    total_pages = 0
    missing_pages = 0
    File.open(url_list,'r') do | file |
      file.each_line do | line |
        url = line.strip
        expected_file_system_path = determine_expected_filesystem_path(url)
        exists = check_if_path_exists(url, expected_file_system_path, export_directory)
        total_pages += 1
        unless exists
          missing_pages += 1
        end
      end
    end
    if missing_pages > 0
      puts "WARNING: Of '#{total_pages}' pages, '#{missing_pages}' are not found in the export."
      if should_fail_on_missing_content
        raise StandardError.new("There are '#{missing_pages}' pages missing from the site export (see warnings for missing content). Failing export process.")
      end
    end
  end
def inspect_export ( url_list , export_directory ) puts '================================ EXPORT SUMMARY ================================' total_pages = 0 missing_pages = 0 File . open ( url_list , 'r' ) do | file | file . each_line do | line | url = line . strip expected_file_system_path = determine_expected_filesystem_path ( url ) exists = check_if_path_exists ( url , expected_file_system_path , export_directory ) total_pages += 1 unless exists missing_pages += 1 end end end if missing_pages > 0 puts "WARNING: Of '#{total_pages}' pages, '#{missing_pages}' are not found in the export." if should_fail_on_missing_content raise StandardError . new ( "There are '#{missing_pages}' pages missing from the site export (see warnings for missing content). Failing export process." ) end end end
Inspects the export to see if everything is there as expected.
Inspects the export to see if everything is there as expected .
url_list
<not_specific>
export_directory
<not_specific>