prick 0.21.0 → 0.21.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/builder/batch.rb +2 -1
- data/lib/builder/node.rb +5 -0
- data/lib/builder/parser.rb +2 -1
- data/lib/local/command.rb +2 -1
- data/lib/prick/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 851c4a7b6184883fd38a03f5a96af408640f76fcd424859947e0aa70a91b3f81
|
4
|
+
data.tar.gz: 9c04deb3aadf390833b6bd3b3def242069b75b9cfad297e3287900067d33bbbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce3215c329264d1e9948aba65c2e15085b17b868270abb4e8539d4a14c82ff353a0e3986e5b1b1bd3548b23188629a906008d735a759a47b70a883d2b289604c
|
7
|
+
data.tar.gz: e75dd4f658cd3a7283d70e1e0bdff064063f062cdd0c7560dae682aa1c9c0679a5dd3be69fbabc67f396041e811fd9620cfc6c4a7b3d32c527dfb64300c7c25f
|
data/lib/builder/batch.rb
CHANGED
@@ -9,7 +9,7 @@ module Prick
|
|
9
9
|
def kind() @nodes.first&.kind end
|
10
10
|
attr_reader :nodes
|
11
11
|
|
12
|
-
def initialize(builder)
|
12
|
+
def initialize(builder)
|
13
13
|
@builder = builder
|
14
14
|
@nodes = []
|
15
15
|
end
|
@@ -32,6 +32,7 @@ module Prick
|
|
32
32
|
super {
|
33
33
|
begin
|
34
34
|
sql = []
|
35
|
+
# A SQL batch allows the first node to be an executable
|
35
36
|
if nodes.first.is_a?(ExeNode)
|
36
37
|
time "Execute script" do
|
37
38
|
sql = [nodes.first.source]
|
data/lib/builder/node.rb
CHANGED
@@ -37,6 +37,7 @@ module Prick
|
|
37
37
|
@parent, @phase, @kind, @path = parent, phase, kind, path
|
38
38
|
@args = args&.empty? ? nil : args
|
39
39
|
@schema = nil
|
40
|
+
@source = nil
|
40
41
|
@source_lines = nil
|
41
42
|
end
|
42
43
|
|
@@ -138,6 +139,10 @@ module Prick
|
|
138
139
|
begin
|
139
140
|
pipe.puts [conn.name, conn.user]
|
140
141
|
sql = pipe.wait
|
142
|
+
rescue Command::Error => ex
|
143
|
+
message = "prick: Error executing '#{to_s}'\n" + ex.stderr.map { |l| " #{l}" }.join("\n")
|
144
|
+
raise Prick::Error.new(message)
|
145
|
+
|
141
146
|
rescue Errno::EPIPE
|
142
147
|
raise Prick::Error, "Pipe fail in #{path} called from #{parent.path}\n" +
|
143
148
|
"Tip: Read username/database from standard input"
|
data/lib/builder/parser.rb
CHANGED
@@ -95,7 +95,8 @@ module Prick
|
|
95
95
|
entry.size == 1 or raise Error, "sql and module are single-line values"
|
96
96
|
key, value = entry.first
|
97
97
|
case key
|
98
|
-
when "sql"
|
98
|
+
when "sql"
|
99
|
+
InlineNode.new(unit, phase, unit.path, value)
|
99
100
|
when "call"
|
100
101
|
args = value.split(/\s+/)
|
101
102
|
args.size >= 3 or raise "Illegal number of arguments: #{value}"
|
data/lib/local/command.rb
CHANGED
@@ -171,7 +171,8 @@ module Command
|
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
174
|
-
# Exit status of the last command
|
174
|
+
# Exit status of the last command. FIXME: This is not usable because the
|
175
|
+
# methods raise an exception if the command exited with anything but 0
|
175
176
|
def status() @status end
|
176
177
|
|
177
178
|
# Stored exception when #command is called with :fail true
|
data/lib/prick/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic
|
@@ -215,7 +215,7 @@ files:
|
|
215
215
|
homepage: http://www.nowhere.com/
|
216
216
|
licenses: []
|
217
217
|
metadata: {}
|
218
|
-
post_install_message:
|
218
|
+
post_install_message:
|
219
219
|
rdoc_options: []
|
220
220
|
require_paths:
|
221
221
|
- lib
|
@@ -230,8 +230,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
- !ruby/object:Gem::Version
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
|
-
rubygems_version: 3.
|
234
|
-
signing_key:
|
233
|
+
rubygems_version: 3.3.18
|
234
|
+
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: A release control and management system for postgresql
|
237
237
|
test_files: []
|