remote_database_importer 0.1.4 → 0.1.5

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: 28a65a635e4ee78fdbce0dfce253b88a44fa190a887a8d68f928f5193d298fec
4
- data.tar.gz: c23343009f9e8cf5d819fdf4a2dae6e88e380d30ef7591382fc900bcb1f40e04
3
+ metadata.gz: e87b7d089101bd0f324f2dcaf9be16c2a038f9d369c4d18f86362492c7e25218
4
+ data.tar.gz: ea76970e0e136fc5469bf4f82fec6dd90bb7b7bad5622947c375a9a6640031fe
5
5
  SHA512:
6
- metadata.gz: 7b7bd6d20734483e93dcefec67a7890300f6946047003de8a12915a982063d0de086f0b372f188271b6f3c0c51b22bb6b5baac50f25034e7bb548bee5a19817e
7
- data.tar.gz: 7cc6a60c1141353e8cdf2d910fcab0d0f9c991e56c7cc0fbda513f3461fbaa6ba1abe16f0bcb07f13a99717fed81c519b01455da6b257fa0852cede0366d9e03
6
+ metadata.gz: cc71eabc31b5df7c4238fd0196733eb942f8704a31f3c33ba4373eab4278ec5be93828065fdaf6d6af52f9cad556b40aea692ed0d8d6756a8a20661b72f84e04
7
+ data.tar.gz: 14e17552a0ed444ad14904245bcb7adac5d4c5d795be684bb0acaecaefa1f12ec868cfe88034bc90413fd5986b8b99c881ea0a61f04734717bbf56c0aae0316c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.5 (2022-12-03)
4
+ - Define custom commands for each environment
5
+
3
6
  ## 0.1.4 (2022-11-17)
4
7
  - Remove colorize as a dependency
5
8
  - Code refactoring
@@ -4,10 +4,10 @@ class Colorize
4
4
  end
5
5
 
6
6
  def self.green(text)
7
- "\e[32m#{text}\e[0m"
7
+ "\e[32m#{text}\e[0m"
8
8
  end
9
9
 
10
10
  def self.blue(text)
11
11
  "\e[94m#{text}\e[0m"
12
12
  end
13
- end
13
+ end
@@ -4,10 +4,10 @@ module RemoteDatabaseImporter
4
4
  require_relative "colorize"
5
5
 
6
6
  attr_accessor :config
7
-
7
+
8
8
  def initialize
9
9
  @config = TTY::Config.new
10
-
10
+
11
11
  config.filename = "remote_database_importer"
12
12
  config.extname = ".yml"
13
13
  config.append_path Dir.pwd
@@ -63,6 +63,9 @@ module RemoteDatabaseImporter
63
63
  else
64
64
  postgres_port = ask("Enter the database port for the pg_dump command:", default: "5432")
65
65
  end
66
+
67
+ puts Colorize.green("Define custom commands that run after successful import:")
68
+ custom_commands = ask("Enter semicolon separated commands that should run after importing the DB:", default: "rake db:migrate; echo 'All Done'")
66
69
  puts
67
70
 
68
71
  env_config = {
@@ -77,7 +80,8 @@ module RemoteDatabaseImporter
77
80
  "postgres_port" => postgres_port,
78
81
  "ssh_user" => ssh_user,
79
82
  "ssh_port" => ssh_port
80
- }
83
+ },
84
+ "custom_commands" => custom_commands
81
85
  }
82
86
  }
83
87
  config.append(env_config, to: :environments)
@@ -90,11 +94,6 @@ module RemoteDatabaseImporter
90
94
  end
91
95
  end
92
96
 
93
- puts Colorize.green("Define custom commands that run after successful import:")
94
- custom_commands = ask("Enter semicolon separated commands that should run after importing the DB:", default: "rake db:migrate; echo 'All Done'")
95
- puts
96
-
97
- config.set(:custom_commands, value: custom_commands)
98
97
  config.write
99
98
  end
100
99
  end
@@ -72,12 +72,12 @@ module RemoteDatabaseImporter
72
72
  end
73
73
 
74
74
  def dump_remote_db
75
- host = current_environment["connection"]["host"]
76
- db_name = current_environment["database"]["name"]
77
- db_user = current_environment["database"]["user"]
78
- dump_type = current_environment["connection"]["dump_type"]
79
- ssh_user = current_environment["connection"]["ssh_user"]
80
- ssh_port = current_environment["connection"]["ssh_port"]
75
+ host = current_environment["connection"]["host"]
76
+ db_name = current_environment["database"]["name"]
77
+ db_user = current_environment["database"]["user"]
78
+ dump_type = current_environment["connection"]["dump_type"]
79
+ ssh_user = current_environment["connection"]["ssh_user"]
80
+ ssh_port = current_environment["connection"]["ssh_port"]
81
81
  postgres_port = current_environment["connection"]["postgres_port"]
82
82
 
83
83
  if dump_type == "ssh_tunnel"
@@ -104,7 +104,7 @@ module RemoteDatabaseImporter
104
104
  end
105
105
 
106
106
  def custom_commands
107
- config.fetch("custom_commands")
107
+ current_environment["custom_commands"]
108
108
  end
109
109
 
110
110
  def db_dump_location
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RemoteDatabaseImporter
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_database_importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leon Vogt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-20 00:00:00.000000000 Z
11
+ date: 2022-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-config