test/spec/lib/collins_integration.rb
def reloadMySQL
    
    dump_file = "collins_fixture.dump"
    dump_zip = dump_file + ".gz"

    full_dump_path = @collinsPath + "/test/spec/#{dump_file}"
    d = File.dirname full_dump_path

    if ! File.exists? full_dump_path
      full_zip_path = full_dump_path + ".gz"
      if ! File.exists? full_zip_path
        system "cd #{d};git checkout #{dump_zip}"
        if ! File.exists? full_zip_path
          Output.error "Unable to find database dump #{dump_zip}"
          exit(1)
        end
      end
      system "cd #{d}; gunzip -c #{dump_zip} > #{full_dump_path}"

      if ! File.exists? dump_file
        Output.error "Error inflating dump file #{dump_zip}"
        exit(1)
      end
    end

    Output.info "Importing #{dump_file} to database #{@database}"
    upString = "-u #{@mysqlUser}"
    if @mysqlPass != nil
      upString += " -p#{@mysqlPass}"
    end
    out = system "cd #{d}; #{@mysqlCommand} #{upString} #{@database} < #{dump_file}"
    if ! out
      Output.error "Error with import: #{out}"
      exit(1)
    end
  end
#loads the specified sql dump into database
loads the specified sql dump into database
loads the specified sql dump into database
def reloadMySQL
    dump_file = "collins_fixture.dump"
    dump_zip = dump_file + ".gz"
    full_dump_path = @collinsPath + "/test/spec/#{dump_file}"
    d = File.dirname full_dump_path
    if ! File.exists? full_dump_path
      full_zip_path = full_dump_path + ".gz"
      if ! File.exists? full_zip_path
        system "cd #{d};git checkout #{dump_zip}"
        if ! File.exists? full_zip_path
          Output.error "Unable to find database dump #{dump_zip}"
          exit(1)
        end
      end
      system "cd #{d}; gunzip -c #{dump_zip} > #{full_dump_path}"
      if ! File.exists? dump_file
        Output.error "Error inflating dump file #{dump_zip}"
        exit(1)
      end
    end
    Output.info "Importing #{dump_file} to database #{@database}"
    upString = "-u #{@mysqlUser}"
    if @mysqlPass != nil
      upString += " -p#{@mysqlPass}"
    end
    out = system "cd #{d}; #{@mysqlCommand} #{upString} #{@database} < #{dump_file}"
    if ! out
      Output.error "Error with import: #{out}"
      exit(1)
    end
  end
def reloadMySQL dump_file = "collins_fixture.dump" dump_zip = dump_file + ".gz" full_dump_path = @collinsPath + "/test/spec/#{dump_file}" d = File . dirname full_dump_path if ! File . exists? full_dump_path full_zip_path = full_dump_path + ".gz" if ! File . exists? full_zip_path system "cd #{d};git checkout #{dump_zip}" if ! File . exists? full_zip_path Output . error "Unable to find database dump #{dump_zip}" exit ( 1 ) end end system "cd #{d}; gunzip -c #{dump_zip} > #{full_dump_path}" if ! File . exists? dump_file Output . error "Error inflating dump file #{dump_zip}" exit ( 1 ) end end Output . info "Importing #{dump_file} to database #{@database}" upString = "-u #{@mysqlUser}" if @mysqlPass != nil upString += " -p#{@mysqlPass}" end out = system "cd #{d}; #{@mysqlCommand} #{upString} #{@database} < #{dump_file}" if ! out Output . error "Error with import: #{out}" exit ( 1 ) end end
loads the specified sql dump into database
loads the specified sql dump into database