prick 0.20.28 → 0.21.1

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: 722515198da4c147ce92b509e47ab06a18f6dcb0e55dffee916047d48086dde9
4
- data.tar.gz: 3fa9993f901a7f17af137d5bdf45663cb632b5563b6e5fee3bedd2c903105aad
3
+ metadata.gz: 851c4a7b6184883fd38a03f5a96af408640f76fcd424859947e0aa70a91b3f81
4
+ data.tar.gz: 9c04deb3aadf390833b6bd3b3def242069b75b9cfad297e3287900067d33bbbe
5
5
  SHA512:
6
- metadata.gz: 5ff2373784785d306415949290f208e2b5747152c965252ac05ed4f8c00c5a899c463ac56ef4fae0eea8a9b22e2ac3d261380611adef3b43854451986ee28cf3
7
- data.tar.gz: 0baf00ac8c4ff4ce4c2ea741589576cb2cda5dcba130bf5b425f0a73861383dda1facb5214559a2141aab16fb5177750587d5ab9def80fd9f3e904d8f7f5b2b6
6
+ metadata.gz: ce3215c329264d1e9948aba65c2e15085b17b868270abb4e8539d4a14c82ff353a0e3986e5b1b1bd3548b23188629a906008d735a759a47b70a883d2b289604c
7
+ data.tar.gz: e75dd4f658cd3a7283d70e1e0bdff064063f062cdd0c7560dae682aa1c9c0679a5dd3be69fbabc67f396041e811fd9620cfc6c4a7b3d32c527dfb64300c7c25f
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.1
1
+ ruby-3.1.2
data/TODO CHANGED
@@ -1,3 +1,6 @@
1
+ o Use mikras_root(1) to be able to run from any subdirectory
2
+ o Add 'prick build .' and 'prick make .'
3
+
1
4
  o Fix that enum references are not created:
2
5
 
3
6
  system_roles
@@ -8,8 +11,6 @@ o Fix that enum references are not created:
8
11
  permissions:
9
12
  - *app_registry_anon_permission
10
13
 
11
-
12
-
13
14
  o Store fox.state, reflections, and reflections in the database so third-party
14
15
  programs can use them when testing
15
16
  o 'prick make <resource>' should build everything up the resource, then commit
@@ -21,6 +22,37 @@ o Build functions after schema so that there are no order dependencies on
21
22
  functions. Problem is to detect function files
22
23
  o Build views after schema so that there are no order dependencies on
23
24
  views. Problem is to detect view files
25
+ o Detect file types dynamically by grepping for "create" statements
26
+
27
+ o Add dependencies to build files:
28
+
29
+ schema: app_registry
30
+ require:
31
+ - sys_registry
32
+ - websys
33
+
34
+ schema: websys
35
+ require:
36
+ - $prod, $online
37
+ - fdw_websys
38
+ - sys_registry
39
+
40
+ o Maybe extend build.yml syntax with conditionals. Eg.
41
+
42
+ - tables.sql
43
+ - $prod:
44
+ - prod_data.fox
45
+ - $dev:
46
+ - dev_debug.sql
47
+ - dev_data.fox
48
+ - $else:
49
+ - not_dev_data.fox
50
+ - $online:
51
+ - fdw_schema.sql
52
+ - not $online:
53
+ - fdw_schema_copy.sql
54
+ - $env in $proc, $online:
55
+ - fdw_operation.sql
24
56
 
25
57
  + prick release major|minor|patch
26
58
  + Check modification time of build.yml files too
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.20.28"
4
+ VERSION = "0.21.1"
5
5
  end
data/prick.gemspec CHANGED
@@ -34,13 +34,12 @@ Gem::Specification.new do |spec|
34
34
  spec.add_dependency "constrain"
35
35
  spec.add_dependency "forward_to"
36
36
  spec.add_dependency "bootsnap"
37
- spec.add_dependency "fixture_fox", "~> 0.1.3"
37
+ spec.add_dependency "fixture_fox"
38
38
  spec.add_dependency "postspec"
39
- spec.add_dependency "pg_graph", "~> 0.1.8"
40
- spec.add_dependency "shellopts", "~> 2.0.24"
39
+ spec.add_dependency "pg_graph"
40
+ spec.add_dependency "shellopts"
41
41
 
42
42
  spec.add_development_dependency "ruby-prof"
43
- spec.add_development_dependency "dbutils"
44
43
 
45
44
  # Also un-comment in spec/spec_helper to use simplecov
46
45
  # spec.add_development_dependency "simplecov"
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.20.28
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-06-24 00:00:00.000000000 Z
11
+ date: 2022-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: fixture_fox
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.1.3
89
+ version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.1.3
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: postspec
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -112,38 +112,24 @@ dependencies:
112
112
  name: pg_graph
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 0.1.8
117
+ version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 0.1.8
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: shellopts
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 2.0.24
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 2.0.24
139
- - !ruby/object:Gem::Dependency
140
- name: ruby-prof
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
129
  - - ">="
144
130
  - !ruby/object:Gem::Version
145
131
  version: '0'
146
- type: :development
132
+ type: :runtime
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
@@ -151,7 +137,7 @@ dependencies:
151
137
  - !ruby/object:Gem::Version
152
138
  version: '0'
153
139
  - !ruby/object:Gem::Dependency
154
- name: dbutils
140
+ name: ruby-prof
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
143
  - - ">="
@@ -229,7 +215,7 @@ files:
229
215
  homepage: http://www.nowhere.com/
230
216
  licenses: []
231
217
  metadata: {}
232
- post_install_message:
218
+ post_install_message:
233
219
  rdoc_options: []
234
220
  require_paths:
235
221
  - lib
@@ -244,8 +230,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
230
  - !ruby/object:Gem::Version
245
231
  version: '0'
246
232
  requirements: []
247
- rubygems_version: 3.1.2
248
- signing_key:
233
+ rubygems_version: 3.3.18
234
+ signing_key:
249
235
  specification_version: 4
250
236
  summary: A release control and management system for postgresql
251
237
  test_files: []