All Projects → dtaniwaki → paperclip-deflater

dtaniwaki / paperclip-deflater

Licence: MIT license
Deflate Processor for Paperclip

Programming Languages

ruby
36898 projects - #4 most used programming language

paperclip-deflater

Gem Version Dependency Status Build Status Coverage Status Code Climate

Deflate files in Paperclip before upload.

Installation

Add the paperclip-deflater gem to your Gemfile.

gem "paperclip-deflater"

And run bundle install.

Setup

class Something < ActiveRecord::Base
  has_attached_file :js,
    styles: {
      gzip: {
        processors: [:gzip],
        format: 'js.gz',
        s3_headers: { content_type: 'application/javascript', content_encoding: 'gzip' },
      }
    },
    path: "test/:id.:extension"
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright

Copyright (c) 2014 Daisuke Taniwaki. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].