Created
January 30, 2012 21:28
-
-
Save headius/1706818 to your computer and use it in GitHub Desktop.
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
require 'tempfile' | |
file = Tempfile.new(['','blah']) | |
file.open | |
file.write "marker lorem\n" | |
file.close | |
line = File.read(file.path) | |
line.sub!(/marker.*$/,'') | |
line.strip! | |
p line | |
END { | |
`rm file.path` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment