snapshot_archive 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23bf48f76c366c97e8af2b6a56bdece2729eadd670f02363afd16ead08647053
4
- data.tar.gz: a091e5e222475f510b419c2ed78f13f074a2f3196f722a6a394e7afa9d71ff71
3
+ metadata.gz: cc3dfc324aec3de5085d7e01d09240ee0b8ce0e784bdb7d3fc8eebdab15c2221
4
+ data.tar.gz: cfa08fdf78e57d167909b53cbf3f4689fa7add3554effb1b1731375bbb7dd461
5
5
  SHA512:
6
- metadata.gz: 27db023b81db187306af4b09c6dc381a4a6d219f20a4b05e95ebf12ba2099872d977d03d0f9de6cc40827498cf755b5c77d222954246abaf53f0e3800d3bd324
7
- data.tar.gz: 21ae0dae28c890d1d9d12b33ddceff78ba5f7d79139f95652b025f6c1df21a495c0c992b68a4b1f340099a893d3a0359603d624f01167372fe5e53d9e92a4f77
6
+ metadata.gz: b30ab50079a0953922611b8adbf299edc752963a37b699e911cfae53e5cb3b0d63e4f9f7b4efe29eab189b061f06d422e767766d6ffc97f627d157db0e03eeca
7
+ data.tar.gz: 1d7ac776750bc468dafe87209e7e403f15c69db1217392d5c20eb893595635c263f82b8c127937530db868fae5ce689d49914c2e8fa53c2014fb7321b03af0d1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snapshot_archive (0.5.0)
4
+ snapshot_archive (0.7.0)
5
5
  commander (~> 4.5)
6
6
 
7
7
  GEM
@@ -33,6 +33,7 @@ GEM
33
33
  unicode-display_width (2.1.0)
34
34
 
35
35
  PLATFORMS
36
+ aarch64-linux
36
37
  x86_64-darwin-19
37
38
  x86_64-darwin-20
38
39
 
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.map { |arg| SnapshotArchive::Cfg.parse_store(arg) }.to_h
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
@@ -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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SnapshotArchive
4
- VERSION = "0.7.0"
4
+ VERSION = "0.8.0"
5
5
  end
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.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Kinnecom