Created
January 21, 2012 22:04
-
-
Save gallamine/1654216 to your computer and use it in GitHub Desktop.
ruby script to open file and do shiznit
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
def self.options(filepath) | |
opts = {} | |
filepath = filepath.split.join("\n") | |
begin | |
File.open(filepath, "r") do |file| | |
# do stuff | |
end | |
rescue Errno::ENOENT | |
puts "no such file -#{filepath}-" | |
end | |
opts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment