module Backup::CLI::Helpers

This is to avoid Thor's warnings when stubbing methods on the Thor class.

Public Class Methods

exec!(cmd) click to toggle source
# File lib/backup/cli.rb, line 360
def exec!(cmd)
  puts "Launching: #{ cmd }"
  exec(cmd)
end
is_backup_error?(error) click to toggle source
# File lib/backup/cli.rb, line 365
def is_backup_error?(error)
  error.class.ancestors.include? Backup::Error
end
overwrite?(path) click to toggle source
# File lib/backup/cli.rb, line 352
def overwrite?(path)
  return true unless File.exist?(path)

  $stderr.print "A file already exists at '#{ path }'.\n" +
                "Do you want to overwrite? [y/n] "
  /^[Yy]/ =~ $stdin.gets
end