retrography
5/8/2014 - 6:13 PM

This is the shortest way of opening a text file in Ruby and transferring its whole content to a single string variable.

This is the shortest way of opening a text file in Ruby and transferring its whole content to a single string variable.

#!/usr/bin/env ruby

s = IO.read(ARGV.first)

puts s