R3EXS 1.0.3 → 1.0.4

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: 86b432647374edef0c80c6479bf96826a0054032b39acbbd54bd23fe8e0d789e
4
- data.tar.gz: 25b79302954098b202730e01e8ab1873ebd98ec205099677cf55948495ebdbf2
3
+ metadata.gz: 679d27fde197cdca0690085b758d371a1c674bb179158b7e038ad4ee84acd52f
4
+ data.tar.gz: 7d16137bfc341e517d5647e2fc7f5bbcdadce3b9c9b3c5a8916babe531ed8cc7
5
5
  SHA512:
6
- metadata.gz: dc68f9e3f16e4b0ce56ff635b0819f5bc17add44112aca03b0c62d321051d349e5511903203516d1820be18a6b9272c9d4a847dff5a7a96d5d88f3210eba90d5
7
- data.tar.gz: a2d93faf33f69efedb8399b98342c3ba3d0e6adbee2190e56575e70732e44717f8fe3b04dfc201bbc68222cf0b97f022484795745790215eb0b4644426f22c26
6
+ metadata.gz: 9ab14b85e764837386f10f3d7ab1f7211f94bdec643c6f1b091c231555dd594481b167ee51006cf2906f02000f9db83e45ca60a9c99360fd9b2713341cd97ed7
7
+ data.tar.gz: 36ac41b25026fe84d52f21c2ef408181575a00c4c607640858b8d8b11e6e129df532bfb9932013fbe83bbf42524d8f43f1437eb0e7ceec78561417deeaf4c37f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # [R3EXS]
2
2
 
3
+ ## [1.0.4] - 2025-03-11
4
+
5
+ - 修复 rvdata2_json 方法里处理 Scripts 的 BUG
6
+ - rb_ex_strings 方法里 Extract 单词拼写修正
7
+ - oj 版本更新到 3.16.10
8
+ - redcarpet 版本更新到 3.6.1
9
+
3
10
  ## [1.0.3] - 2025-02-15
4
11
 
5
12
  - 添加 RGSS3AFileError 类以处理加密格式不支持的问题
data/bin/R3EXS CHANGED
@@ -61,7 +61,7 @@ class App
61
61
  c.action do |global_options, options, args|
62
62
  begin
63
63
  R3EXS.rvdata2_json(args[0], options[:output_dir], options[:complete], options[:with_scripts], options[:with_notes])
64
- $stderr.puts "#{R3EXS::Utils::GREEN_COLOR}All JSON files have been written to #{options[:output_dir]}#{R3EXS::Utils::RESET_COLOR}"
64
+ puts "#{R3EXS::Utils::GREEN_COLOR}All JSON files have been written to #{options[:output_dir]}#{R3EXS::Utils::RESET_COLOR}"
65
65
  rescue R3EXS::Rvdata2FileError => e
66
66
  $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
67
67
  $stderr.puts 'Please make sure the rvdata2 files are not corrupted.'
@@ -93,7 +93,7 @@ class App
93
93
  c.action do |global_options, options, args|
94
94
  begin
95
95
  R3EXS.json_rvdata2(args[0], options[:output_dir], options[:original_dir], options[:complete], options[:with_scripts])
96
- $stderr.puts "#{R3EXS::Utils::GREEN_COLOR}All new rvdata2 files have been written to #{options[:output_dir]}#{R3EXS::Utils::RESET_COLOR}"
96
+ puts "#{R3EXS::Utils::GREEN_COLOR}All new rvdata2 files have been written to #{options[:output_dir]}#{R3EXS::Utils::RESET_COLOR}"
97
97
  rescue R3EXS::RPGJsonFileError => e
98
98
  $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
99
99
  $stderr.puts 'Your JSON files are not in RPG module'
@@ -146,16 +146,20 @@ class App
146
146
  c.action do |global_options, options, args|
147
147
  begin
148
148
  R3EXS.ex_strings(args[0], options[:output_dir], options[:with_scripts], options[:with_symbol], options[:with_scripts_separate])
