prick 0.10.0 → 0.11.0

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: 8fa13b0150bd8e2a403643947215116be13d78d33f053e15c766a258574cf79e
4
- data.tar.gz: 8b817641aff64c1ad488ce7562ac03a26c8d2144b3bf79999ef0af0ae910d298
3
+ metadata.gz: 2788abf0737d8f89b08f4dcbe8cf026ffb4927a2a155655b28350c53951c2c1f
4
+ data.tar.gz: a336758b7ff556e11346f7bb0f6da9e949a2d51b7f4f377b24d9e91d0b92af50
5
5
  SHA512:
6
- metadata.gz: 5b0896b4d9d38984cee6f3a3d6481ed4b9607c54101a120aaa4344b701ed649fe7ef5ca25bcb1214aa1802700e80e0bee41aa47157039f4f2774825d0af04f44
7
- data.tar.gz: e19f8f4b6529bc1463f01fdcb5077ddfd55fe970ac062ef8fbbfd79dd31d1c8f74dcef759222cfdbaf4890158ef6b7993ddeb369d8c0499ead2265f20073769a
6
+ metadata.gz: e8352c55f6fd37f84c4495f8c1ffe89b5594f936fe74d500e77fe44a7c5fe367c7995dd6824a446c67c36891af892bc277c4c757fe5e6c60a4b07b12e8698809
7
+ data.tar.gz: 25e407b34434192eb797cb83bd265b6b2b7004341dee7ba7ab8b64582d9730d2a5ea19dacde7eaa9474d2c2f7e96559a0fbdf4d9fb9fc1e07c8ac9fb6a0c55e6
data/lib/prick/builder.rb CHANGED
@@ -7,20 +7,24 @@ module Prick
7
7
  # and is used to match a build file. Build files are looked up in the
8
8
  # following order:
9
9
  #
10
- # #{name}, #{name}.* executable
10
+ # #{name} executable
11
+ # #{name}.* executable
11
12
  # #{name}.yml
12
13
  # #{name}.sql
13
14
  # #{name}/
14
15
  #
16
+ # The output from executable objects is expected to be SQL statements that
17
+ # are fed into postgres
18
+ #
15
19
  # When a resource match a directory, the directory can contain a special
16
20
  # default resource ('build' or 'migrate') that takes over the rest of the
17
21
  # build process for that directory. Typically, you'll use the 'build.yml' or
18
- # 'migrate.yml' to control the build order of the other resources
19
- #
20
- # If a directory doesn't contain a build resource, the resources in the
21
- # directory are built in alphabetic order
22
+ # 'migrate.yml' to control the build order of the other resources If a
23
+ # directory doesn't contain a build resource, the resources in the directory
24
+ # are built in alphabetic order
22
25
  #
23
- # Build SQL scripts are executed with search path set to containing schema
26
+ # Build (but not migration) SQL scripts and executables are executed with
27
+ # search path set to containing schema
24
28
  #
25
29
  class Builder
26
30
  attr_reader :database
@@ -71,12 +75,12 @@ module Prick
71
75
  true
72
76
  end
73
77
 
74
- def do_exe(path)
78
+ def do_exe(path, schema: nil)
75
79
  # puts "do_exe(#{path})"
76
80
  do_dir(path) { |file|
77
81
  lines = Command.command "#{file} #{database.name} #{database.user}" # FIXME Security
78
82
  if @execute
79
- Rdbms.exec_sql(database.name, lines.join("\n"), database.user)
83
+ Rdbms.exec_sql(database.name, lines.join("\n"), user: database.user, schema: schema)
80
84
  else
81
85
  @lines += lines
82
86
  end
@@ -167,6 +171,11 @@ module Prick
167
171
  schema = Dir.getwd.sub(/^.*schema\/([^\/]+)(?:\/.*)?$/, '\1')
168
172
  super(path, schema: schema)
169
173
  end
174
+
175
+ def do_exe(path)
176
+ schema = Dir.getwd.sub(/^.*schema\/([^\/]+)(?:\/.*)?$/, '\1')
177
+ super(path, schema: schema)
178
+ end
170
179
  end
171
180
  end
172
181
 
data/lib/prick/version.rb CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Required by gem
6
6
  module Prick
7
- VERSION = "0.10.0"
7
+ VERSION = "0.11.0"
8
8
  end
9
9
 
10
10
  # Project related code starts here
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.10.0
4
+ version: 0.11.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: 2021-02-11 00:00:00.000000000 Z
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shellopts