From 030e014769f6423f901f33f23a3e949b76aa3e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= Date: Sun, 2 Sep 2018 18:33:38 +0100 Subject: can edit --- geheim.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/geheim.rb b/geheim.rb index 2d0f3bc..3a023a2 100755 --- a/geheim.rb +++ b/geheim.rb @@ -182,6 +182,11 @@ class GeheimData < CommitFile end end + def import(source_file:) + puts "Importing #{source_file} to #{@data_path}" + @data = File.read(source_file) + end + def commit(force: false) commit_content(file: @data_path, content: encrypt(plain: @data), force: force) end @@ -270,7 +275,10 @@ class Geheim destination_file = File.basename(index.description) data = index.get_data data.export(destination_file: destination_file) - shred_file(file: edit_exported(file: destination_file)) + edited_file = edit_exported(file: destination_file) + data.import(source_file: edited_file) + data.commit(force: true) + shred_file(file: edited_file) end end end -- cgit v1.2.3