149
- puts "#{R3EXS::Utils::GREEN_COLOR}All strings have been extracted to #{File.join(options[:output_dir], 'ManualTransFile.json')}#{R3EXS::Utils::RESET_COLOR}"
149
+ if options[:with_scripts_separate]
150
+ puts "#{R3EXS::Utils::GREEN_COLOR}All strings have been extracted to #{File.join(options[:output_dir], 'ManualTransFile.json')} and #{File.join(options[:output_dir], 'ManualTransFile_scripts.json')}#{R3EXS::Utils::RESET_COLOR}"
151
+ else
152
+ puts "#{R3EXS::Utils::GREEN_COLOR}All strings have been extracted to #{File.join(options[:output_dir], 'ManualTransFile.json')}#{R3EXS::Utils::RESET_COLOR}"
153
+ end
150
154
  rescue R3EXS::R3EXSJsonFileError => e
151
- puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
155
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
152
156
  $stderr.puts 'Your JSON files are not in R3EXS module'
153
157
  $stderr.puts "You are #{R3EXS::Utils::RED_COLOR}NOT#{R3EXS::Utils::RESET_COLOR} supposed to use '#{R3EXS::Utils::GREEN_COLOR}-c#{R3EXS::Utils::RESET_COLOR}' or '#{R3EXS::Utils::GREEN_COLOR}--complete#{R3EXS::Utils::RESET_COLOR}' to enable complete serialization in #{R3EXS::Utils::GREEN_COLOR}rvdata2_json#{R3EXS::Utils::RESET_COLOR} subcommand"
154
158
  $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help json_rvdata2#{R3EXS::Utils::RESET_COLOR}'"
155
159
  rescue R3EXS::JsonDirError => e
156
- puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
160
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
157
161
  rescue R3EXS::ScriptsDirError => e
158
- puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
162
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
159
163
  $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"
160
164
  $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help rvdata2_json#{R3EXS::Utils::RESET_COLOR}'"
161
165
  end
@@ -183,18 +187,18 @@ class App
183
187
  R3EXS.in_strings(args[0], options[:output_dir], options[:manualtransfile_path], options[:with_scripts])
184
188
  puts "#{R3EXS::Utils::GREEN_COLOR}All new JSON files have been written to #{options[:output_dir]}#{R3EXS::Utils::RESET_COLOR}"
185
189
  rescue R3EXS::R3EXSJsonFileError => e
186
- puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
190
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
187
191
  $stderr.puts 'Your JSON files are not in R3EXS module'
188
192
  $stderr.puts "You are #{R3EXS::Utils::RED_COLOR}NOT#{R3EXS::Utils::RESET_COLOR} supposed to use '#{R3EXS::Utils::GREEN_COLOR}-c#{R3EXS::Utils::RESET_COLOR}' or '#{R3EXS::Utils::GREEN_COLOR}--complete#{R3EXS::Utils::RESET_COLOR}' to enable complete serialization in #{R3EXS::Utils::GREEN_COLOR}rvdata2_json#{R3EXS::Utils::RESET_COLOR} subcommand"
189
193
  $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help json_rvdata2#{R3EXS::Utils::RESET_COLOR}'"
190
194
  rescue R3EXS::JsonDirError => e
191
- puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
195
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
192
196
  rescue R3EXS::ScriptsDirError => e
193
- puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
197
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
194
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"
195
199
  $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help rvdata2_json#{R3EXS::Utils::RESET_COLOR}'"
196
200
  rescue R3EXS::ManualTransFilePathError => e
197
- puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
201
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
198
202
  $stderr.puts "You are supposed to use #{R3EXS::Utils::GREEN_COLOR}ex_strings#{R3EXS::Utils::RESET_COLOR} subcommand to generate the ManualTransFile.json"
199
203
  $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help ex_strings#{R3EXS::Utils::RESET_COLOR}'"
200
204
  end
@@ -22,11 +22,11 @@ module R3EXS
22
22
  strings = []
23
23
  strings_extractor = StringsExtractor.new(strings, with_symbol)
24
24
  Dir.glob(File.join(full_dir, '*.rb')).each do |script_file_path|
