W
Wes Gamble
All,
I would like to capture the entire contents of a file in to a string (a
la Perl) - is this the best way to do it?
File.open(@document.path, r) do |f|
@lines = f.readlines
html = @lines.join
end
so that the html variable has all of the contents of f.
Is there a better/easier way?
Thanks,
Wes
I would like to capture the entire contents of a file in to a string (a
la Perl) - is this the best way to do it?
File.open(@document.path, r) do |f|
@lines = f.readlines
html = @lines.join
end
so that the html variable has all of the contents of f.
Is there a better/easier way?
Thanks,
Wes