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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 679d27fde197cdca0690085b758d371a1c674bb179158b7e038ad4ee84acd52f
4
- data.tar.gz: 7d16137bfc341e517d5647e2fc7f5bbcdadce3b9c9b3c5a8916babe531ed8cc7
3
+ metadata.gz: e8d0aab9e1fbe2fdb0012fc2222c16254ada40699942e7fd969c22100fb974c7
4
+ data.tar.gz: 534e2e482ef2ff5fb9ae1814d06d82014a72fce10920610647138e7beae2831f
5
5
  SHA512:
6
- metadata.gz: 9ab14b85e764837386f10f3d7ab1f7211f94bdec643c6f1b091c231555dd594481b167ee51006cf2906f02000f9db83e45ca60a9c99360fd9b2713341cd97ed7
7
- data.tar.gz: 36ac41b25026fe84d52f21c2ef408181575a00c4c607640858b8d8b11e6e129df532bfb9932013fbe83bbf42524d8f43f1437eb0e7ceec78561417deeaf4c37f
6
+ metadata.gz: 19c16fc2eac9df25d58a9e6a9b254ad3079d8dd0dba39936fed663b916b26b1a6f6e6fe158810f832c16cf522b36862cf0debaa82dd070c1a36e6d66a9bdbd93
7
+ data.tar.gz: a858596624ae00c8e263e2b82f57630a549b6ffee46197e9a69b616811c453391ae54766da743bd7f167bd9feffd6224c39fd563a0c30a35b3c10b7ba9f0aa42
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # [R3EXS]
2
2
 
3
+ ## [1.0.5] - 2025-03-12
4
+
5
+ - rb_in_strings 方法里面添加将 Scripts_info.json 文件拷贝至目标目录里面,以避免后续报错
6
+ - 优化了一下 json_rvdata2 方法里的输出
7
+
3
8
  ## [1.0.4] - 2025-03-11
4
9
 
5
10
  - 修复 rvdata2_json 方法里处理 Scripts 的 BUG
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"
@@ -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 = File.join(target_dir, 'Scripts')
21
- output_full_dir = File.join(output_dir, 'Scripts')
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]
@@ -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}...\n" if $global_options[:verbose]
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}...\n" if $global_options[:verbose]
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
@@ -3,5 +3,5 @@
3
3
  module R3EXS
4
4
 
5
5
  # 版本号
6
- VERSION = '1.0.4'
6
+ VERSION = '1.0.5'
7
7
  end
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
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-11 00:00:00.000000000 Z
10
+ date: 2025-03-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake