pgtk 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rultor.yml +2 -2
- data/README.md +9 -4
- data/lib/pgtk/liquibase_task.rb +17 -10
- data/lib/pgtk/version.rb +1 -1
- data/test/test_liquibase_task.rb +11 -0
- 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: 0cdeccc0e450065c83781128c70c55fb51a7ea539b0825f2489d17a73f4d130c
|
4
|
+
data.tar.gz: 3e0e70bbf2fe76c2f355691b91d6a537a96e2a75d4826ff223ecd51daf209b24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ace41790bf37bf7319ef64c3ab4265aa12acd32d278f1eef52e828d2e1ea2a93913f0f5cd6be91cd63531b3ecdafcbeac74a7bebca53e2c1f04cd9fc4995adc
|
7
|
+
data.tar.gz: 4c9794a675196ca1d15aff36f7534f12764425bae8e24dc1e6e781712cc9cce00bfd51499e6e06c9785312d76a03ee7e992c353e6d2cd06447f3ddbcce477c3b
|
data/.rultor.yml
CHANGED
@@ -3,10 +3,10 @@ docker:
|
|
3
3
|
assets:
|
4
4
|
rubygems.yml: yegor256/home#assets/rubygems.yml
|
5
5
|
install: |
|
6
|
-
sudo chown -R "$(whoami)" /usr/local/rvm
|
7
6
|
pdd -f /dev/null
|
8
|
-
bundle install --no-color
|
7
|
+
bundle install --no-color
|
9
8
|
release:
|
9
|
+
pre: false
|
10
10
|
script: |-
|
11
11
|
[[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
|
12
12
|
bundle exec rake
|
data/README.md
CHANGED
@@ -50,13 +50,16 @@ Pgtk::PgsqlTask.new :pgsql do |t|
|
|
50
50
|
end
|
51
51
|
```
|
52
52
|
|
53
|
-
And this too:
|
53
|
+
And this too ([org.postgresql:postgresql](https://mvnrepository.com/artifact/org.postgresql/postgresql) and [org.liquibase:liquibase-maven-plugin](https://mvnrepository.com/artifact/org.liquibase/liquibase-maven-plugin) are used inside):
|
54
54
|
|
55
55
|
```ruby
|
56
56
|
require 'pgtk/liquibase_task'
|
57
57
|
Pgtk::LiquibaseTask.new liquibase: :pgsql do |t|
|
58
58
|
t.master = 'liquibase/master.xml' # Master XML file path
|
59
59
|
t.yaml = ['target/pgsql-config.yml', 'config.yml'] # YAML files with connection details
|
60
|
+
t.quiet = false # TRUE by default
|
61
|
+
t.postgresql_version = '42.7.0' # overwriting default version
|
62
|
+
t.liquibase_version = '3.2.2' # overwriting default version
|
60
63
|
end
|
61
64
|
```
|
62
65
|
|
@@ -129,10 +132,12 @@ end
|
|
129
132
|
|
130
133
|
Should work.
|
131
134
|
|
132
|
-
Well, it works in
|
135
|
+
Well, it works in
|
136
|
+
[netbout.com](https://github.com/yegor256/netbout),
|
137
|
+
[wts.zold.io](https://github.com/zold-io/wts.zold.io),
|
133
138
|
[mailanes.com](https://github.com/yegor256/mailanes), and
|
134
|
-
[0rsk.com](https://github.com/yegor256/0rsk).
|
135
|
-
open source, you can see how they use `pgtk`.
|
139
|
+
[0rsk.com](https://github.com/yegor256/0rsk).
|
140
|
+
They are all open source, you can see how they use `pgtk`.
|
136
141
|
|
137
142
|
## How to contribute
|
138
143
|
|
data/lib/pgtk/liquibase_task.rb
CHANGED
@@ -54,17 +54,24 @@ class Pgtk::LiquibaseTask < Rake::TaskLib
|
|
54
54
|
def run
|
55
55
|
raise "Option 'master' is mandatory" unless @master
|
56
56
|
raise "Option 'yaml' is mandatory" unless @yaml
|
57
|
-
yml =
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
57
|
+
yml = @yaml
|
58
|
+
unless yml.is_a?(Hash)
|
59
|
+
yml = YAML.load_file(
|
60
|
+
if @yaml.is_a?(Array)
|
61
|
+
@yaml.drop_while { |f| !File.exist?(f) }.first
|
62
|
+
else
|
63
|
+
@yaml
|
64
|
+
end
|
65
|
+
)
|
66
|
+
end
|
67
|
+
raise "YAML configuration is missing the 'pgsql' section" unless yml['pgsql']
|
67
68
|
@master = File.expand_path(@master)
|
69
|
+
unless File.exist?(@master)
|
70
|
+
raise "Liquibase master is absent at '#{@master}'. \
|
71
|
+
More about this file you can find in Liquibase documentation: \
|
72
|
+
https://docs.liquibase.com/concepts/changelogs/xml-format.html"
|
73
|
+
end
|
74
|
+
pom = File.expand_path(File.join(__dir__, '../../resources/pom.xml'))
|
68
75
|
Dir.chdir(File.dirname(@master)) do
|
69
76
|
system(
|
70
77
|
[
|
data/lib/pgtk/version.rb
CHANGED
data/test/test_liquibase_task.rb
CHANGED
@@ -53,4 +53,15 @@ class TestLiquibaseTask < Minitest::Test
|
|
53
53
|
Rake::Task['liquibase2'].invoke
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
def test_with_invalid_master_file
|
58
|
+
Pgtk::LiquibaseTask.new(:lb) do |t|
|
59
|
+
t.master = 'the-file-doesnt-exist.xml'
|
60
|
+
t.yaml = { 'pgsql' => {} }
|
61
|
+
end
|
62
|
+
ex = assert_raises do
|
63
|
+
Rake::Task['lb'].invoke
|
64
|
+
end
|
65
|
+
assert(ex.message.include?('the-file-doesnt-exist.xml'))
|
66
|
+
end
|
56
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pgtk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|