snapshot_archive 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/snapshot_archive/archives.rb +1 -1
- data/lib/snapshot_archive/repositories.rb +3 -2
- data/lib/snapshot_archive/stores.rb +2 -2
- data/lib/snapshot_archive/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e85e9702884bba227f834ba3ca4c7d347803bd063b245d22b85bae0808285b4
|
4
|
+
data.tar.gz: f961470cf8cf6f94be884bb5a52962088cacd6d0c6905685381c295ec0cfaeea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc227fea293c769b9af048f23eeb98e4bcfe95a109ec8608a9f06a58576a76cafe3c9004cceb73181c3cf701c0026769c008141bc4c7e08b0f31cfad093c7497
|
7
|
+
data.tar.gz: 639891a32eff28125d49c070a8cd4251046cb01230c4f672d5cc27370b0d923e7aebef7903590c48639f97340cd7b2d0e1e0e56ef68d4220baf499f522573dc1
|
data/README.md
CHANGED
@@ -130,7 +130,7 @@ SnapshotArchive.configure do |config|
|
|
130
130
|
# Using an object:
|
131
131
|
|
132
132
|
class MyCustomStore
|
133
|
-
def backup(dir:, id:, args: [])
|
133
|
+
def backup(dir:, id:, name:, args: [])
|
134
134
|
path = File.join(dir, "my_custom_store.txt")
|
135
135
|
File.write(path, "received args: #{args}")
|
136
136
|
|
@@ -148,7 +148,7 @@ SnapshotArchive.configure do |config|
|
|
148
148
|
# Using the store builder:
|
149
149
|
|
150
150
|
config.register_store("my_custom_store") do |store|
|
151
|
-
store.backup do |dir:, id:, args: []|
|
151
|
+
store.backup do |dir:, id:, name:, args: []|
|
152
152
|
path = File.join(dir, "my_custom_store.txt")
|
153
153
|
File.write(path, "received args: #{args}")
|
154
154
|
|
@@ -67,8 +67,9 @@ module SnapshotArchive
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def delete(id)
|
70
|
-
|
71
|
-
raise ArgumentError.new("unknown snapshot: #{id}") unless File.exist?(
|
70
|
+
md_path = File.read(File.join(path, id, "metadata.json"))
|
71
|
+
raise ArgumentError.new("unknown snapshot: #{id}") unless File.exist?(md_path)
|
72
|
+
metadata = JSON.parse(md_path)
|
72
73
|
|
73
74
|
Cfg.shell.info("Running delete hooks: #{id}")
|
74
75
|
Archives::Delete.call(metadata.dig("archive"))
|