Sha256: 2e19aa0443caf7f203c9b02e282c3200f458df0a41d606c36be4f7be1e5a147d

Contents?: true

Size: 596 Bytes

Versions: 14

Compression:

Stored size: 596 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    class Augeas < BaseResolver
      @semaphore = Mutex.new
      @fact_list ||= {}

      class << self
        private

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

        def read_augeas_version(fact_name)
          output, _status = Open3.capture2('augparse --version 2>&1')
          @fact_list[:augeas_version] = Regexp.last_match(1) if output =~ /^augparse (\d+\.\d+\.\d+)/
          @fact_list[fact_name]
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
facter-4.0.20 lib/resolvers/augeas_resolver.rb
facter-4.0.19 lib/resolvers/augeas_resolver.rb
facter-4.0.18 lib/resolvers/augeas_resolver.rb
facter-4.0.17 lib/resolvers/augeas_resolver.rb
facter-4.0.16 lib/resolvers/augeas_resolver.rb
facter-4.0.15 lib/resolvers/augeas_resolver.rb
facter-4.0.14 lib/resolvers/augeas_resolver.rb
facter-4.0.13 lib/resolvers/augeas_resolver.rb
facter-4.0.12 lib/resolvers/augeas_resolver.rb
facter-4.0.11 lib/resolvers/augeas_resolver.rb
facter-4.0.10.pre lib/resolvers/augeas_resolver.rb
facter-4.0.9.pre lib/resolvers/augeas_resolver.rb
facter-4.0.8.pre lib/resolvers/augeas_resolver.rb
facter-4.0.7.pre lib/resolvers/augeas_resolver.rb