###  kujira自動送信メールを送るために本文を作成している
###  2012.12.24   k.ohno



def crccheck(name  , outf)

	result = open("| ./crc32.exe " + name)
  while !result.eof
    text = result.gets
    outf.puts( text )
  end
  result.close

end


PACKFILENAME = ARGV[0]
GAMEFILENAME1 = ARGV[1]
GAMEFILENAME2 = ARGV[2]

outputFile  = File.open( "body.txt", "w" )

outputFile.puts("Software Upload Notification")
outputFile.puts("If you have any problems, please contact this e-mali address：")
outputFile.puts("ml-kujira-ROM@nintendo.co.jp")
outputFile.puts("************************************************************")
outputFile.puts("GAME INFORMATION:")
outputFile.puts("************************************************************")
outputFile.puts("Game Title: kujira")
outputFile.puts("System:     CTR")
outputFile.puts("")
outputFile.puts("************************************************************")
outputFile.puts("POST LOCATION:")
outputFile.puts("************************************************************")
outputFile.puts("Server Name:  ftp://10.114.10.22")
outputFile.puts("Directory:    /rom/kujira/auto")
outputFile.puts("")
outputFile.puts("************************************************************")
outputFile.puts("FILE INFORMATION:")
outputFile.puts("************************************************************")
outputFile.puts("Compressed File Name: " + PACKFILENAME)
outputFile.puts("Password: password")
outputFile.puts("Game File Name:")
outputFile.puts(GAMEFILENAME1)
outputFile.puts(GAMEFILENAME2)
outputFile.puts("CRC:")

crccheck(GAMEFILENAME1, outputFile)
outputFile.puts( " : " + GAMEFILENAME1)

crccheck(GAMEFILENAME2, outputFile)
outputFile.puts( " : " + GAMEFILENAME2)


outputFile.puts("ROM Size: 2G Bytes")
outputFile.puts("CTR FLASH CARD: CARD2 (F CARD)")
outputFile.puts("CTR SUB CARD: none")
outputFile.puts("Firmware Version: 0.19.4   r52145")
outputFile.puts("Intended Purpose: Release")
outputFile.puts("")
outputFile.puts("************************************************************")

inf1 = File.open( "kujira.txt", "r" )
inf1.each {|linestr|
  outputFile.puts(linestr)
}
inf1.close

outputFile.close

