不确定这里发生了什么,或者在这种情况下可能是整数。这是代码:
def build_array_from_file(filename)
contents = []
File.read(File.expand_path('lib/project_euler/' + filename), 'r') do |file|
while line = file.get
contents << line
end
end
contents
end
文件名是一个字符串,我已经检查以确保路径有效。
有什么想法吗?谢谢。