alterity 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alterity/version.rb +1 -1
- data/lib/alterity.rb +6 -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: 17e41112c9c2dbf07aa9115bbe62ead1666d8802f0ce67a57bb5c9390ff85ecf
|
4
|
+
data.tar.gz: 815373d5f3832cea20695a067c2e7ecaf7823bddb5ca7769a5de2f42e371cc01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ea71bf4f05a6413e864dce3f781dd3231a7832022bc21b890bdafeb4ca3e522222118929723f35495655a97863d60db1619f973c6f3b5d970c7c5cb63fcfe6b
|
7
|
+
data.tar.gz: ace1c68c92fe85b4704034be10f166b66e392777de6ebf1aafdc151fa6eb1e0ccb0e61fb636754507853fe6a33fbe5431bf38f347d915486435a58af6f432a47
|
data/lib/alterity/version.rb
CHANGED
data/lib/alterity.rb
CHANGED
@@ -53,7 +53,7 @@ class Alterity
|
|
53
53
|
altered_table = table.delete("`")
|
54
54
|
alter_argument = %("#{updates.gsub('"', '\\"').gsub('`', '\\\`')}")
|
55
55
|
prepared_command = config.command.call(altered_table, alter_argument).to_s.gsub(/\n/, "\\\n")
|
56
|
-
puts "[Alterity] Will execute: #{prepared_command}"
|
56
|
+
puts "[Alterity] Will execute: #{sanitize(prepared_command)}"
|
57
57
|
config.before_command&.call(prepared_command)
|
58
58
|
|
59
59
|
result_str = +""
|
@@ -71,6 +71,11 @@ class Alterity
|
|
71
71
|
raise("[Alterity] Command failed. Full output: #{result_str}") unless exit_status.success?
|
72
72
|
end
|
73
73
|
|
74
|
+
def sanitize(command)
|
75
|
+
return command unless config.password.present?
|
76
|
+
command.gsub(config.password, '[filtered]')
|
77
|
+
end
|
78
|
+
|
74
79
|
def set_database_config
|
75
80
|
db_config_hash = ActiveRecord::Base.connection_db_config.configuration_hash
|
76
81
|
%i[host port database username password].each do |key|
|
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.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Maximin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|