外部テキスト"YAML(ヤムル)"を使う# data.ymlを1行ずつ読み込んで、出力 require 'yaml' data = YAML.load(File.new('data.yml')) data.each do |fruit| puts fruit end