pgtk 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +0 -1
- data/.rultor.yml +0 -1
- data/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/lib/pgtk/liquibase_task.rb +5 -6
- data/lib/pgtk/pgsql_task.rb +3 -5
- data/lib/pgtk/version.rb +1 -1
- data/test/test_pgsql_task.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54cb8f69f002389612e9b89bb2514fecbb351c5aed6d70eb1ed570bc4ec45b6d
|
4
|
+
data.tar.gz: 0f4c36563a1eae3360ce0b3e50ef2f80e91fdc4a7a14b35efa9282499f1b9b20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a8780bf422b4660d8a360c5580918a6fa84158d9f0111f382932167f1f8bd027b6135b690ff8b56500c71fae4920ef646ae46ae90d6d178d31c53f1763a347
|
7
|
+
data.tar.gz: 5551171c38c80efca7d9dca950c251387634889682085e546de58bafc8f8ffd6579d5beaf2993cdbe34897fbc22047e861c6c6cf3b7dcbed37328e50d6a519ea
|
data/.github/workflows/rake.yml
CHANGED
data/.rultor.yml
CHANGED
@@ -23,7 +23,6 @@ docker:
|
|
23
23
|
assets:
|
24
24
|
rubygems.yml: yegor256/home#assets/rubygems.yml
|
25
25
|
install: |
|
26
|
-
sudo hostname docker
|
27
26
|
sudo apt-get update
|
28
27
|
sudo apt-get install -y libpq-dev postgresql-client postgresql
|
29
28
|
sudo ln -s "$(realpath /usr/lib/postgresql/*/bin/initdb)" /bin/initdb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -50,6 +50,10 @@ Pgtk::PgsqlTask.new :pgsql do |t|
|
|
50
50
|
t.password = 'test'
|
51
51
|
t.dbname = 'test'
|
52
52
|
t.yaml = 'target/pgsql-config.yml' # YAML file to be created with connection details
|
53
|
+
t.config = { # list of PostgreSQL configuration options
|
54
|
+
log_min_messages: 'ERROR',
|
55
|
+
log_filename: 'target/pg.log'
|
56
|
+
}
|
53
57
|
end
|
54
58
|
```
|
55
59
|
|
data/lib/pgtk/liquibase_task.rb
CHANGED
@@ -82,7 +82,7 @@ class Pgtk::LiquibaseTask < Rake::TaskLib
|
|
82
82
|
Dir.chdir(File.dirname(@master)) do
|
83
83
|
qbash(
|
84
84
|
[
|
85
|
-
'mvn verify',
|
85
|
+
'mvn', 'verify',
|
86
86
|
'--errors',
|
87
87
|
'--batch-mode',
|
88
88
|
'--fail-fast',
|
@@ -94,14 +94,13 @@ class Pgtk::LiquibaseTask < Rake::TaskLib
|
|
94
94
|
'--define',
|
95
95
|
"postgresql.version=#{@postgresql_version}",
|
96
96
|
'--define',
|
97
|
-
"liquibase.searchPath=#{File.dirname(@master)}",
|
97
|
+
Shellwords.escape("liquibase.searchPath=#{File.dirname(@master)}"),
|
98
98
|
'--define',
|
99
|
-
"liquibase.changeLogFile=#{old ? @master : File.basename(@master)}",
|
99
|
+
Shellwords.escape("liquibase.changeLogFile=#{old ? @master : File.basename(@master)}"),
|
100
100
|
'--define',
|
101
|
-
"liquibase.url=#{
|
101
|
+
Shellwords.escape("liquibase.url=#{url}"),
|
102
102
|
'--define',
|
103
|
-
"liquibase.password=#{
|
104
|
-
'2>&1'
|
103
|
+
Shellwords.escape("liquibase.password=#{password}")
|
105
104
|
]
|
106
105
|
)
|
107
106
|
end
|
data/lib/pgtk/pgsql_task.rb
CHANGED
@@ -36,7 +36,7 @@ require_relative '../pgtk'
|
|
36
36
|
# Copyright:: Copyright (c) 2019-2024 Yegor Bugayenko
|
37
37
|
# License:: MIT
|
38
38
|
class Pgtk::PgsqlTask < Rake::TaskLib
|
39
|
-
attr_accessor :name, :dir, :fresh_start, :user, :password, :dbname, :yaml, :quiet, :port
|
39
|
+
attr_accessor :name, :dir, :fresh_start, :user, :password, :dbname, :yaml, :quiet, :port, :config
|
40
40
|
|
41
41
|
def initialize(*args, &task_block)
|
42
42
|
super()
|
@@ -44,6 +44,7 @@ class Pgtk::PgsqlTask < Rake::TaskLib
|
|
44
44
|
@fresh_start = false
|
45
45
|
@quiet = false
|
46
46
|
@user = 'test'
|
47
|
+
@config = {}
|
47
48
|
@password = 'test'
|
48
49
|
@dbname = 'test'
|
49
50
|
@port = nil
|
@@ -92,10 +93,7 @@ class Pgtk::PgsqlTask < Rake::TaskLib
|
|
92
93
|
'postgres',
|
93
94
|
'-k', Shellwords.escape(home),
|
94
95
|
'-D', Shellwords.escape(home),
|
95
|
-
|
96
|
-
'-c', 'logging_collector=on',
|
97
|
-
'-c', 'log_statement=all',
|
98
|
-
'-c', 'log_filename=pgsql.log',
|
96
|
+
@config.map { |k, v| "-c #{Shellwords.escape("#{k}=#{v}")}" },
|
99
97
|
"--port=#{port}"
|
100
98
|
].join(' ')
|
101
99
|
pid = Process.spawn(
|
data/lib/pgtk/version.rb
CHANGED
data/test/test_pgsql_task.rb
CHANGED
@@ -40,11 +40,13 @@ class TestPgsqlTask < Minitest::Test
|
|
40
40
|
t.dbname = 'test'
|
41
41
|
t.yaml = File.join(dir, 'cfg.yml')
|
42
42
|
t.quiet = true
|
43
|
+
t.config = {
|
44
|
+
log_min_error_statement: 'ERROR'
|
45
|
+
}
|
43
46
|
end
|
44
47
|
Rake::Task['p2'].invoke
|
45
48
|
yaml = YAML.load_file(File.join(dir, 'cfg.yml'))
|
46
49
|
assert(yaml['pgsql']['url'].start_with?('jdbc:postgresql://localhost'))
|
47
|
-
assert(File.exist?(File.join(dir, 'pgsql/pgsql.log')))
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
@@ -57,11 +59,17 @@ class TestPgsqlTask < Minitest::Test
|
|
57
59
|
t.dbname = 'test'
|
58
60
|
t.yaml = File.join(dir, 'cfg.yml')
|
59
61
|
t.quiet = false
|
62
|
+
t.config = {
|
63
|
+
log_directory: dir,
|
64
|
+
logging_collector: 'on',
|
65
|
+
log_statement: 'all',
|
66
|
+
log_filename: 'pgsql.log'
|
67
|
+
}
|
60
68
|
end
|
61
69
|
Rake::Task['p3'].invoke
|
62
70
|
yaml = YAML.load_file(File.join(dir, 'cfg.yml'))
|
63
71
|
assert(yaml['pgsql']['url'].start_with?('jdbc:postgresql://localhost'))
|
64
|
-
assert(File.exist?(File.join(dir, 'pgsql
|
72
|
+
assert(File.exist?(File.join(dir, 'pgsql.log')))
|
65
73
|
end
|
66
74
|
end
|
67
75
|
end
|