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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce054d819d2904bc09ce9745be4e7183e82865180c8dad43377618b5a2b9dc3f
4
- data.tar.gz: b302b75328f3a33a50de9a7490177418030b599bf9cccaaacf55592a99406443
3
+ metadata.gz: cc3dfc324aec3de5085d7e01d09240ee0b8ce0e784bdb7d3fc8eebdab15c2221
4
+ data.tar.gz: cfa08fdf78e57d167909b53cbf3f4689fa7add3554effb1b1731375bbb7dd461
5
5
  SHA512:
6
- metadata.gz: 676aa9b24a464fc46ebaad107e5a7517a5243cf947e5d5ef49e4a941931b652339a6a0253e1097b62f1e103e441971538c0267e7300def7f11d5a53881c2fd08
7
- data.tar.gz: d5f5c0094fb81ea474c40c951bedb4e965fe537ff35fadbd3329cd1f5232a2dc8570ea8faf82eef946e16b7c8f918f142087ba88949248bed063c9a90e4dea72
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.6.0"
4
+ VERSION = "0.8.0"
5
5
  end
data/lib/template.txt ADDED
@@ -0,0 +1,5 @@
1
+
2
+
3
+ # Follows same rules as a git commit message. First line is summary, followed by
4
+ # more detailed info. Set `export EDITOR="..."` to use a different editor for
5
+ # this message. (eg. `export EDITOR="code --wait"` to use VSCode)
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.6.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