Sha256: dbc57777ed98fe6dbfe08c8a7a7c40beab2adf04a7c6cfc249c442eeb8547cc9

Contents?: true

Size: 690 Bytes

Versions: 8

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Macosx
      class Filesystems < BaseResolver
        # :macosx_filesystems
        @fact_list ||= {}

        class << self
          private

          def post_resolve(fact_name)
            @fact_list.fetch(fact_name) { read_filesystems(fact_name) }
          end

          def read_filesystems(fact_name)
            output = Facter::Core::Execution.execute('mount', logger: log)
            filesystems = output.scan(/\(([a-z]+)\,*/).flatten
            @fact_list[:macosx_filesystems] = filesystems.uniq.sort.join(',')
            @fact_list[fact_name]
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
facter-4.0.44 lib/facter/resolvers/macosx/filesystems_resolver.rb
facter-4.0.43 lib/facter/resolvers/macosx/filesystems_resolver.rb
facter-4.0.42 lib/facter/resolvers/macosx/filesystems_resolver.rb
facter-4.0.41 lib/facter/resolvers/macosx/filesystems_resolver.rb
facter-4.0.40 lib/facter/resolvers/macosx/filesystems_resolver.rb
facter-4.0.39 lib/facter/resolvers/macosx/filesystems_resolver.rb
facter-4.0.38 lib/facter/resolvers/macosx/filesystems_resolver.rb
facter-4.0.37 lib/facter/resolvers/macosx/filesystems_resolver.rb