Class: Preflight::Rules::CompressionAlgorithms

Inherits:
Object
  • Object
show all
Defined in:
lib/preflight/rules/compression_algorithms.rb

Overview

check a file only uses permitted compression algorithms

Instance Method Summary collapse

Constructor Details

#initialize(*algorithms) ⇒ CompressionAlgorithms

Returns a new instance of CompressionAlgorithms.



10
11
12
# File 'lib/preflight/rules/compression_algorithms.rb', line 10

def initialize(*algorithms)
  @algorithms = algorithms.flatten 
end

Instance Method Details

#messages(ohash) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/preflight/rules/compression_algorithms.rb', line 14

def messages(ohash)
  algorithms = banned_algorithms(ohash)

  if algorithms.size > 0
    ["File uses excluded compression algorithm (#{algorithms.join(", ")})"]
  else
    []
  end
end