uff_db_loader 2.0.1 → 2.1.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: 4014edf9331d8b25f433d0252b62008f78db0f0038fb8e1f7877319eacf45320
4
- data.tar.gz: 16d16a54291cbf8641fba3ef4fa6db469a72b4420577716139d90ba06470d298
3
+ metadata.gz: 1b136a4cf8a5a4bbbe44371bdee9f33a97417bc22c88937d3e826af7c4a8b459
4
+ data.tar.gz: bc16630dc38a5cf6de7af81307b61dabe20f9b83675303b22addeb80288ae20c
5
5
  SHA512:
6
- metadata.gz: 4ea14486da00fdf735bb1310c2f70d24b274a14007960a5306c2af2faa016ce933d22aaa844ef589a336a0e7af7738de9179027429f2b425378fbb064f789673
7
- data.tar.gz: c40219d3c1b3b256f324097ec25be27ee16934395e6f9bfd6362d29efbc1f796b3547dc1de388a6678464eb14578d3f82e135036889398bfdf363790c21a4913
6
+ metadata.gz: da774d613024ae9ff97ad3a8d6d7500b9f4e7b69dff732a9877941d2f810234b00899a7d1bcc3e69c97fe5689a96e98eeba218bbe467fa9584d2f04f44d8deca
7
+ data.tar.gz: 577d9b103ae12261c9d6a099a274f33f54413062d487a391e50e811e6fa91c64f122c706100df1d99fef9b9fe4869acbd5a1e171e857f402b5d7ca08e1d8b6c9
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install uff_db_loader
22
22
 
23
- Run the installation script:
23
+ Run the installation script:
24
24
 
25
25
  $ bin/rails uff_db_loader:install
26
26
 
@@ -50,6 +50,7 @@ Make sure the app's database user has the superuser role. Otherwise the app will
50
50
  - `dump`: Dumps a remote database from a selected environment and downloads it
51
51
  - `restore`: Restores a downloaded dump into a local database
52
52
  - `switch`: Selects a restored local database to use
53
+ - `switch_to_default`: Switches database back to the default development database
53
54
  - `load`: Dumps a remote database from a selected environment and downloads it then restores and selects the database
54
55
  - `prune`: Delete all downloaded db dumps and removes all databases created by UffDbLoader
55
56
 
@@ -79,4 +79,12 @@ namespace :uff_db_loader do
79
79
  puts "Removing dumps from #{UffDbLoader.config.dumps_directory}"
80
80
  UffDbLoader.prune_dump_directory
81
81
  end
82
+
83
+ desc "Switch back to default database"
84
+ task switch_to_default: :environment do
85
+ UffDbLoader.remember_database_name("")
86
+ UffDbLoader.restart_rails_server
87
+
88
+ puts "♻️ Restarted rails server with default database."
89
+ end
82
90
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffDbLoader
4
- VERSION = "2.0.1"
4
+ VERSION = "2.1.0"
5
5
  end
data/lib/uff_db_loader.rb CHANGED
@@ -108,14 +108,14 @@ module UffDbLoader
108
108
  end
109
109
 
110
110
  def initializer_path
111
- File.join(__dir__, "uff_db_loader", "templates", "uff_db_loader_initializer.erb")
111
+ Rails.root.join("config", "initializers", "uff_db_loader.rb")
112
112
  end
113
113
 
114
114
  def create_initializer
115
- template = ERB.new(File.read(initializer_path))
115
+ template = ERB.new(File.read(initializer_template_path))
116
116
 
117
117
  File.write(
118
- Rails.root.join("config", "initializers", "uff_db_loader.rb"),
118
+ initializer_path,
119
119
  template.result_with_hash(
120
120
  used_database_system: used_database_system,
121
121
  environments: environments
@@ -125,6 +125,10 @@ module UffDbLoader
125
125
 
126
126
  private
127
127
 
128
+ def initializer_template_path
129
+ File.join(__dir__, "uff_db_loader", "templates", "uff_db_loader_initializer.erb")
130
+ end
131
+
128
132
  def database_name_file
129
133
  Rails.root.join("tmp", "uff_db_loader_database_name")
130
134
  end
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: 2.0.1
4
+ version: 2.1.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: 2022-10-04 00:00:00.000000000 Z
13
+ date: 2022-10-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/2.0.1
91
+ changelog_uri: https://github.com/rmehner/uff_db_loader/releases/tag/2.1.0
92
92
  homepage_uri: https://github.com/rmehner/uff_db_loader
93
- source_code_uri: https://github.com/rmehner/uff_db_loader/tree/2.0.1
93
+ source_code_uri: https://github.com/rmehner/uff_db_loader/tree/2.1.0
94
94
  post_install_message: Please run `bin/rails uff_db_loader:install` to complete the
95
95
  installation.
96
96
  rdoc_options: []