ox-ai-workers 0.4.0 → 0.4.1

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: fdbdf2dc16b6418e99209c8ff4710fedb25f01eec2b5980b8cc5562e3523d680
4
- data.tar.gz: 33f8d2543e2167be860002296cb45736c4be5fac651be37244be5a0b5ba47ab2
3
+ metadata.gz: ec4ac0192d833a4e69e1fb10138d2668ea67d36aed5dd5de59b5a0046a08b38e
4
+ data.tar.gz: f1de881044ac1389e781cb59816b2ea8f1c36d0c00340f770c486fb622467b9a
5
5
  SHA512:
6
- metadata.gz: 2f341be677a58fe8959bb86c8c6944769b77ae2d58a1cdae6800caf1ed5981d9c6532ad89549a6b5cb9189305049b123163754b5315a5e30369380a954c3c175
7
- data.tar.gz: 616972852f978d9b6c8c014dd0295d1f338cdda7737db09358a3a5ab11b1e8d120cdc54c91a88618c068b81ff5ec7e16ffc26db11a6ce1bbd176698986f4d1d5
6
+ metadata.gz: 780a288aa72d7b548eb8ebe64067d7b79a5d354855f3f1912afa5843a3190c78d40803ca73d1a4be0aa95dab7ca26ad3fc72106642fd24d76a2a39dc3985617f
7
+ data.tar.gz: 492959e288c68c01d786c5be0bd87ed88f6d6b77b9efa22a623d7283b6560dfa55a3e10f280f659502b158ec848da23f654560810fdfc9c6fa7af0272733152b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.4.1] - 2024-07-30
4
+
5
+ - Binary reading is suppressed
6
+
3
7
  ## [0.4.0] - 2024-07-30
4
8
 
5
9
  - Added tools: `file_system`, `database`
data/exe/oxaiworkers CHANGED
@@ -13,7 +13,6 @@ if ARGV.first == 'init'
13
13
  if Dir.exist? dir
14
14
  puts "Error: The #{dir} directory already exists."
15
15
  else
16
- FileUtils.mkdir_p "#{dir}/locales"
17
16
  if ARGV.last == 'full'
18
17
  FileUtils.copy_entry "#{source}/template", dest.to_s
19
18
  else
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'ptools'
4
+
3
5
  module OxAiWorkers
4
6
  module Tool
5
7
  #
@@ -30,22 +32,30 @@ module OxAiWorkers
30
32
  required: true
31
33
  end
32
34
 
35
+ def initialize
36
+ depends_on 'ptools'
37
+ end
38
+
33
39
  def list_directory(directory_path:)
34
- puts "Listing directory: #{directory_path}"
40
+ puts Rainbow("Listing directory: #{directory_path}").magenta
35
41
  Dir.entries(directory_path)
36
42
  rescue Errno::ENOENT
37
43
  "No such directory: #{directory_path}"
38
44
  end
39
45
 
40
46
  def read_file(file_path:)
41
- puts "Reading file: #{file_path}"
42
- File.read(file_path).to_s
47
+ puts Rainbow("Reading file: #{file_path}").magenta
48
+ if File.binary?(file)
49
+ "File is binary: #{file_path}"
50
+ else
51
+ File.read(file_path).to_s
52
+ end
43
53
  rescue Errno::ENOENT
44
54
  "No such file: #{file_path}"
45
55
  end
46
56
 
47
57
  def write_to_file(file_path:, content:)
48
- puts "Writing to file: #{file_path}"
58
+ puts Rainbow("Writing to file: #{file_path}").magenta
49
59
  File.write(file_path, content)
50
60
  "Content was successfully written to the file: #{file_path}"
51
61
  rescue Errno::EACCES
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OxAiWorkers
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
data/locales/en.tool.yml CHANGED
@@ -13,7 +13,7 @@ en:
13
13
  description: 'File System Tool: Lists out the content of a specified directory'
14
14
  directory_path: 'Directory path to list'
15
15
  read_file:
16
- description: 'File System Tool: Reads the contents of a file'
16
+ description: 'File System Tool: Reads the contents of a text file'
17
17
  file_path: 'Path to the file to read from'
18
18
  write_to_file:
19
19
  description: 'File System Tool: Write content to a file'
data/locales/ru.tool.yml CHANGED
@@ -13,7 +13,7 @@ ru:
13
13
  description: 'Инструмент файловой системы: Выводит содержимое указанного каталога'
14
14
  directory_path: 'Путь к каталогу для вывода содержимого'
15
15
  read_file:
16
- description: 'Инструмент файловой системы: Считывает содержимое файла'
16
+ description: 'Инструмент файловой системы: Считывает содержимое текстового файла'
17
17
  file_path: 'Путь к файлу для считывания'
18
18
  write_to_file:
19
19
  description: 'Инструмент файловой системы: Записывает содержимое в файл'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ox-ai-workers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Smolev