jnicklas/carrierwave — pull request #726 by chopmo (2012-04-28 05:14:38+00:00)
Title: Add :write option to manipulate!. Issue #711.

Options for the RMagick `#write` call can now be added to the options under the `:write` key. Since the `#write` call takes a block containing assignments, these options are translated to a lambda.

Also, the options argument is now yielded to the block, allowing it to be updated based on the image object (eg. change interlace option only if necessary).

Example:

manipulate! do |img, index, options|
options[:write] = {
:quality => 50,
:depth => 8
}
img
end

is translated to

image.write do |img|
self.quality = 50
self.depth = 8
end

By the way I apologize for the ugly stubbing in the spec. I didn't see how else to test this without factoring out `::Magick` from `CW::RMagick`.