Created
February 4, 2009 14:34
-
-
Save tomlea/58125 to your computer and use it in GitHub Desktop.
Bean Bandit: Puts beanz on ze queue.
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
| #!/usr/bin/env ruby | |
| require "rubygems" | |
| gem "beanstalk-client" | |
| require "beanstalk-client" | |
| port = ARGV.last or raise "GIVE ME A PORT NEXT TIME!" | |
| beanstalk = Beanstalk::Pool.new(["0.0.0.0:#{port}"]) | |
| puts "Hey gringo!¡?¿" | |
| puts "I'll throw some beanz around, just giz me ze YAML¡ Ce¿" | |
| puts "End your YAML with a dot or the deals off!¡! ce?¿" | |
| yaml = "" | |
| while line = STDIN.gets and line !~ /^.$/ | |
| yaml += line | |
| end | |
| beanstalk.put(yaml) | |
| puts "So longs and thankz for all zeé beanz?¿?" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment