prick 0.21.0 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8713e1196f35cc6086d3bb32164b6c79fb5e2d73c4e5d8530b9977bf48c4415
4
- data.tar.gz: 8dde0df50e768126b505bd45163546eeca635c715a4a278ce9b1b6f3ed84c721
3
+ metadata.gz: 45486f141eabdfa21f47abbe77a587a30602edb1bb5b2bb99d1dc1e263f7fe9e
4
+ data.tar.gz: e6b9f2bf98cc0f316108f56bf608f65b1247cb7e8ca4e1d40b15f0d0de69df01
5
5
  SHA512:
6
- metadata.gz: a0341de3eb0bf6db60039aab1c4dd215a0e211bc468674281b6f9ab36ba3ddf35615d89a39029dc9cb06688d786797d929d78e6ceab56d3d2d0511b9ab30780f
7
- data.tar.gz: 4096b8941033430de62e392620059b6b7d4a9638499f3fe5fb28ab5e59f08a8ef7b47d05b6a1d8ad77d1b02f3e8b66e22cc1d5923cb770cae06bda9c8a380408
6
+ metadata.gz: 9e809ccc697d019e259d73b0700f0c79555fc6d47699c12f96285bf62c236b03531d52f1fbb48c973b9bcac00cc382ad8d415f96e54790a69cc4e7e9198e13b6
7
+ data.tar.gz: 6292aec4350d08659e2333c9ed9a0e23876b9c85b74aaebea730ab4628ea10985bb38136d881481cc27935b79bba7ddcf2fbe3026bac0ad5fab8431ba433db80
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"
@@ -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"; InlineNode.new(unit, phase, unit.path, value)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Prick
4
- VERSION = "0.21.0"
4
+ VERSION = "0.21.2"
5
5
  end
@@ -35,8 +35,10 @@ module Prick::SubCommand
35
35
  # database
36
36
  refresh_schemas = conn.schema.list
37
37
 
38
- # Find existing keep-schemas
39
- keep_schemas = builder.keep_schemas.select { |s| conn.schema.exist?(s) }
38
+ # Find existing keep-schemas (but exclude target schema)
39
+ keep_schemas = builder.keep_schemas.select { |s|
40
+ conn.schema.exist?(s) && (schema.nil? || schema != s)
41
+ }
40
42
 
41
43
  # Remove keep-schemas from list of schemas
42
44
  refresh_schemas -= keep_schemas
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.0
4
+ version: 0.21.2
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-07-20 00:00:00.000000000 Z
11
+ date: 2022-11-10 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.1.2
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: []