lib/backup_repos/cli/setup.rb in backup_repos-0.4.0 vs lib/backup_repos/cli/setup.rb in backup_repos-0.5.0
- old
+ new
@@ -18,11 +18,11 @@
end
private
def write_config
- File.write(BackupRepos.config.config_file, YAML.dump(config))
+ File.write(backup_config.config_file, YAML.dump(config))
end
def configure_from_options
@config[:debug] = true if options.debug
end
@@ -45,11 +45,11 @@
cli.say '* To what directory you want to backup?'
@backup_directory = cli.ask ' Backup directory: ' do |q|
q.readline = true
q.completion = Pathname
q.directory = Pathname.new('/')
- q.default = BackupRepos.config.backup_root
+ q.default = backup_config.backup_root
q.glob = '*'
end
check_backup_directory
end
@@ -116,9 +116,13 @@
end
end
def cli
@cli ||= HighLine.new
+ end
+
+ def backup_config
+ @backup_config || BackupRepos::Config.new(options)
end
end
end
end