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 +4 -4
- data/CHANGELOG.md +4 -0
- data/exe/oxaiworkers +0 -1
- data/lib/oxaiworkers/tool/file_system.rb +14 -4
- data/lib/oxaiworkers/version.rb +1 -1
- data/locales/en.tool.yml +1 -1
- data/locales/ru.tool.yml +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: ec4ac0192d833a4e69e1fb10138d2668ea67d36aed5dd5de59b5a0046a08b38e
|
4
|
+
data.tar.gz: f1de881044ac1389e781cb59816b2ea8f1c36d0c00340f770c486fb622467b9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 780a288aa72d7b548eb8ebe64067d7b79a5d354855f3f1912afa5843a3190c78d40803ca73d1a4be0aa95dab7ca26ad3fc72106642fd24d76a2a39dc3985617f
|
7
|
+
data.tar.gz: 492959e288c68c01d786c5be0bd87ed88f6d6b77b9efa22a623d7283b6560dfa55a3e10f280f659502b158ec848da23f654560810fdfc9c6fa7af0272733152b
|
data/CHANGELOG.md
CHANGED
data/exe/oxaiworkers
CHANGED
@@ -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.
|
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
|
data/lib/oxaiworkers/version.rb
CHANGED
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: 'Инструмент файловой системы: Записывает содержимое в файл'
|