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 361 def exec!(cmd) puts "Launching: #{ cmd }" exec(cmd) end
is_backup_error?(error)
click to toggle source
# File lib/backup/cli.rb, line 366 def is_backup_error?(error) error.class.ancestors.include? Backup::Error end
overwrite?(path)
click to toggle source
# File lib/backup/cli.rb, line 353 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