25
- print "#{Utils::ESCAPE}#{Utils::MAGENTA_COLOR}Exreacting from #{Utils::RESET_COLOR}#{script_file_path}...\r" if $global_options[:verbose]
25
+ print "#{Utils::ESCAPE}#{Utils::MAGENTA_COLOR}Extracting from #{Utils::RESET_COLOR}#{script_file_path}...\r" if $global_options[:verbose]
26
26
 
27
27
  strings_extractor.visit(Prism.parse_file(script_file_path).value)
28
28
 
29
- print "#{Utils::ESCAPE}#{Utils::GREEN_COLOR}Exreacted #{Utils::RESET_COLOR}#{script_file_path}\n" if $global_options[:verbose]
29
+ print "#{Utils::ESCAPE}#{Utils::GREEN_COLOR}Extracted #{Utils::RESET_COLOR}#{script_file_path}\n" if $global_options[:verbose]
30
30
  end
31
31
  strings
32
32
  end
@@ -45,21 +45,20 @@ module R3EXS
45
45
  def R3EXS.rvdata2_json(target_dir, output_dir, complete, with_scripts, with_notes)
46
46
  FileUtils.mkdir(output_dir) unless Dir.exist?(output_dir)
47
47
  Utils.all_rvdata2_files(target_dir) do |object, file_basename|
48
-
49
48
  if file_basename == 'Scripts'
50
- scripts_rb(object, output_dir) if with_scripts
49
+ next unless with_scripts
50
+ scripts_rb(object, output_dir)
51
51
  print "#{Utils::ESCAPE}#{Utils::GREEN_COLOR}Serialized #{Utils::RESET_COLOR}#{file_basename}\n" if $global_options[:verbose]
52
- next
53
- end
54
-
55
- file_path = File.join(output_dir, "#{file_basename}.json")
56
- print "#{Utils::ESCAPE}#{Utils::MAGENTA_COLOR}Serializing to #{Utils::RESET_COLOR}#{file_path}...\r" if $global_options[:verbose]
57
- if complete
58
- Utils.object_json(object, file_path)
59
52
  else
60
- Utils.object_json(Utils.rpg_r3exs(object, file_basename, with_notes), file_path)
53
+ file_path = File.join(output_dir, "#{file_basename}.json")
54
+ print "#{Utils::ESCAPE}#{Utils::MAGENTA_COLOR}Serializing to #{Utils::RESET_COLOR}#{file_path}...\r" if $global_options[:verbose]
55
+ if complete
56
+ Utils.object_json(object, file_path)
57
+ else
58
+ Utils.object_json(Utils.rpg_r3exs(object, file_basename, with_notes), file_path)
59
+ end
60
+ print "#{Utils::ESCAPE}#{Utils::GREEN_COLOR}Serialized #{Utils::RESET_COLOR}#{file_basename}\n" if $global_options[:verbose]
61
61
  end
62
- print "#{Utils::ESCAPE}#{Utils::GREEN_COLOR}Serialized #{Utils::RESET_COLOR}#{file_basename}\n" if $global_options[:verbose]
63
62
  end
64
63
  end
65
64
 
data/lib/R3EXS/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  module R3EXS
4
4
 
5
5
  # 版本号
6
- VERSION = '1.0.3'
6
+ VERSION = '1.0.4'
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.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - LuoTat
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-15 00:00:00.000000000 Z
10
+ date: 2025-03-11 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake
@@ -57,14 +57,14 @@ dependencies:
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 3.6.0
60
+ version: 3.6.1
61
61
  type: :development
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 3.6.0
67
+ version: 3.6.1
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: ocran
70
70
  requirement: !ruby/object:Gem::Requirement
@@ -99,14 +99,14 @@ dependencies:
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 3.16.9
102
+ version: 3.16.10
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 3.16.9
109
+ version: 3.16.10
110
110
  email: LuoTat.s@gmail.com
111
111
  executables:
112
112
  - R3EXS
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
159
  requirements: []
160
- rubygems_version: 3.6.3
160
+ rubygems_version: 3.6.5
161
161
  specification_version: 4
162
162
  summary: A tool for extracting and translating strings from the RGSS3 game engine
163
163
  test_files: []