prick 0.40.3 → 0.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/prick/version.rb +1 -1
  3. data/lib/prick.rb +14 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b66e68bf5c00a531bddd762ce76357bc5e4c0c3aa7e8622cee61451d6d338b42
4
- data.tar.gz: 3d61860d6c2d84961fd390fcac1753a89b3ce3b68aa701c699df969150a3b4a8
3
+ metadata.gz: 285b5f300185bd9b00e975ab4a4bdffc46a5db68606325b77dfa025ba2ce23d7
4
+ data.tar.gz: 0b569c4d26020f1d29be322ff94a2f80ae2461dc4422a989850415a04166d614
5
5
  SHA512:
6
- metadata.gz: 5b04b72a101ab8e8f8a6d8bdc3675f02b6f38d3b63daabb38ff4cb664ffe05b598b80175cc9b4c75bed93cfc9a6afd253a0c767e38d08544f45047ad44808a1e
7
- data.tar.gz: 9fd135fd3df5ec9b15b663ed95604aa93af13b4f76985ab035051c2a4962947f586aaad90e0eff2b78908fd0f68e2601dc0bbfb87b104322e7111a4b5d99bdf6
6
+ metadata.gz: '02196f54ea306130af2dc43337e4cb2408a7ce2872df6e0aa355cfb141a5067e5d0fb71f4e9650882be086c856c28ed1438704343f8177225cea676f6705d072'
7
+ data.tar.gz: 4f6288490ad69c85e5638c0b22dd973673b27ec204b6366efbdd00bb4228f7d1e2a3c8d741bedb2f07df6b723b57901c2a5e24168d9195490ad04f3ba2527c8c
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.40.3"
4
+ VERSION = "0.41.0"
5
5
  end
data/lib/prick.rb CHANGED
@@ -1,6 +1,20 @@
1
1
 
2
2
  require 'pg_conn'
3
3
 
4
+ # Find project root dir and set load path to include ./lib
5
+ dir = Dir.getwd
6
+ while dir != "/" && !File.exist?("#{dir}/prick.yml")
7
+ dir = File.dirname(dir)
8
+ end
9
+
10
+ if dir == "/"
11
+ defined?(RSpec) or raise ArgumentError, "Can't find prick project directory"
12
+ else
13
+ $LOAD_PATH.unshift("#{dir}/lib")
14
+ end
15
+
16
+ # Create a new database connection or an existing connection. The connection
17
+ # exists when the script is run by prick as a subprocess using fork
4
18
  module Prick
5
19
  def self.conn(database, username = nil)
6
20
  if self.respond_to?(:owner_conn)
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.40.3
4
+ version: 0.41.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: 2024-10-10 00:00:00.000000000 Z
11
+ date: 2024-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic