Method: LegacyFacter::Util::Parser.extension_matches?

Defined in:
lib/facter/custom_facts/util/parser.rb

.extension_matches?(filename, ext) ⇒ Boolean

For support mutliple extensions you can pass an array of extensions as ext.

Returns:

  • (Boolean)


17
18
19
20
21
22
23
24
25
# File 'lib/facter/custom_facts/util/parser.rb', line 17

def self.extension_matches?(filename, ext)
  extension = case ext
              when String
                ext.downcase
              when Enumerable
                ext.collect(&:downcase)
              end
  [extension].flatten.to_a.include?(file_extension(filename).downcase)
end