snapshot_archive 0.6.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -1
- data/README.md +4 -1
- data/exe/snap +5 -1
- data/lib/snapshot_archive/cfg.rb +9 -0
- data/lib/snapshot_archive/version.rb +1 -1
- data/lib/template.txt +5 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc3dfc324aec3de5085d7e01d09240ee0b8ce0e784bdb7d3fc8eebdab15c2221
|
4
|
+
data.tar.gz: cfa08fdf78e57d167909b53cbf3f4689fa7add3554effb1b1731375bbb7dd461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b30ab50079a0953922611b8adbf299edc752963a37b699e911cfae53e5cb3b0d63e4f9f7b4efe29eab189b061f06d422e767766d6ffc97f627d157db0e03eeca
|
7
|
+
data.tar.gz: 1d7ac776750bc468dafe87209e7e403f15c69db1217392d5c20eb893595635c263f82b8c127937530db868fae5ce689d49914c2e8fa53c2014fb7321b03af0d1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@ snapshot and restore it later! Build your own snapshotting behavior in a
|
|
6
6
|
configuration file so that you can snapshot any stateful service you use during
|
7
7
|
development.
|
8
8
|
|
9
|
-
By default will make mysql backups for any development databases for the rails
|
9
|
+
By default will make mysql backups for any development databases for the rails
|
10
10
|
app in your CWD.
|
11
11
|
|
12
12
|
## Installation
|
@@ -155,5 +155,8 @@ SnapshotArchive.configure do |config|
|
|
155
155
|
# snap backup mysql:db_1,db_2
|
156
156
|
|
157
157
|
config.register_store("my_backup", "mysql:db_1,db_2")
|
158
|
+
|
159
|
+
# You can also alias an array of stores:
|
160
|
+
config.register_store("my_backup_2", ["mysql:db_1,db_2", "other_stuff"])
|
158
161
|
end
|
159
162
|
```
|
data/exe/snap
CHANGED
@@ -64,7 +64,11 @@ module SnapshotArchive
|
|
64
64
|
|
65
65
|
stores = (
|
66
66
|
if args.count > 0
|
67
|
-
args
|
67
|
+
args
|
68
|
+
.map { |arg| SnapshotArchive::Cfg.resolve_alias(arg) }
|
69
|
+
.flatten
|
70
|
+
.map { |arg| SnapshotArchive::Cfg.parse_store(arg) }
|
71
|
+
.to_h
|
68
72
|
else
|
69
73
|
SnapshotArchive::Cfg.stores
|
70
74
|
end
|
data/lib/snapshot_archive/cfg.rb
CHANGED
@@ -40,6 +40,7 @@ module SnapshotArchive
|
|
40
40
|
[
|
41
41
|
:bind_backup,
|
42
42
|
:load,
|
43
|
+
:resolve_alias,
|
43
44
|
:parse_store,
|
44
45
|
:pwd,
|
45
46
|
:repository,
|
@@ -65,6 +66,14 @@ module SnapshotArchive
|
|
65
66
|
Kernel.load(config_path) if File.exist?(config_path)
|
66
67
|
end
|
67
68
|
|
69
|
+
def resolve_alias(name)
|
70
|
+
if store_registry[name].is_a?(Array)
|
71
|
+
store_registry[name]
|
72
|
+
else
|
73
|
+
name
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
68
77
|
def register_store(name, klass_or_alias=nil, active_by_default: true, &block)
|
69
78
|
store = (
|
70
79
|
if klass_or_alias.is_a?(String)
|
data/lib/template.txt
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snapshot_archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Kinnecom
|
@@ -54,6 +54,7 @@ files:
|
|
54
54
|
- lib/snapshot_archive/shell.rb
|
55
55
|
- lib/snapshot_archive/stores.rb
|
56
56
|
- lib/snapshot_archive/version.rb
|
57
|
+
- lib/template.txt
|
57
58
|
- script/install
|
58
59
|
- snapshot_archive.gemspec
|
59
60
|
homepage: https://github.com/petekinnecom/snapshot_archive
|