uff_db_loader 2.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/.standard.yml +1 -1
- data/lib/uff_db_loader/tasks/uff_db_loader.rake +7 -4
- data/lib/uff_db_loader/version.rb +1 -1
- data/lib/uff_db_loader.rb +5 -3
- data/uff_db_loader.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68a5cb60e3cf41f8a59e5ff1f0c08c6d186473633adbf8976f9ffc8b23f86af2
|
4
|
+
data.tar.gz: 44dda910a3252b9f5c2b2d9b6c3b82c60a78e4d07855f774cab8b7676db2ef28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8550673f5245e23f16d92fbf89f231db925f4827c9ba3ee35bfc2bcd94d8cf32a5b138a9012eeb957fe87f6b83dbf20a3a051801ddee54e4e40f28a587edc80e
|
7
|
+
data.tar.gz: 450d57b8b60f9d5d0c847d67b18144ae5ec5a8c415fd1b5f2fa5a90039f61190db61484f0e7a4092cfc14ca0e8ccd0542c3deed6a7e9ead3b8636c9f2d0b1928
|
data/.github/workflows/test.yml
CHANGED
data/.standard.yml
CHANGED
@@ -29,6 +29,11 @@ namespace :uff_db_loader do
|
|
29
29
|
task restore: :environment do
|
30
30
|
UffDbLoader.ensure_installation!
|
31
31
|
|
32
|
+
# switch to default db so we can restore the currently connected database
|
33
|
+
UffDbLoader.remember_database_name("")
|
34
|
+
ActiveRecord::Base.remove_connection
|
35
|
+
ActiveRecord::Base.establish_connection(Rails.configuration.database_configuration["development"])
|
36
|
+
|
32
37
|
prompt = TTY::Prompt.new
|
33
38
|
existing_dumps = Dir.glob("#{UffDbLoader.config.dumps_directory}/#{UffDbLoader.config.app_name}*").map { |f| File.basename(f, ".*") }
|
34
39
|
database_name = prompt.select("Which dump should be restored?", existing_dumps)
|
@@ -67,11 +72,9 @@ namespace :uff_db_loader do
|
|
67
72
|
|
68
73
|
desc "Delete all downloaded db dumps and removes all databases created by UffDbLoader"
|
69
74
|
task prune: :environment do
|
70
|
-
# switch to default db so we can also drop the currently connected database
|
71
|
-
UffDbLoader.remember_database_name("")
|
72
|
-
ActiveRecord::Base.connection.reconnect!
|
73
|
-
|
74
75
|
UffDbLoader.databases.each do |database_name|
|
76
|
+
next if database_name == ActiveRecord::Base.connection.current_database
|
77
|
+
|
75
78
|
puts "Dropping #{database_name}"
|
76
79
|
UffDbLoader.drop_database(database_name)
|
77
80
|
end
|
data/lib/uff_db_loader.rb
CHANGED
@@ -45,7 +45,9 @@ module UffDbLoader
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def prune_dump_directory
|
48
|
-
FileUtils.
|
48
|
+
FileUtils.rm_f(
|
49
|
+
FileList["#{config.dumps_directory}/*"].exclude(dump_file_path(current_database_name)).to_a
|
50
|
+
)
|
49
51
|
end
|
50
52
|
|
51
53
|
def create_database(database_name)
|
@@ -74,8 +76,8 @@ module UffDbLoader
|
|
74
76
|
|
75
77
|
def current_database_name
|
76
78
|
File.read(database_name_file).strip.presence
|
77
|
-
rescue IOError, Errno::ENOENT
|
78
|
-
|
79
|
+
rescue IOError, Errno::ENOENT
|
80
|
+
# We expect this file to be missing in non-dev environments.
|
79
81
|
end
|
80
82
|
|
81
83
|
def remember_database_name(database_name)
|
data/uff_db_loader.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.post_install_message = "Please run `bin/rails uff_db_loader:install` to complete the installation."
|
12
12
|
spec.homepage = "https://github.com/rmehner/uff_db_loader"
|
13
13
|
spec.license = "MIT"
|
14
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
15
15
|
|
16
16
|
spec.metadata = {
|
17
17
|
"bug_tracker_uri" => "#{spec.homepage}/issues",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uff_db_loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Hellwig
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-04-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: tty-prompt
|
@@ -88,9 +88,9 @@ licenses:
|
|
88
88
|
- MIT
|
89
89
|
metadata:
|
90
90
|
bug_tracker_uri: https://github.com/rmehner/uff_db_loader/issues
|
91
|
-
changelog_uri: https://github.com/rmehner/uff_db_loader/releases/tag/
|
91
|
+
changelog_uri: https://github.com/rmehner/uff_db_loader/releases/tag/3.0.0
|
92
92
|
homepage_uri: https://github.com/rmehner/uff_db_loader
|
93
|
-
source_code_uri: https://github.com/rmehner/uff_db_loader/tree/
|
93
|
+
source_code_uri: https://github.com/rmehner/uff_db_loader/tree/3.0.0
|
94
94
|
post_install_message: Please run `bin/rails uff_db_loader:install` to complete the
|
95
95
|
installation.
|
96
96
|
rdoc_options: []
|
@@ -100,14 +100,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 3.0.0
|
104
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - ">="
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.4.
|
110
|
+
rubygems_version: 3.4.6
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Allows to dump, download and restore databases from docker servers.
|