Sha256: c67e0286a727ec3635bb8ac7d103c692204197069857ef47739bc66480e3ea0c

Contents?: true

Size: 506 Bytes

Versions: 22

Compression:

Stored size: 506 Bytes

Contents

# frozen_string_literal: true

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

      class << self
        private

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

        def read_version_file
          version_file = ::File.join(ROOT_DIR, 'VERSION')
          @fact_list[:facterversion] = ::File.read(version_file).chomp('')
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
facter-4.0.29 lib/resolvers/facterversion_resolver.rb
facter-4.0.28 lib/resolvers/facterversion_resolver.rb
facter-4.0.26 lib/resolvers/facterversion_resolver.rb
facter-4.0.25 lib/resolvers/facterversion_resolver.rb
facter-4.0.24 lib/resolvers/facterversion_resolver.rb
facter-4.0.23 lib/resolvers/facterversion_resolver.rb
facter-4.0.22 lib/resolvers/facterversion_resolver.rb
facter-4.0.21 lib/resolvers/facterversion_resolver.rb
facter-4.0.20 lib/resolvers/facterversion_resolver.rb
facter-4.0.19 lib/resolvers/facterversion_resolver.rb
facter-4.0.18 lib/resolvers/facterversion_resolver.rb
facter-4.0.17 lib/resolvers/facterversion_resolver.rb
facter-4.0.16 lib/resolvers/facterversion_resolver.rb
facter-4.0.15 lib/resolvers/facterversion_resolver.rb
facter-4.0.14 lib/resolvers/facterversion_resolver.rb
facter-4.0.13 lib/resolvers/facterversion_resolver.rb
facter-4.0.12 lib/resolvers/facterversion_resolver.rb
facter-4.0.11 lib/resolvers/facterversion_resolver.rb
facter-4.0.10.pre lib/resolvers/facterversion_resolver.rb
facter-4.0.9.pre lib/resolvers/facterversion_resolver.rb