prick 0.20.16 → 0.20.19
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 +4 -4
- data/exe/prick +1 -0
- data/lib/builder/batch.rb +1 -1
- data/lib/builder/builder.rb +0 -2
- data/lib/builder/parser.rb +21 -11
- data/lib/prick/version.rb +1 -1
- data/lib/subcommand/prick-build.rb +5 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 523f3f63b46850833fd679103f6a2ed389fee673376be4ffd54ab85ed76e9dfb
|
4
|
+
data.tar.gz: 58d881d1e9a5ebaea7b16caf35fc7d34670a6fa7f1a404357463f3dbbb73e81c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5f95a314a5dbaddef93d4e184ed5c10c35118b6e29f8ac8111589e4e79031dc83f254345853da84591edb9b511c5eab299dfa6716dc8db91b70361fe56ada12
|
7
|
+
data.tar.gz: '08eef7aaeea483bd45956898d290d69bb2859d41caafcc2ea64ce45bd9c2edd348a0cb003ba76054192e078fae3cf325c009ddb271d5d9e863915eb8eed95fe7'
|
data/exe/prick
CHANGED
data/lib/builder/batch.rb
CHANGED
@@ -138,7 +138,7 @@ module Prick
|
|
138
138
|
# FIXME: Why only in FoxBatch - should be set higher up in the system
|
139
139
|
conn.execute "update prick.versions set built_at = now() at time zone 'UTC'"
|
140
140
|
rescue PG::SyntaxError, PG::Error => ex
|
141
|
-
raise PostgresError, "prick: #{
|
141
|
+
raise PostgresError, "prick: #{ex.message}"
|
142
142
|
end
|
143
143
|
}
|
144
144
|
t_type.emit
|
data/lib/builder/builder.rb
CHANGED
@@ -93,8 +93,6 @@ module Prick
|
|
93
93
|
def execute(conn, create_schemas: schemas)
|
94
94
|
group if batches.nil?
|
95
95
|
conn.exec create_schemas.grep_v("public").map { |schema| "create schema #{schema}" }
|
96
|
-
conn.schema.create("public", authorization: "postgres")
|
97
|
-
conn.exec "grant usage, create on schema public to public"
|
98
96
|
for batch in batches
|
99
97
|
batch.execute
|
100
98
|
end
|
data/lib/builder/parser.rb
CHANGED
@@ -76,30 +76,39 @@ module Prick
|
|
76
76
|
unit
|
77
77
|
end
|
78
78
|
|
79
|
+
def parse_file_entry(dir, entry)
|
80
|
+
name = entry.dup
|
81
|
+
name.sub!(/\$ENVIRONMENT/, Prick.state.environment.to_s)
|
82
|
+
name.sub!(/\/$/, "")
|
83
|
+
if name =~ /^(\S+)\s+(.*)$/ # exe
|
84
|
+
file = $1
|
85
|
+
args = $2
|
86
|
+
else
|
87
|
+
file = name
|
88
|
+
end
|
89
|
+
path = "#{dir}/#{file}"
|
90
|
+
[path, name, file, args]
|
91
|
+
end
|
92
|
+
|
79
93
|
def parse_entry(unit, phase, dir, entry)
|
80
94
|
if entry.is_a?(Hash)
|
81
95
|
entry.size == 1 or raise Error, "sql and module are single-line values"
|
82
96
|
key, value = entry.first
|
83
97
|
case key
|
84
98
|
when "sql"; InlineNode.new(unit, phase, unit.path, value)
|
85
|
-
when "call"
|
99
|
+
when "call"
|
86
100
|
args = value.split(/\s+/)
|
87
101
|
args.size >= 3 or raise "Illegal number of arguments: #{value}"
|
88
102
|
file, klass, command, args = *args
|
89
103
|
ModuleNode.new(unit, phase, "#{dir}/#{file}", klass, command, args)
|
104
|
+
when "exec"
|
105
|
+
path, name, file, args = parse_file_entry(dir, value)
|
106
|
+
ExeNode.new(unit, phase, path, args)
|
90
107
|
else
|
91
108
|
raise Error, "Illegal key: #{key}"
|
92
109
|
end
|
93
110
|
else
|
94
|
-
name = entry
|
95
|
-
name.sub!(/\/$/, "")
|
96
|
-
if name =~ /^(\S+)\s+(.*)$/ # exe
|
97
|
-
file = $1
|
98
|
-
args = $2
|
99
|
-
else
|
100
|
-
file = name
|
101
|
-
end
|
102
|
-
path = "#{dir}/#{file}"
|
111
|
+
path, name, file, args = parse_file_entry(dir, entry)
|
103
112
|
if File.directory? path
|
104
113
|
parse_directory(unit, path)
|
105
114
|
elsif File.executable? path
|
@@ -111,7 +120,7 @@ module Prick
|
|
111
120
|
when /\.fox$/
|
112
121
|
FoxNode.new(unit, :seed, path)
|
113
122
|
else
|
114
|
-
raise Error, "Unrecognized file type #{File.basename(path)} in #{
|
123
|
+
raise Error, "Unrecognized file type #{File.basename(path)} in #{dir}"
|
115
124
|
end
|
116
125
|
else
|
117
126
|
raise Error, "Can't find #{name} in #{dir} from #{unit}"
|
@@ -121,3 +130,4 @@ module Prick
|
|
121
130
|
end
|
122
131
|
end
|
123
132
|
end
|
133
|
+
|
data/lib/prick/version.rb
CHANGED
@@ -27,7 +27,7 @@ module Prick::SubCommand
|
|
27
27
|
|
28
28
|
if exist
|
29
29
|
if force
|
30
|
-
# Drop all schemas
|
30
|
+
# Drop all schemas but re-creates the public schema
|
31
31
|
super_conn.rdbms.empty!(database)
|
32
32
|
|
33
33
|
else
|
@@ -46,6 +46,10 @@ module Prick::SubCommand
|
|
46
46
|
|
47
47
|
# Drop refresh schemes
|
48
48
|
refresh_schemas.each { |schema| conn.schema.drop(schema, cascade: true) }
|
49
|
+
|
50
|
+
# Re-create public schema
|
51
|
+
conn.schema.create("public", authorization: "postgres")
|
52
|
+
conn.exec "grant usage, create on schema public to public"
|
49
53
|
end
|
50
54
|
end
|
51
55
|
|
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.
|
4
|
+
version: 0.20.19
|
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-
|
11
|
+
date: 2022-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic
|
@@ -230,7 +230,7 @@ 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.
|
233
|
+
rubygems_version: 3.1.2
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: A release control and management system for postgresql
|