Skip to content

Instantly share code, notes, and snippets.

@sorah
Forked from raa0121/foooo.rb
Created July 7, 2012 17:49
Show Gist options
  • Save sorah/3067432 to your computer and use it in GitHub Desktop.
Save sorah/3067432 to your computer and use it in GitHub Desktop.
FooooScriptインタプリタっぽいもの
#/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