uff_db_loader 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uff_db_loader/tasks/uff_db_loader.rake +8 -3
- data/lib/uff_db_loader/version.rb +1 -1
- data/lib/uff_db_loader.rb +10 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f807430f4dff47a2a9a98b6f360720a51a7f96c9af2554e0784383adaf0fe63
|
4
|
+
data.tar.gz: dfaf6dad64eea0e267872426f1426534703e52257c8e29a6440c174a94a94f72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1bed481bd67cc2d5dc3000b6d8b67d17ae0e3f7631302b717c436827862538ab679b52edea76777e8a6f2e1d103caca6c5b75796f64dcf457c7bec7e5a6b226
|
7
|
+
data.tar.gz: 05defe18ffd2c6719180c26fcab48c85de42cba697834162c9ca81a15e8394760afe8e5daf60e287bc7611b2d257d3a58cbe98778ea2c119275a0a692673bbb3
|
@@ -30,9 +30,14 @@ namespace :uff_db_loader do
|
|
30
30
|
|
31
31
|
puts "✅ Succesfully loaded #{result_file_path} into #{database_name}"
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
if UffDbLoader.replace_database_name_in_config(database_name)
|
34
|
+
system("bin/rails restart")
|
35
|
+
puts "🤖 Updated #{UffDbLoader.config.database_config_file} and restarted the rails server. Happy hacking, beep boop!"
|
36
|
+
else
|
37
|
+
puts "💩 Because YAML is a wonderful format, you need to adapt your config file by hand."
|
38
|
+
puts "🆗 Go to #{UffDbLoader.config.database_config_file} and change the development database value to: #{database_name}"
|
39
|
+
puts "🧑🏾🏫 Don't forgot to restart the Rails server after changing the database config (`rails restart`)"
|
40
|
+
end
|
36
41
|
end
|
37
42
|
|
38
43
|
desc "Delete all downloaded db dumps and emove all databases created by UffDbLoader"
|
data/lib/uff_db_loader.rb
CHANGED
@@ -80,6 +80,16 @@ module UffDbLoader
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
+
def self.replace_database_name_in_config(new_database_name)
|
84
|
+
old_database_name = Rails.configuration.database_configuration["development"]["database"]
|
85
|
+
|
86
|
+
return false if old_database_name.nil?
|
87
|
+
|
88
|
+
old_config = File.read(UffDbLoader.config.database_config_file)
|
89
|
+
new_config = old_config.sub(old_database_name, new_database_name)
|
90
|
+
File.write(UffDbLoader.config.database_config_file, new_config)
|
91
|
+
end
|
92
|
+
|
83
93
|
class ForbiddenEnvironmentError < StandardError; end
|
84
94
|
|
85
95
|
class UnknownDatabaseSystem < StandardError; end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uff_db_loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Hellwig
|
8
8
|
- Fynn Heintz
|
9
9
|
- Robin Mehner
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
13
|
date: 2022-08-25 00:00:00.000000000 Z
|
@@ -88,10 +88,10 @@ 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/1.
|
91
|
+
changelog_uri: https://github.com/rmehner/uff_db_loader/releases/tag/1.3.0
|
92
92
|
homepage_uri: https://github.com/rmehner/uff_db_loader
|
93
|
-
source_code_uri: https://github.com/rmehner/uff_db_loader/tree/1.
|
94
|
-
post_install_message:
|
93
|
+
source_code_uri: https://github.com/rmehner/uff_db_loader/tree/1.3.0
|
94
|
+
post_install_message:
|
95
95
|
rdoc_options: []
|
96
96
|
require_paths:
|
97
97
|
- lib
|
@@ -106,8 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
|
-
rubygems_version: 3.3
|
110
|
-
signing_key:
|
109
|
+
rubygems_version: 3.0.3
|
110
|
+
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: Allows to dump, download and restore databases from docker servers.
|
113
113
|
test_files: []
|