ruby版完成

ほとんど何とかPython版完成 - しんちゃんの日記pythonのコードそのまんま。

ARGV.each do |arg|
	puts arg
	content = open(arg).read
	words = content.split()
	chars = ""
	words.each do |word|
		chars += word
		chars += " "
	end
	lines = content.split("\n")
	print "chars = ", chars.length - 1 , " words = ", words.size ," length = ", lines.size
	puts "\n" * 2
end

rubyのsplitは""で囲まないとまともに機能しないのね・・・
pythonでは文字だけど、rubyじゃ文字列なのね・・・
さあ、明日の昼までには各言語の比較ベンチマーク結果をアップします。