R3EXS 1.0.4 → 1.0.5
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 +5 -0
- data/bin/R3EXS +4 -0
- data/lib/R3EXS/inject_strings.rb +10 -2
- data/lib/R3EXS/json_rvdata2.rb +2 -2
- data/lib/R3EXS/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: e8d0aab9e1fbe2fdb0012fc2222c16254ada40699942e7fd969c22100fb974c7
|
4
|
+
data.tar.gz: 534e2e482ef2ff5fb9ae1814d06d82014a72fce10920610647138e7beae2831f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19c16fc2eac9df25d58a9e6a9b254ad3079d8dd0dba39936fed663b916b26b1a6f6e6fe158810f832c16cf522b36862cf0debaa82dd070c1a36e6d66a9bdbd93
|
7
|
+
data.tar.gz: a858596624ae00c8e263e2b82f57630a549b6ffee46197e9a69b616811c453391ae54766da743bd7f167bd9feffd6224c39fd563a0c30a35b3c10b7ba9f0aa42
|
data/CHANGELOG.md
CHANGED
data/bin/R3EXS
CHANGED
@@ -197,6 +197,10 @@ class App
|
|
197
197
|
$stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
|
198
198
|
$stderr.puts "You are supposed to use '#{R3EXS::Utils::GREEN_COLOR}-s#{R3EXS::Utils::RESET_COLOR}' or '#{R3EXS::Utils::GREEN_COLOR}--scripts#{R3EXS::Utils::RESET_COLOR}' to enable serialization of Scripts in #{R3EXS::Utils::GREEN_COLOR}rvdata2_json#{R3EXS::Utils::RESET_COLOR} subcommand"
|
199
199
|
$stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help rvdata2_json#{R3EXS::Utils::RESET_COLOR}'"
|
200
|
+
rescue R3EXS::ScriptsInfoPathError => e
|
201
|
+
$stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
|
202
|
+
$stderr.puts "Make sure the Scripts_info.json is in the #{args[0]}/Scripts directory"
|
203
|
+
$stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help rvdata2_json#{R3EXS::Utils::RESET_COLOR}'"
|
200
204
|
rescue R3EXS::ManualTransFilePathError => e
|
201
205
|
$stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
|
202
206
|
$stderr.puts "You are supposed to use #{R3EXS::Utils::GREEN_COLOR}ex_strings#{R3EXS::Utils::RESET_COLOR} subcommand to generate the ManualTransFile.json"
|
data/lib/R3EXS/inject_strings.rb
CHANGED
@@ -14,13 +14,20 @@ module R3EXS
|
|
14
14
|
# @param hash [Hash]
|
15
15
|
#
|
16
16
|
# @raise [ScriptsDirError] Scripts 目录不存在
|
17
|
+
# @raise [ScriptsInfoPathError] Scripts_info.json 文件不存在
|
17
18
|
#
|
18
19
|
# @return [void]
|
19
20
|
def R3EXS.rb_in_strings(target_dir, output_dir, hash)
|
20
|
-
target_full_dir
|
21
|
-
output_full_dir
|
21
|
+
target_full_dir = File.join(target_dir, 'Scripts')
|
22
|
+
output_full_dir = File.join(output_dir, 'Scripts')
|
23
|
+
script_info_file_path = File.join(target_full_dir, 'Scripts_info.json')
|
24
|
+
|
22
25
|
FileUtils.mkdir(output_full_dir) unless Dir.exist?(output_full_dir)
|
23
26
|
Dir.exist?(target_full_dir) or raise ScriptsDirError.new(target_full_dir), "Scripts directory not found: #{target_full_dir}"
|
27
|
+
File.exist?(script_info_file_path) or raise ScriptsInfoPathError.new(script_info_file_path), "Scripts_info.json not found: #{script_info_file_path}"
|
28
|
+
|
29
|
+
print "#{Utils::ESCAPE}#{Utils::YELLOW_COLOR}Copying #{Utils::RESET_COLOR}Scripts_info.json to #{output_full_dir}...\r" if $global_options[:verbose]
|
30
|
+
FileUtils.cp(script_info_file_path, output_full_dir)
|
24
31
|
|
25
32
|
Dir.glob(File.join(target_full_dir, "*.rb")).each do |script_file_path|
|
26
33
|
output_script_file_dir = File.join(output_full_dir, File.basename(script_file_path))
|
@@ -42,6 +49,7 @@ module R3EXS
|
|
42
49
|
# @raise [R3EXSJsonFileError] json 文件不是 R3EXS 模块中的对象
|
43
50
|
# @raise [JsonDirError] target_dir 不存在
|
44
51
|
# @raise [ScriptsDirError] Scripts 目录不存在
|
52
|
+
# @raise [ScriptsInfoPathError] Scripts_info.json 文件不存在
|
45
53
|
# @raise [ManualTransFilePath] ManualTransFile.json 不存在
|
46
54
|
#
|
47
55
|
# @return [void]
|
data/lib/R3EXS/json_rvdata2.rb
CHANGED
@@ -59,7 +59,7 @@ module R3EXS
|
|
59
59
|
if complete
|
60
60
|
Utils.all_json_files(target_dir, :RPG) do |object, file_basename|
|
61
61
|
file_path = File.join(output_dir, "#{file_basename}.rvdata2")
|
62
|
-
print "#{Utils::ESCAPE}#{Utils::MAGENTA_COLOR}Serializing to #{Utils::RESET_COLOR}#{file_path}...\
|
62
|
+
print "#{Utils::ESCAPE}#{Utils::MAGENTA_COLOR}Serializing to #{Utils::RESET_COLOR}#{file_path}...\r" if $global_options[:verbose]
|
63
63
|
Utils.object_rvdata2(object, file_path)
|
64
64
|
print "#{Utils::ESCAPE}#{Utils::GREEN_COLOR}Serialized #{Utils::RESET_COLOR}#{file_basename}\n" if $global_options[:verbose]
|
65
65
|
end
|
@@ -80,7 +80,7 @@ module R3EXS
|
|
80
80
|
end
|
81
81
|
|
82
82
|
file_path = File.join(output_dir, "#{file_basename}.rvdata2")
|
83
|
-
print "#{Utils::ESCAPE}#{Utils::MAGENTA_COLOR}Serializing to #{Utils::RESET_COLOR}#{file_path}...\
|
83
|
+
print "#{Utils::ESCAPE}#{Utils::MAGENTA_COLOR}Serializing to #{Utils::RESET_COLOR}#{file_path}...\r" if $global_options[:verbose]
|
84
84
|
|
85
85
|
# 根据是否为数组进行不同的处理
|
86
86
|
if object.is_a?(Array)
|
data/lib/R3EXS/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: R3EXS
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LuoTat
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-12 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rake
|