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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5dcffe3ba23b17694740ccad32c11d2813f1606b4dfa9b93c63480ebb0e54299
4
- data.tar.gz: b166a621155d4be6f8e7294d46b7a07ead34a711a17a3119cd34c289313d8f62
3
+ metadata.gz: 54cb8f69f002389612e9b89bb2514fecbb351c5aed6d70eb1ed570bc4ec45b6d
4
+ data.tar.gz: 0f4c36563a1eae3360ce0b3e50ef2f80e91fdc4a7a14b35efa9282499f1b9b20
5
5
  SHA512:
6
- metadata.gz: 522afdb2e8c28af25cffd7a298f7caa6e1d964f8551408b7c9200650013d4b2e17c59363e6826011b175269744fb0436a351a79d5d85c5eafcf97d38c2bd7a5a
7
- data.tar.gz: fa0eae28c330618462229826c735b1802e483ae07db63f6a8cc617cfb41f2a70dcf40ddd1ec86ce33b5ea3ec605b47f6b50335f22d456cde919a7bbe8c852663
6
+ metadata.gz: 53a8780bf422b4660d8a360c5580918a6fa84158d9f0111f382932167f1f8bd027b6135b690ff8b56500c71fae4920ef646ae46ae90d6d178d31c53f1763a347
7
+ data.tar.gz: 5551171c38c80efca7d9dca950c251387634889682085e546de58bafc8f8ffd6579d5beaf2993cdbe34897fbc22047e861c6c6cf3b7dcbed37328e50d6a519ea
@@ -45,6 +45,5 @@ jobs:
45
45
  - uses: ruby/setup-ruby@v1
46
46
  with:
47
47
  ruby-version: ${{ matrix.ruby }}
48
- bundler-cache: true
49
48
  - run: bundle update
50
49
  - run: bundle exec rake
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
@@ -175,7 +175,7 @@ GEM
175
175
  thor (1.3.2)
176
176
  tzinfo (2.0.6)
177
177
  concurrent-ruby (~> 1.0)
178
- unicode-display_width (3.1.2)
178
+ unicode-display_width (3.1.3)
179
179
  unicode-emoji (~> 4.0, >= 4.0.4)
180
180
  unicode-emoji (4.0.4)
181
181
  uri (1.0.2)
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
 
@@ -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=#{Shellwords.escape(url)}",
101
+ Shellwords.escape("liquibase.url=#{url}"),
102
102
  '--define',
103
- "liquibase.password=#{Shellwords.escape(password)}",
104
- '2>&1'
103
+ Shellwords.escape("liquibase.password=#{password}")
105
104
  ]
106
105
  )
107
106
  end
@@ -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
- '-c', Shellwords.escape("log_directory=#{home}"),
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
@@ -28,5 +28,5 @@ require_relative '../pgtk'
28
28
  # License:: MIT
29
29
  module Pgtk
30
30
  # Current version of the library.
31
- VERSION = '0.11.0'
31
+ VERSION = '0.12.0'
32
32
  end
@@ -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/pgsql.log')))
72
+ assert(File.exist?(File.join(dir, 'pgsql.log')))
65
73
  end
66
74
  end
67
75
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgtk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko