-
-
Save sorah/3067432 to your computer and use it in GitHub Desktop.
FooooScriptインタプリタっぽいもの
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 | |
# coding: utf-8 | |
# ^ coding: is correct | |
def foooo | |
File.open(ARGV[0]){|f| | |
f.each do |line| | |
# Don't use "unless-else-end" | |
if /fo+/i =~ line | |
print "foooo" | |
else | |
# should be abort? | |
abort "Error" | |
end | |
end | |
puts # use puts with no argument to return | |
} | |
end | |
foooo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment