Created
May 8, 2014 18:13
-
-
Save retrography/00c73ca458f5f8bc6b54 to your computer and use it in GitHub Desktop.
This is the shortest way of opening a text file in Ruby and transferring its whole content to a single string variable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
s = IO.read(ARGV.first) | |
puts s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment