Class: CryptReboot::FilesGenerator
- Inherits:
-
Object
- Object
- CryptReboot::FilesGenerator
- Defined in:
- lib/crypt_reboot/files_generator.rb
Overview
Generate a hash with file names as keys and file contents as values
Instance Method Summary collapse
Instance Method Details
#call(entries, base_dir:, crypttab_path:) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/crypt_reboot/files_generator.rb', line 6 def call(entries, base_dir:, crypttab_path:) files = {} modified_entries = entries.map do |entry| next entry unless luks?(entry, base_dir) data = fetch_data(entry, base_dir) keyfile = keyfile_locator.call(entry.target) files[keyfile] = data.key entry_converter.call(entry, data, keyfile) end files.merge(crypttab_path => serializer.call(modified_entries)) end |