frozon / passbook

Passbook gem let's you create pkpass for passbook iOS 6
MIT License
234 stars 66 forks source link

Multiple Compressor support #43

Open frozon opened 10 years ago

frozon commented 10 years ago

Ok, here is an implementation in order to support multiple compressor.

To add a new one, juste create another compressor with this skeleton:

require 'passbook/compressors/base'

module Passbook
  module Compressor

    class COMPRESSOR_NAME < Base

      ###
      # Human-readable name of the compressors
      #
      def name
        "COMPRESSOR_NAME"
      end

      ###
      # Output zip string
      #
      def outputZip pass, files, manifest, signature
        # Your compression process
      end

    end

  end
end

Do not forget to run tests and add the compressor name to all_compressors in lib/passbook/compressor.rb