Class: Imap::Backup::Setup::BackupPath
- Inherits:
-
Object
- Object
- Imap::Backup::Setup::BackupPath
- Defined in:
- lib/imap/backup/setup/backup_path.rb
Overview
Requests an updated backup path from the user
Instance Method Summary collapse
-
#initialize(account:, config:) ⇒ BackupPath
constructor
A new instance of BackupPath.
-
#run ⇒ void
Asks the user for a backup path.
Constructor Details
#initialize(account:, config:) ⇒ BackupPath
Returns a new instance of BackupPath.
10 11 12 13 |
# File 'lib/imap/backup/setup/backup_path.rb', line 10 def initialize(account:, config:) @account = account @config = config end |
Instance Method Details
#run ⇒ void
This method returns an undefined value.
Asks the user for a backup path
18 19 20 21 22 23 24 |
# File 'lib/imap/backup/setup/backup_path.rb', line 18 def run account.local_path = highline.ask("backup directory: ") do |q| q.default = account.local_path q.validate = ->(path) { path_modification_validator(path) } q.responses[:not_valid] = "Choose a different directory " end end |