ai_sentinel 0.2.1 → 0.2.2
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/ai_sentinel/cli/helpers.rb +9 -0
- data/lib/ai_sentinel/cli.rb +3 -0
- data/lib/ai_sentinel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 426089deb83c2bedf49d58d170b9241d0cd14a0284fa7b23acc7e8b5932f666f
|
|
4
|
+
data.tar.gz: 7fd0fc6880e2cacc358a2e32bcbed7636e70aade5d688294c5ef79961cb20c92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b19b08eafd1dc89bcb3ca42f29ae483e6751a1bbf50546b6be65a4b2840705cf705d25d340af8d81b0a443267f20227e1f492b5d44403e0a0cd5ef1d5f93f643
|
|
7
|
+
data.tar.gz: 1eb5109adbf99a1802e393942282f05e7635274e0d658e4799488f9a0526cdf94db249df83cfaf65d0097c155448b8445f05bf6fce330d15fdd7f3bff6c51d1e
|
|
@@ -10,6 +10,15 @@ module AiSentinel
|
|
|
10
10
|
loader.load!
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
def apply_working_directory_and_load_env
|
|
14
|
+
dir = AiSentinel.configuration.working_directory
|
|
15
|
+
return unless dir
|
|
16
|
+
|
|
17
|
+
FileUtils.mkdir_p(dir)
|
|
18
|
+
Dir.chdir(dir)
|
|
19
|
+
Dotenv.load
|
|
20
|
+
end
|
|
21
|
+
|
|
13
22
|
def setup_database
|
|
14
23
|
if options[:config]
|
|
15
24
|
load_config
|
data/lib/ai_sentinel/cli.rb
CHANGED
|
@@ -22,6 +22,7 @@ module AiSentinel
|
|
|
22
22
|
option :daemonize, type: :boolean, default: false, aliases: '-d', desc: 'Run in background'
|
|
23
23
|
def start
|
|
24
24
|
load_config
|
|
25
|
+
apply_working_directory_and_load_env
|
|
25
26
|
AiSentinel.send(:resolve_api_key)
|
|
26
27
|
AiSentinel.configuration.validate!
|
|
27
28
|
Persistence::Database.setup(AiSentinel.configuration.database_path)
|
|
@@ -51,6 +52,7 @@ module AiSentinel
|
|
|
51
52
|
desc 'run WORKFLOW', 'Manually trigger a workflow immediately'
|
|
52
53
|
def run_workflow(workflow_name)
|
|
53
54
|
load_config
|
|
55
|
+
apply_working_directory_and_load_env
|
|
54
56
|
AiSentinel.send(:resolve_api_key)
|
|
55
57
|
AiSentinel.configuration.validate!
|
|
56
58
|
Persistence::Database.setup(AiSentinel.configuration.database_path)
|
|
@@ -69,6 +71,7 @@ module AiSentinel
|
|
|
69
71
|
desc 'validate', 'Validate the configuration file'
|
|
70
72
|
def validate
|
|
71
73
|
load_config
|
|
74
|
+
apply_working_directory_and_load_env
|
|
72
75
|
AiSentinel.send(:resolve_api_key)
|
|
73
76
|
AiSentinel.configuration.validate!
|
|
74
77
|
say "Config is valid. #{AiSentinel.registry.size} workflow(s) loaded."
|
data/lib/ai_sentinel/version.rb
CHANGED