Method: Redwood.check_syncback_settings

Defined in:
lib/sup.rb

.check_syncback_settingsObject



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/sup.rb', line 202

def check_syncback_settings
  # don't check if syncback was never performed
  return unless File.exist? Redwood::SYNC_OK_FN
  active_sync_sources = File.readlines(Redwood::SYNC_OK_FN).collect { |e| e.strip }.find_all { |e| not e.empty? }
  return if active_sync_sources.length == 1 and active_sync_sources[0] == Redwood::MAILDIR_SYNC_CHECK_SKIPPED
  sources = SourceManager.sources
  newly_synced = sources.select { |s| s.is_a? Maildir and s.sync_back_enabled? and not active_sync_sources.include? s.uri }
  unless newly_synced.empty?

    details ="It appears that the option \"sync_back\" of the following source(s)\nhas been changed from false to true since the last execution of\nsup:\n\n"
    newly_synced.each do |s|
      details += "#{s} (usual: #{s.usual})\n"
    end

    Redwood.warn_syncback details
  end
end