mikras_utils 0.16.2 → 0.17.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 +4 -4
- data/lib/mikras.rb +21 -9
- data/lib/mikras_utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c816a28ca581275c40dcf3d0b66bf42948bcac6366b5cae0f3409cb58598dcd
|
4
|
+
data.tar.gz: 101f1ec84af04826df059cbfa1cd189d74c5d701da8e462c98201ea0f684e0be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32c2be8417aa64fc1826e45fc5e75c2b97e12b1b1d3cd9d7609c8fbebbb3bee712ed3fd210293031febe0b4d9818779d7eb069549ec4d16ac1f469c11894bb0c
|
7
|
+
data.tar.gz: b0e550f9ef58738abfd7274d1c53e556ea4e2a096559cb4981f35e14abaa0f28b39d39a8cfdc8ffbad1d8ffe96f1eb2aab7567db6a8dd994d886a40d55381f98
|
data/lib/mikras.rb
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
|
2
|
+
# General include file for Mikras scripts that sets up core constants and ruby
|
3
|
+
# include path. It is installed in a gem so that it can be found before the
|
4
|
+
# environment has been initialized
|
5
|
+
#
|
6
|
+
# require 'mikras'
|
7
|
+
# require 'mikras/lib/some-script.rb'
|
8
|
+
#
|
9
|
+
# It defines the Prick constants: PRICK_DIR, PRICK_STATE_FILE, PRICK_ENVIRONMENT_FILE
|
10
|
+
#
|
11
|
+
|
2
12
|
require 'yaml'
|
13
|
+
require 'shellopts'
|
14
|
+
require 'pg_conn'
|
3
15
|
|
4
16
|
module Find # Monkey patching standard library
|
5
17
|
def self.upfind(dir, file)
|
@@ -13,18 +25,17 @@ module Find # Monkey patching standard library
|
|
13
25
|
end
|
14
26
|
|
15
27
|
module Prick
|
16
|
-
# FIXME Hardcoded to avoid dragging in the whole prick environment. Should be
|
17
|
-
# kept in sync with Prick::PRICK_STATE_FILE
|
18
|
-
#
|
19
|
-
# TODO: Make prick.rb includable
|
20
|
-
#
|
21
28
|
PRICK_STATE_FILE = ".prick.state.yml"
|
29
|
+
PRICK_ENVIRONMENT_FILE = "prick.environment.yml"
|
22
30
|
PRICK_DIR = Find.upfind(Dir.getwd, PRICK_STATE_FILE)
|
23
|
-
|
31
|
+
|
32
|
+
$LOAD_PATH.unshift File.join(PRICK_DIR, "lib") if PRICK_DIR
|
24
33
|
end
|
25
34
|
|
35
|
+
__END__
|
36
|
+
|
37
|
+
|
26
38
|
module Mikras
|
27
|
-
MIKRAS_DIR = Prick::PRICK_DIR
|
28
39
|
MIKRAS_LIBDIR = Prick::PRICK_DIR && File.join(Prick::PRICK_DIR, "lib")
|
29
40
|
|
30
41
|
# Add project-dir/lib to search path
|
@@ -39,8 +50,9 @@ module Mikras
|
|
39
50
|
# Should typically be called like this
|
40
51
|
#
|
41
52
|
# opts, args = ShellOpts.parse(SPEC, ARGV)
|
42
|
-
#
|
43
|
-
# ShellOpts.error "Can't find database
|
53
|
+
# credentials = Mikras.credentials(args.expect(0..2)) or
|
54
|
+
# ShellOpts.error "Can't find database"
|
55
|
+
# db = PgConn.new(*credentials)
|
44
56
|
#
|
45
57
|
def self.credentials(database_argument, username_argument = nil)
|
46
58
|
if database_argument
|
data/lib/mikras_utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mikras_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.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: 2025-
|
11
|
+
date: 2025-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg_conn
|