Class: Omnizip::Profile::BinaryProfile
- Inherits:
-
CompressionProfile
- Object
- CompressionProfile
- Omnizip::Profile::BinaryProfile
- Defined in:
- lib/omnizip/profile/binary_profile.rb
Overview
Binary compression profile
Optimized for compressing executable files. Uses LZMA2 with BCJ filters to improve compression of executables.
Instance Attribute Summary
Attributes inherited from CompressionProfile
#algorithm, #description, #filter, #level, #name, #solid
Instance Method Summary collapse
-
#initialize ⇒ BinaryProfile
constructor
Initialize binary profile.
-
#suitable_for?(mime_type) ⇒ Boolean
Check if this profile is suitable for a MIME type.
Methods inherited from CompressionProfile
#apply_to, #inspect, #to_h, #to_s
Constructor Details
#initialize ⇒ BinaryProfile
Initialize binary profile
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/omnizip/profile/binary_profile.rb', line 11 def initialize super( name: :binary, algorithm: :lzma2, level: 6, filter: :bcj_x86, solid: false, description: "Optimized for executables" ) end |
Instance Method Details
#suitable_for?(mime_type) ⇒ Boolean
Check if this profile is suitable for a MIME type
26 27 28 29 30 |
# File 'lib/omnizip/profile/binary_profile.rb', line 26 def suitable_for?(mime_type) return true unless mime_type FileType::MimeClassifier.executable?(mime_type) end |