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
728 729 730 731 |
# File 'lib/ruborg/cli.rb', line 728 def initialize(repo_config, merged_settings) @repo_config = repo_config @merged_settings = merged_settings end |
Instance Method Details
#backup_paths ⇒ Object
733 734 735 736 737 738 |
# File 'lib/ruborg/cli.rb', line 733 def backup_paths sources = @repo_config["sources"] || [] sources.flat_map do |source| source["paths"] || [] end end |
#compression ⇒ Object
750 751 752 |
# File 'lib/ruborg/cli.rb', line 750 def compression @merged_settings["compression"] || "lz4" end |
#encryption_mode ⇒ Object
754 755 756 |
# File 'lib/ruborg/cli.rb', line 754 def encryption_mode @merged_settings["encryption"] || "repokey" end |
#exclude_patterns ⇒ Object
740 741 742 743 744 745 746 747 748 |
# File 'lib/ruborg/cli.rb', line 740 def exclude_patterns patterns = [] sources = @repo_config["sources"] || [] sources.each do |source| patterns += source["exclude"] || [] end patterns += @merged_settings["exclude_patterns"] || [] patterns.uniq end |