alterity 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alterity.rb +13 -1
- data/lib/alterity/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f4e8e6c49bdb9df63ae315e6f010823a6f0f0eff52a6e7a8650a71217ed51b9
|
4
|
+
data.tar.gz: c20ae01f25ebc0b93abcbf4634e2a66e2b7978184409000677fdd77ad6750101
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f18b1dc05a88537b96525e04caa763b6442eacc1da1696a13f93bcd0f3d0bdac22ddee19d4aa0f11e45fbd7326a51508c1928f4641bb831b0da6645ad79b1522
|
7
|
+
data.tar.gz: a93f02e048fa0f1970123c504040219113497d214e78c806031c3df065e8e14bf628d45d2972b4c2fecd1930e1fd8b933e3845221b6ef45f74335b05ebbd1d59
|
data/lib/alterity.rb
CHANGED
@@ -35,6 +35,7 @@ class Alterity
|
|
35
35
|
|
36
36
|
# hooks
|
37
37
|
def before_running_migrations
|
38
|
+
require "open3"
|
38
39
|
state.migrating = true
|
39
40
|
set_database_config
|
40
41
|
prepare_replicas_dsns_table
|
@@ -51,7 +52,18 @@ class Alterity
|
|
51
52
|
alter_argument = %("#{updates.gsub('"', '\\"').gsub('`', '\\\`')}")
|
52
53
|
prepared_command = config.command.call(altered_table, alter_argument).to_s.gsub(/\n/, "\\\n")
|
53
54
|
puts "[Alterity] Will execute: #{prepared_command}"
|
54
|
-
|
55
|
+
|
56
|
+
result_str = +""
|
57
|
+
exit_status = nil
|
58
|
+
Open3.popen2e(prepared_command) do |_stdin, stdout_and_stderr, wait_thr|
|
59
|
+
stdout_and_stderr.each do |line|
|
60
|
+
puts line
|
61
|
+
result_str << line
|
62
|
+
end
|
63
|
+
exit_status = wait_thr.value
|
64
|
+
end
|
65
|
+
|
66
|
+
raise("[Alterity] Command failed. Full output: #{result_str}") unless exit_status.success?
|
55
67
|
end
|
56
68
|
|
57
69
|
def set_database_config
|
data/lib/alterity/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alterity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Maximin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|