prick 0.20.26 → 0.21.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: ef9683d44f849bd5a028f6b450a167fb2433b659b672f9a66568a59629c49fe7
4
- data.tar.gz: 242a6d11790d04054d0e70f6142ba1564730b0d0cc1301cc37a9c3e350442618
3
+ metadata.gz: e8713e1196f35cc6086d3bb32164b6c79fb5e2d73c4e5d8530b9977bf48c4415
4
+ data.tar.gz: 8dde0df50e768126b505bd45163546eeca635c715a4a278ce9b1b6f3ed84c721
5
5
  SHA512:
6
- metadata.gz: db54f4bb1da3d044092c5e6d0189e126d3f8508e8379edb41dbcc55f0b9e72fe9506ece977ca4661cc3269fe055a62eefce89ee4534e6453ad5d05601850a01b
7
- data.tar.gz: 156401d0f3ff5410028d17ec4dff24757ee586579c682a5906f561fe9af253c83da88aebfeba6a422cc2502cd0aadb6af22292d07a06267a75d66ee388e1a291
6
+ metadata.gz: a0341de3eb0bf6db60039aab1c4dd215a0e211bc468674281b6f9ab36ba3ddf35615d89a39029dc9cb06688d786797d929d78e6ceab56d3d2d0511b9ab30780f
7
+ data.tar.gz: 4096b8941033430de62e392620059b6b7d4a9638499f3fe5fb28ab5e59f08a8ef7b47d05b6a1d8ad77d1b02f3e8b66e22cc1d5923cb770cae06bda9c8a380408
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/exe/prick CHANGED
@@ -242,6 +242,7 @@ rescue ShellOpts::Error, Prick::Error => ex
242
242
  ShellOpts.error(ex.message)
243
243
  end
244
244
 
245
+
245
246
  __END__
246
247
 
247
248
  -n,name=NAME
data/lib/builder/node.rb CHANGED
@@ -131,15 +131,20 @@ module Prick
131
131
  @pipe = Command::Pipe.new(to_s, stderr: nil)
132
132
  end
133
133
 
134
- def inspect() "#{path}(#{(args || []).join(", ")})" end
134
+ def inspect() "#{path} #{(args || []).join(" ")}" end
135
135
 
136
136
  protected
137
137
  def read_source
138
- pipe.puts [conn.name, conn.user]
139
- sql = pipe.wait
138
+ begin
139
+ pipe.puts [conn.name, conn.user]
140
+ sql = pipe.wait
141
+ rescue Errno::EPIPE
142
+ raise Prick::Error, "Pipe fail in #{path} called from #{parent.path}\n" +
143
+ "Tip: Read username/database from standard input"
144
+ end
140
145
  if pipe.status != 0
141
146
  $stderr.puts pipe.error
142
- raise Prick::Error, "Failed executing #{pipe.cmd} #{args.join(" ")}"
147
+ raise Prick::Error, "Failed executing #{path} called from #{parent.path}"
143
148
  end
144
149
  @source_lines = 1 + 1 + sql.count("\n")
145
150
  ["set search_path to #{schema};\n", sql]
@@ -82,7 +82,7 @@ module Prick
82
82
  name.sub!(/\/$/, "")
83
83
  if name =~ /^(\S+)\s+(.*)$/ # exe
84
84
  file = $1
85
- args = $2
85
+ args = $2.split
86
86
  else
87
87
  file = name
88
88
  end
@@ -111,8 +111,6 @@ module Prick
111
111
  path, name, file, args = parse_file_entry(dir, entry)
112
112
  if File.directory? path
113
113
  parse_directory(unit, path)
114
- elsif File.executable? path
115
- ExeNode.new(unit, phase, path, args)
116
114
  elsif File.file? path
117
115
  case path
118
116
  when /\.sql$/
@@ -120,7 +118,11 @@ module Prick
120
118
  when /\.fox$/
121
119
  FoxNode.new(unit, :seed, path)
122
120
  else
123
- raise Error, "Unrecognized file type #{File.basename(path)} in #{dir}"
121
+ if File.executable? path
122
+ ExeNode.new(unit, phase, path, args)
123
+ else
124
+ raise Error, "Unrecognized file type #{File.basename(path)} in #{dir}"
125
+ end
124
126
  end
125
127
  else
126
128
  raise Error, "Can't find #{name} in #{dir} from #{unit}"
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.26"
4
+ VERSION = "0.21.0"
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.26
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-12 00:00:00.000000000 Z
11
+ date: 2022-07-20 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
  - - ">="