Logging + showing status

Hey folks,

Here's a quick and dirty hack I did for Batch so I can use it for one of my projects. It's rather badly coded (I'd have preferred it to be refactored as separate classes, for instance), but I'm just bringing this to your attentions (vs. hoping to be merged in) :)


Cheers, Rico

Logging
-------

You may specify `:log` in the options for `#each`:

``` ruby
    Batch.each Model.all, :log => File.open('foo.log', 'w') do |model|
      # do something with model
    end
```

Or you may specify default options using `Batch.options`:

``` ruby
    Batch.options[:log] = File.open('foo.log', 'w')

    Batch.each(Model.all) do { |model|
      # do something with model
    }
```

This will put all errors into the given log file, and periodically update
it with the status.

Displaying the status
--------------------

Press Ctrl+C to show the status.

    0%  ...........................................................................
    15% ............E.........................E...................^C
    
         11% done (58 of 500)
         Elapsed:   0 seconds
         Remaining: 4 seconds
         Errors:    2
         Press Ctrl+C again to abort.
    
        ...........................................................................
    30% ..........E......E.........................................................

You can disable this behavior with:

    Batch.options[:status_on_interrupt] = false