class BackupMonitor::CLI

Public Instance Methods

check(base_path = nil) click to toggle source
# File lib/backup_monitor/cli.rb, line 9
def check(base_path = nil)
        base_path ||= Dir.pwd

        checker = Checker.new warning_threshold: options[:threshold].to_i
        result = checker.check base_path
        if result.empty?
                STDOUT.puts 'No stale directories found'
        else
                STDERR.puts 'Found stale directories:'
                result.each_pair do |key, value|
                        STDERR.puts "\t#{value} - #{key}"
                end
        end
end