Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 0.75 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. inserter=GenericInserter.new( OPTS[:servers], OPTS[:port], OPTS[:debug] )
  2. distiller=Distiller.new( inserter.id, OPTS )
  3. differ=Differ.new( OPTS[:template], OPTS[:crashfile] )
  4.  
  5. differ.each_change {|change|
  6.     data=distiller.apply_change( change )
  7.     pdu={
  8.         'command'=>COMMAND,
  9.         'extension'=>EXTENSION,
  10.         'data'=>data,
  11.         'output_tube'=>'', # bot will not send beanstalk output
  12.         'delivery_options'=>{}
  13.     }
  14.     inserter.insert( pdu )
  15.     classification=distiller.classify_change( distiller.next_result )
  16.     unless classification=='N'
  17.         # Some kind of trigger - revert this change!
  18.         distiller.revert_last_change( classification )
  19.     end
  20. }
  21. puts "Results:"
  22. distiller.reverted.each {|change| p change}