lib/rconf/configurator.rb in rconf-0.8.3 vs lib/rconf/configurator.rb in rconf-0.8.4

- old
+ new

@@ -109,26 +109,34 @@ end error += "missing for configuration section '#{self.class.key}'" if error error end + # Check system to determine whether configurator needs to run + # + # === Return + # true:: If configurator needs to run + # false:: Otherwise + def check + Platform.dispatch { :check } + end + # Run configurator for current platform # # === Parameters # args:: Pass-through arguments, given to platform specific implementation # # === Return # true:: Always return true def run(*args) - key = "#{self.class.key}-#{@index}" - sha = Profile.configurator_signature(key) - sig = signature - if sha != sig - if only_if.nil? || instance_eval(only_if) || Profile.force? + key = "#{self.class.key}-#{@index}" + sha = Profile.configurator_signature(key) + sig = signature + if Profile.force_reconfigure? || + (Profile.force_check? || sha != sig && (only_if.nil? || instance_eval(only_if))) && !check Platform.dispatch(*args) { :run } Profile.set_configurator_signature(key, sig) end - end true end # Called even if configuration is already done for steps that must # always happen, do nothing by default