Created
May 3, 2012 02:23
-
-
Save sycobuny/2582596 to your computer and use it in GitHub Desktop.
Simple parsing script for Justin
This file contains hidden or 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 event(queuename, *nums) | |
puts "Got event for #{queuename}!" | |
puts " nums: #{nums.join(', ')}" | |
end | |
begin | |
while line = $stdin.readline | |
args = line.chomp.split(/\s+/) | |
1.upto(args.length - 1) { |x| args[x] = args[x].to_i } | |
if args[1] > (args[-1] - 5) | |
event(*args) | |
end | |
end | |
rescue EOFError => e | |
# reached end of processing, time to go away quietly. | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment