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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af06f20537df45280990abc9fd8c2235741b6aa22de270bbcb06684f80994d46
4
- data.tar.gz: b345349594c6408775596e9189ca494671168f9b2acfecaeb9352aaa52d1b4b8
3
+ metadata.gz: 5f4e8e6c49bdb9df63ae315e6f010823a6f0f0eff52a6e7a8650a71217ed51b9
4
+ data.tar.gz: c20ae01f25ebc0b93abcbf4634e2a66e2b7978184409000677fdd77ad6750101
5
5
  SHA512:
6
- metadata.gz: 6d012764dfd32b2002ce51f6c94b9d8cc83836e947211bb7271166c674f19ba8f61f6683fcab6a8d30cd9668103d2abc4a73477105a35004a1af662aa13612b9
7
- data.tar.gz: a094fff01bebad3fee84a8391918105f5f5f0c0b0707d8b935ef05b378b27f667751b601addfe77657b14ac48c428230d9cda4e76a34ad0e206b4d961d7812b2
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
- system(prepared_command) || raise("[Alterity] Command failed")
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Alterity
4
- VERSION = "1.3.0"
4
+ VERSION = "1.3.1"
5
5
  end
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.0
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-05-05 00:00:00.000000000 Z
11
+ date: 2021-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2