Class: Ruborg::CLI::BackupConfig
- Inherits:
-
Object
- Object
- Ruborg::CLI::BackupConfig
- Defined in:
- lib/ruborg/cli.rb
Overview
Wrapper class to adapt repository config to existing Backup class
Instance Method Summary collapse
- #backup_paths ⇒ Object
- #compression ⇒ Object
- #encryption_mode ⇒ Object
- #exclude_patterns ⇒ Object
-
#initialize(repo_config, merged_settings) ⇒ BackupConfig
constructor
A new instance of BackupConfig.
Constructor Details
#initialize(repo_config, merged_settings) ⇒ BackupConfig
Returns a new instance of BackupConfig.
872 873 874 875 |
# File 'lib/ruborg/cli.rb', line 872 def initialize(repo_config, merged_settings) @repo_config = repo_config @merged_settings = merged_settings end |
Instance Method Details
#backup_paths ⇒ Object
877 878 879 880 881 882 |
# File 'lib/ruborg/cli.rb', line 877 def backup_paths sources = @repo_config["sources"] || [] sources.flat_map do |source| source["paths"] || [] end end |
#compression ⇒ Object
894 895 896 |
# File 'lib/ruborg/cli.rb', line 894 def compression @merged_settings["compression"] || "lz4" end |
#encryption_mode ⇒ Object
898 899 900 |
# File 'lib/ruborg/cli.rb', line 898 def encryption_mode @merged_settings["encryption"] || "repokey" end |
#exclude_patterns ⇒ Object
884 885 886 887 888 889 890 891 892 |
# File 'lib/ruborg/cli.rb', line 884 def exclude_patterns patterns = [] sources = @repo_config["sources"] || [] sources.each do |source| patterns += source["exclude"] || [] end patterns += @merged_settings["exclude_patterns"] || [] patterns.uniq end |