Read files in Ruby
Tagged with
Ruby
Language: Ruby
View as text
# load a file into a string
def get_file_as_string(filename)
data = ''
File.open(filename, "r") { |f|
data = f.read
}
return data
end
