Module: Omnibus::Compressor
- Includes:
- Logging
- Defined in:
- lib/omnibus/compressor.rb
Defined Under Namespace
Class Method Summary collapse
-
.for_current_system(compressors) ⇒ ~Compressor::Base
Determine the best compressor for the current system.
Methods included from Logging
Class Method Details
.for_current_system(compressors) ⇒ ~Compressor::Base
Determine the best compressor for the current system. This method returns the class, not an instance of the class.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/omnibus/compressor.rb', line 38 def for_current_system(compressors) family = Ohai["platform_family"] if family == "mac_os_x" if compressors.include?(:dmg) return DMG end if compressors.include?(:tgz) return TGZ end end if compressors.include?(:tgz) TGZ else log.info(log_key) { "No compressor defined for `#{family}'." } Null end end |