Introduction
Dragonfly is great for on the fly image processing in your Ruby or Rails application. Being an awesomely extensible software, dragonfly has a very clean and simple API for implemeting custom data stores. There are data stores for Dragonfly that write to S3, MongoDB and CouchDB. There is an old project that provides a cloudinary based datastore for dragonfly. But that project is not actively maintained and it doesn't work with the latest dragonfly interface for read, write and destory.
So I created this gem which supports the latest dragonfly interface.
Usage
If using Cloudinary on Heroku, the config is read automatically from CLOUDINARY_URL environment variable. Else, just download your cloudinary.yml file and place it in your config directory.
Then in your dragonfly initializer, declare cloudinary as the data store with the following line.
app.datastore = Dragonfly::CloudinaryDatastore.new
With PushType CMS
PushType is a cool CMS for rails. If you want to use cloudinary for storing media in your PushType based application, read ahead. You will specially need it if you want to run your PushType application on Heroku.
In the config/initializers/push_type.rb
file, comment the line that configures :file
datastore and add
the line config.dragonfly_datastore = Dragonfly::CloudinaryDatastore.new
TODO
- Add some tests
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request