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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d231fd9f0fd7830a542f514483c84a0e5d9e54e8a4738b8af4b400bc517675c
4
- data.tar.gz: d02e3327cdf2667a3b654e4396178cb1184aeff472fd9fc96f3862535a07e54b
3
+ metadata.gz: 426089deb83c2bedf49d58d170b9241d0cd14a0284fa7b23acc7e8b5932f666f
4
+ data.tar.gz: 7fd0fc6880e2cacc358a2e32bcbed7636e70aade5d688294c5ef79961cb20c92
5
5
  SHA512:
6
- metadata.gz: 714cb0e8468df9c95d6f8ef263f2dd8702a51ace6d3f2b38548d0f5fdaa52ef418866362fc9e500715d39d2f41cbc2f4feb4b2ec2cdc52c3070a12999ff92c68
7
- data.tar.gz: 71f111f76252c0d66db824cf49c4902217e44861eee836978dff1ee4a42df1c58db91530003da849b999f01518e43ff15c362e14c68c151fc9e6d2f0003f6ba0
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
@@ -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."
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AiSentinel
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ai_sentinel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Celi