lib/custom_facts/util/fact.rb in facter-4.0.9.pre vs lib/custom_facts/util/fact.rb in facter-4.0.10.pre

- old
+ new

@@ -9,11 +9,11 @@ module LegacyFacter module Util class Fact # The name of the fact # @return [String] - attr_accessor :name + attr_reader :name # @return [String] # @deprecated attr_accessor :ldapname @@ -159,20 +159,20 @@ def find_suitable_resolutions(resolutions) resolutions.find_all(&:suitable?) end def sort_by_weight(resolutions) - resolutions.sort { |a, b| b.weight.to_i <=> a.weight.to_i } + resolutions.sort { |a, b| b.weight <=> a.weight } end def find_first_real_value(resolutions) resolutions.each do |resolve| begin value = resolve.value rescue Facter::ResolveCustomFactError break end - @used_resolution_weight = resolve.weight || 0 + @used_resolution_weight = resolve.weight return value unless value.nil? end nil end