How can I convert an ImageMagick shell script for use in my RoR project?

I'm creating a project that lets users upload images onto products and then buy the products. I'm using Carrierwave and Minimagick. I found this cylnderize script on fmwconcepts. It's a shell script. It is literally perfect for what I need as a lot of the products are mugs. Does anyone know how I might be able to convert the script into minimagick code I can use in my controller?

Hello Eric, I hope this is the one you need:

system <<-COMMAND

convert image.png -monochrome -format png -density 300 another_image.png

COMMAND

Lol that doesn't wrap an image around a cylinder thanks though

Here's just one of the many examples out there of how to code a plugin for CarrierWave:

http://www.freezzo.com/2010/12/23/create-ffmpeg-processor-for-carrierwave-in-rails-3/

Personally, I find the tooling around Paperclip to be a lot more hackable in this regard. The thumbnail processor can be duplicated in place, modified with different command-line arguments, and used as a different "style" in the collection. It helps that Paperclip does their own thumbnail as a plug-in, so you're on a par with the core functionality.

Walter