avm-eac_postgresql_base0 0.5.2 → 0.5.3

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: 482f1f478319ae175f57604f3b227e9e69cbefd2552284cb78ee1b27a8927c1e
4
- data.tar.gz: f5060713798f4b42ca597856f60a7860decec95b6bbc7c2175b53a78173c0a64
3
+ metadata.gz: b225a9cd207947f745ff37aaa23d898088217ff8787076ee9752407c81cbca86
4
+ data.tar.gz: 375aab52990242c88133d75b04d84b8ba1b8fbcada204413317e1959e92aa105
5
5
  SHA512:
6
- metadata.gz: 462dba98f08f83a8380a6a7f11885df477aa91e5a143407e1feecb20ec480a01a53337c6adcc028aec12f734ab7b5fb5a725432d9a879f647f6f04ca5286c965
7
- data.tar.gz: a89df87b96697f7337cbdd9f0456116bc06f8f08651a928f18cff2f5b1bc82d2dd92ba00468ee932824b3553ea8ba4a753eb774195ce80540b992f43d31964d3
6
+ metadata.gz: 8b98c338d49e17da1a7da5c7697e3e83403bbbaff559e9ef1b58a16ffabe556e971c421cc8ce4f3f19dfc49af2ee802e83ee1797458a619337c0105991a7598d
7
+ data.tar.gz: 0a6a68ac3769c9c011a35f07c1486ef15318e3b5122b923b34baf4b3403f2544a5d3eab36ae946184df0323fffbe44360d6f80ee876eb7a45028190ecfa928ac
@@ -29,7 +29,7 @@ module Avm
29
29
  end
30
30
 
31
31
  def current_owner
32
- root_query(<<~SQL
32
+ root_query(<<~SQL.squish
33
33
  SELECT pg_catalog.pg_get_userbyid(datdba)
34
34
  FROM pg_catalog.pg_database
35
35
  WHERE datname = '#{name}'
@@ -43,7 +43,7 @@ module Avm
43
43
 
44
44
  def password_ok?
45
45
  instance.psql_command_command('SELECT 1', false)
46
- .execute!(exit_outputs: { 512 => 'login_failed' }).strip == '1'
46
+ .execute!(exit_outputs: { 512 => 'login_failed' }).strip == '1'
47
47
  end
48
48
 
49
49
  def user_exist?
@@ -41,12 +41,12 @@ module Avm
41
41
  "@ESC_PGPASSWORD=#{password}"
42
42
  end
43
43
 
44
- def psql_command(database = true)
44
+ def psql_command(database = true) # rubocop:disable Style/OptionalBooleanParameter
45
45
  env.command(password_command_argument, 'psql', '--variable', 'ON_ERROR_STOP=t',
46
46
  *common_command_args(database))
47
47
  end
48
48
 
49
- def psql_command_command(sql, database = true)
49
+ def psql_command_command(sql, database = true) # rubocop:disable Style/OptionalBooleanParameter
50
50
  psql_command(database).append(['--quiet', '--tuples-only', '--command', sql])
51
51
  end
52
52
 
@@ -56,7 +56,7 @@ module Avm
56
56
  env.command(*args)
57
57
  end
58
58
 
59
- def common_command_args(database = true)
59
+ def common_command_args(database = true) # rubocop:disable Style/OptionalBooleanParameter
60
60
  ['--host', host, '--username', user, '--port', port,
61
61
  (database ? name : MAINTENANCE_DATABASE)]
62
62
  end
@@ -71,7 +71,7 @@ module Avm
71
71
  # @return [EacRubyUtils::Envs::Command]
72
72
  def pg_dump_command
73
73
  env.command('pg_dump', '--no-privileges', '--no-owner', *common_command_args)
74
- .envvar('PGPASSWORD', password)
74
+ .envvar('PGPASSWORD', password)
75
75
  end
76
76
  end
77
77
  end
@@ -10,7 +10,7 @@ module Avm
10
10
  SCHEMA_VAR = '%%SCHEMA%%'
11
11
  TABLE_PARTS_SEPARATOR = '/'
12
12
  TABLES_SQL = "select schemaname || '#{TABLE_PARTS_SEPARATOR}' || tablename from " \
13
- "pg_tables where schemaname = '#{SCHEMA_VAR}'"
13
+ "pg_tables where schemaname = '#{SCHEMA_VAR}'"
14
14
 
15
15
  def do_clear
16
16
  ts = tables
@@ -35,7 +35,7 @@ module Avm
35
35
  # @param table_list [Array<String>]
36
36
  # @return [String]
37
37
  def drop_tables_sql(table_list)
38
- 'drop table ' + table_list.map(&:to_s).join(', ') + ' cascade'
38
+ "drop table #{table_list.map(&:to_s).join(', ')} cascade"
39
39
  end
40
40
 
41
41
  # @param parts [Array<String>, Strings]
@@ -51,8 +51,8 @@ module Avm
51
51
 
52
52
  # @return [Array<String>]
53
53
  def tables
54
- run_sql(tables_sql).each_line.map(&:strip).reject(&:blank?)
55
- .map { |line| join_table_parts(line) }
54
+ run_sql(tables_sql).each_line.map(&:strip).compact_blank
55
+ .map { |line| join_table_parts(line) }
56
56
  end
57
57
 
58
58
  # @return [String]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacPostgresqlBase0
5
- VERSION = '0.5.2'
5
+ VERSION = '0.5.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-eac_postgresql_base0
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-19 00:00:00.000000000 Z
11
+ date: 2024-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -16,48 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.79'
19
+ version: '0.85'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.79'
26
+ version: '0.85'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: eac_ruby_utils
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.119'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 0.119.1
33
+ version: '0.121'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: '0.119'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 0.119.1
40
+ version: '0.121'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: eac_ruby_gem_support
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: 0.5.1
47
+ version: '0.10'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: 0.5.1
54
+ version: '0.10'
61
55
  description:
62
56
  email:
63
57
  executables: []
@@ -82,7 +76,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
76
  requirements:
83
77
  - - ">="
84
78
  - !ruby/object:Gem::Version
85
- version: '0'
79
+ version: '2.7'
86
80
  required_rubygems_version: !ruby/object:Gem::Requirement
87
81
  requirements:
88
82
  - - ">="