R3EXS 1.0.5 → 1.1.0

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.
data/README_EN.md CHANGED
@@ -1,260 +1,260 @@
1
- # R3EXS
2
-
3
- RGSS3_Extract_Strings_Tool
4
-
5
- <p style="text-align: center;">A tool for extracting and translating strings from the RGSS3 game engine.</p>
6
-
7
- [**English**](README_EN.md)&nbsp;&nbsp;&nbsp;[**简体中文**](README.md)
8
-
9
- ## Contents
10
-
11
- - [Synopsis](#synopsis)
12
- - [Features](#features)
13
- - [Function List](#function-list)
14
- - [Installation](#installation)
15
- - [Usage](#usage)
16
- - [Project Build](#project-build)
17
- - [Documentation](#documentation)
18
- - [Links](#links)
19
-
20
- ## [Synopsis](#contents)
21
-
22
- R3EXS is a gem built using Ruby, designed to extract and translate strings in RGSS3 games.
23
-
24
- ## [Features](#contents)
25
-
26
- It uses [Prism](https://github.com/ruby/prism) to accurately extract strings and symbols from Ruby scripts.
27
-
28
- ## [Function List](#contents)
29
-
30
- 1. [Unpack Game.rgss3a file](#unpack-gamergss3a-file)
31
- 2. [Serialize rvdata2 files to JSON file](#serialize-rvdata2-files-to-json-file)
32
- 3. [Deserialize JSON files to rvdata2 file](#deserialize-json-files-to-rvdata2-file)
33
- 4. [Extract all strings](#extract-all-strings)
34
- 5. [Inject all strings](#inject-all-strings)
35
-
36
- ## [Installation](#contents)
37
-
38
- ### Install using RubyGems
39
-
40
- 1. Install [Ruby](https://www.ruby-lang.org/en) (make sure to install Devkit to support compiling C extensions)
41
- 2. Install the [R3EXS](https://rubygems.org/gems/R3EXS) gem
42
-
43
- ```bash
44
- gem install R3EXS
45
- ```
46
-
47
- ### Download executable file directly
48
-
49
- Click to download [R3EXS.exe](https://github.com/LuoTat/R3EXS/releases)
50
-
51
- Since the R3EXS.exe file is packaged using [Ocran](https://github.com/Largo/ocran) and [Tebako](https://github.com/tamatebako/tebako)
52
-
53
- The `Windows` environment provides `R3EXS-windows_Ocran` and `R3EXS-windows_Tebako`
54
-
55
- The `Linux (GLIBC >= 2.31)` environment provides `R3EXS-linux_Tebako`
56
-
57
- it will extract the Ruby environment the first time it runs, so the first run may be slower.
58
-
59
- ## [Usage](#contents)
60
-
61
- The following commands assume they are run in the game’s root directory, ensuring the `./Game.rgss3a` file exists or has already been unpacked into the `./Data` folder.
62
-
63
- ~~If you enjoy a crazy amount of console output or feel like the execution is too fast~~, please enable the `--verbose` option.
64
-
65
- ### [Unpack Game.rgss3a file](#function-list)
66
-
67
- ```bash
68
- NAME
69
- decrypt - Decrypt the Game.rgss3a file
70
-
71
- SYNOPSIS
72
-
73
- R3EXS [global options] decrypt [command options] <Game.rgss3a file path>
74
-
75
- COMMAND OPTIONS
76
- -o, --output_dir=DIRECTORY - The *.rvdata2 output dir (default: ./)
77
- ```
78
-
79
- Example code:
80
-
81
- ```bash
82
- R3EXS decrypt ./Game.rgss3a
83
- ```
84
-
85
- ### [Serialize rvdata2 files to JSON file](#function-list)
86
-
87
- ```bash
88
- NAME
89
- rvdata2_json - Serialize rvdata2 files into JSON
90
-
91
- SYNOPSIS
92
-
93
- R3EXS [global options] rvdata2_json [command options] <the *.rvdata2 dir>
94
-
95
- COMMAND OPTIONS
96
- -c, --[no-]complete - Enable complete serialization
97
- -n, --[no-]with_notes - Enable notes attribute serialization
98
- -o, --output_dir=DIRECTORY - The *.json output dir (default: ./JSON)
99
- -s, --[no-]with_scripts - Enable Scripts.rvdata2 serialization
100
- ```
101
-
102
- Example code:
103
-
104
- ```bash
105
- // Serialize only translatable parts
106
- R3EXS rvdata2_json ./Data
107
-
108
- // Complete serialization
109
- R3EXS rvdata2_json -c ./Data
110
- ```
111
-
112
- ### [Deserialize JSON files to rvdata2 file](#function-list)
113
-
114
- ```bash
115
- NAME
116
- json_rvdata2 - Deserialize JSON files back into rvdata2
117
-
118
- SYNOPSIS
119
-
120
- R3EXS [global options] json_rvdata2 [command options] <the *.json dir>
121
-
122
- COMMAND OPTIONS
123
- -c, --[no-]complete - Enable complete deserialization
124
- -o, --output_dir=DIRECTORY - The NEW *.rvdata2 output dir (default: ./Data_NEW)
125
- -r, --original_dir=DIRECTORY - The ORIGINAL *.rvdata2 dir (default: ./Data)
126
- -s, --[no-]with_scripts - Enable Scripts JSON deserialization
127
- ```
128
-
129
- Example code:
130
-
131
- ```bash
132
- // If --complete was not enabled in rvdata2_json
133
- // Provide --original_dir or ensure ./Data folder exists in the current directory
134
- R3EXS json_rvdata2 ./JSON
135
-
136
- // If --complete was enabled in rvdata2_json
137
- // --original_dir is not required
138
- R3EXS json_rvdata2 -c ./JSON
139
- ```
140
-
141
- ### [Extract all strings](#function-list)
142
-
143
- ```bash
144
- NAME
145
- ex_strings - Extract all strings
146
-
147
- SYNOPSIS
148
-
149
- R3EXS [global options] ex_strings [command options] <the *.json dir>
150
-
151
- COMMAND OPTIONS
152
- -o, --output_dir=DIRECTORY - The ManualTransFile.json or ManualTransFile_scripts.json output dir (default: ./)
153
- -p, --[no-]with_scripts_separate - Enable Scripts extraction into a separate ManualTransFile_scripts.json
154
- -s, --[no-]with_scripts - Enable Scripts extraction
155
- -y, --[no-]with_symbol - Enable Symbol extraction in Scripts extraction
156
- ```
157
-
158
- Example code:
159
-
160
- ```bash
161
- // Do not extract Scripts
162
- R3EXS ex_strings ./JSON
163
-
164
- // Extract Scripts
165
- R3EXS ex_strings -s ./JSON
166
-
167
- // Extract Scripts and separate them into ManualTransFile_scripts.json
168
- R3EXS ex_strings -s -p ./JSON
169
- ```
170
-
171
- ### [Inject all strings](#function-list)
172
-
173
- ```bash
174
- NAME
175
- in_strings - Inject all strings
176
-
177
- SYNOPSIS
178
-
179
- R3EXS [global options] in_strings [command options] <the *.json dir>
180
-
181
- COMMAND OPTIONS
182
- -m, --manualtransfile_path=FILE - The ManualTransFile.json path (default: ./ManualTransFile.json)
183
- -o, --output_dir=DIRECTORY - The NEW *.json output dir (default: ./JSON_NEW)
184
- -s, --[no-]with_scripts - Enable Scripts Injection
185
- ```
186
-
187
- Example code:
188
-
189
- ```bash
190
- // Do not inject into Scripts
191
- R3EXS in_strings ./JSON
192
-
193
- // Inject into Scripts
194
- R3EXS in_strings -s ./JSON
195
- ```
196
-
197
- ---
198
-
199
- For more information, use
200
-
201
- ```bash
202
- R3EXS help
203
- ```
204
-
205
- ## [Project Build](#contents)
206
-
207
- To build and run the project, first clone the entire repository:
208
-
209
- ```bash
210
- git clone git@github.com:LuoTat/R3EXS.git
211
- ```
212
-
213
- Then use `bundle` to install dependencies:
214
-
215
- ```bash
216
- bundle install
217
- ```
218
-
219
- Finally, compile the C extension:
220
-
221
- ```bash
222
- rake compile
223
- ```
224
-
225
- ---
226
-
227
- Build the local documentation:
228
-
229
- ```bash
230
- yardoc
231
- ```
232
-
233
- Build the `R3EXS_Ocran.exe` file:
234
-
235
- ```bash
236
- rake ocran
237
- ```
238
-
239
- View all rake tasks:
240
-
241
- ```bash
242
- rake -T
243
- ```
244
-
245
- ## [Documentation](#contents)
246
-
247
- [R3EXS Api Documentation](https://rubydoc.info/gems/R3EXS)
248
-
249
- ## [Links](#contents)
250
-
251
- - [oj](https://github.com/ohler55/oj)
252
- - [gli](https://github.com/davetron5000/gli)
253
- - [Prism](https://github.com/ruby/prism)
254
- - [Ocran](https://github.com/Largo/ocran)
255
- - [Tebako](https://github.com/tamatebako/tebako)
256
- - [RGSS3](https://github.com/taroxd/RGSS3)
257
- - [rvdata2json](https://github.com/DICE2000/rvdata2json)
258
- - [VX-Ace-Translator](https://github.com/AhmedAhmedEG/VX-Ace-Translator)
259
- - [RPGMakerDecrypter](https://github.com/uuksu/RPGMakerDecrypter)
260
- - [RPGMaker VX Ace F1-Manual](https://miaowm5.github.io/RMVA-F1)
1
+ # R3EXS
2
+
3
+ RGSS3_Extract_Strings_Tool
4
+
5
+ <p style="text-align: center;">A tool for extracting and translating strings from the RGSS3 game engine.</p>
6
+
7
+ [**English**](README_EN.md)&nbsp;&nbsp;&nbsp;[**简体中文**](README.md)
8
+
9
+ ## Contents
10
+
11
+ - [Synopsis](#synopsis)
12
+ - [Features](#features)
13
+ - [Function List](#function-list)
14
+ - [Installation](#installation)
15
+ - [Usage](#usage)
16
+ - [Project Build](#project-build)
17
+ - [Documentation](#documentation)
18
+ - [Links](#links)
19
+
20
+ ## [Synopsis](#contents)
21
+
22
+ R3EXS is a gem built using Ruby, designed to extract and translate strings in RGSS3 games.
23
+
24
+ ## [Features](#contents)
25
+
26
+ It uses [Prism](https://github.com/ruby/prism) to accurately extract strings and symbols from Ruby scripts.
27
+
28
+ ## [Function List](#contents)
29
+
30
+ 1. [Unpack Game.rgss3a file](#unpack-gamergss3a-file)
31
+ 2. [Serialize rvdata2 files to JSON file](#serialize-rvdata2-files-to-json-file)
32
+ 3. [Deserialize JSON files to rvdata2 file](#deserialize-json-files-to-rvdata2-file)
33
+ 4. [Extract all strings](#extract-all-strings)
34
+ 5. [Inject all strings](#inject-all-strings)
35
+
36
+ ## [Installation](#contents)
37
+
38
+ ### Install using RubyGems
39
+
40
+ 1. Install [Ruby](https://www.ruby-lang.org/en) (make sure to install Devkit to support compiling C extensions)
41
+ 2. Install the [R3EXS](https://rubygems.org/gems/R3EXS) gem
42
+
43
+ ```bash
44
+ gem install R3EXS
45
+ ```
46
+
47
+ ### Download executable file directly
48
+
49
+ Click to download [R3EXS.exe](https://github.com/LuoTat/R3EXS/releases)
50
+
51
+ Since the R3EXS.exe file is packaged using [Ocran](https://github.com/Largo/ocran) and [Tebako](https://github.com/tamatebako/tebako)
52
+
53
+ The `Windows` environment provides `R3EXS-windows_Ocran` and `R3EXS-windows_Tebako`
54
+
55
+ The `Linux (GLIBC >= 2.31)` environment provides `R3EXS-linux_Tebako`
56
+
57
+ it will extract the Ruby environment the first time it runs, so the first run may be slower.
58
+
59
+ ## [Usage](#contents)
60
+
61
+ The following commands assume they are run in the game’s root directory, ensuring the `./Game.rgss3a` file exists or has already been unpacked into the `./Data` folder.
62
+
63
+ ~~If you enjoy a crazy amount of console output or feel like the execution is too fast~~, please enable the `--verbose` option.
64
+
65
+ ### [Unpack Game.rgss3a file](#function-list)
66
+
67
+ ```bash
68
+ NAME
69
+ decrypt - Decrypt the Game.rgss3a file
70
+
71
+ SYNOPSIS
72
+
73
+ R3EXS [global options] decrypt [command options] <Game.rgss3a file path>
74
+
75
+ COMMAND OPTIONS
76
+ -o, --output_dir=DIRECTORY - The *.rvdata2 output dir (default: ./)
77
+ ```
78
+
79
+ Example code:
80
+
81
+ ```bash
82
+ R3EXS decrypt ./Game.rgss3a
83
+ ```
84
+
85
+ ### [Serialize rvdata2 files to JSON file](#function-list)
86
+
87
+ ```bash
88
+ NAME
89
+ rvdata2_json - Serialize rvdata2 files into JSON
90
+
91
+ SYNOPSIS
92
+
93
+ R3EXS [global options] rvdata2_json [command options] <the *.rvdata2 dir>
94
+
95
+ COMMAND OPTIONS
96
+ -c, --[no-]complete - Enable complete serialization
97
+ -n, --[no-]with_notes - Enable notes attribute serialization
98
+ -o, --output_dir=DIRECTORY - The *.json output dir (default: ./JSON)
99
+ -s, --[no-]with_scripts - Enable Scripts.rvdata2 serialization
100
+ ```
101
+
102
+ Example code:
103
+
104
+ ```bash
105
+ // Serialize only translatable parts
106
+ R3EXS rvdata2_json ./Data
107
+
108
+ // Complete serialization
109
+ R3EXS rvdata2_json -c ./Data
110
+ ```
111
+
112
+ ### [Deserialize JSON files to rvdata2 file](#function-list)
113
+
114
+ ```bash
115
+ NAME
116
+ json_rvdata2 - Deserialize JSON files back into rvdata2
117
+
118
+ SYNOPSIS
119
+
120
+ R3EXS [global options] json_rvdata2 [command options] <the *.json dir>
121
+
122
+ COMMAND OPTIONS
123
+ -c, --[no-]complete - Enable complete deserialization
124
+ -o, --output_dir=DIRECTORY - The NEW *.rvdata2 output dir (default: ./Data_NEW)
125
+ -r, --original_dir=DIRECTORY - The ORIGINAL *.rvdata2 dir (default: ./Data)
126
+ -s, --[no-]with_scripts - Enable Scripts JSON deserialization
127
+ ```
128
+
129
+ Example code:
130
+
131
+ ```bash
132
+ // If --complete was not enabled in rvdata2_json
133
+ // Provide --original_dir or ensure ./Data folder exists in the current directory
134
+ R3EXS json_rvdata2 ./JSON
135
+
136
+ // If --complete was enabled in rvdata2_json
137
+ // --original_dir is not required
138
+ R3EXS json_rvdata2 -c ./JSON
139
+ ```
140
+
141
+ ### [Extract all strings](#function-list)
142
+
143
+ ```bash
144
+ NAME
145
+ ex_strings - Extract all strings
146
+
147
+ SYNOPSIS
148
+
149
+ R3EXS [global options] ex_strings [command options] <the *.json dir>
150
+
151
+ COMMAND OPTIONS
152
+ -o, --output_dir=DIRECTORY - The ManualTransFile.json or ManualTransFile_scripts.json output dir (default: ./)
153
+ -p, --[no-]with_scripts_separate - Enable Scripts extraction into a separate ManualTransFile_scripts.json
154
+ -s, --[no-]with_scripts - Enable Scripts extraction
155
+ -y, --[no-]with_symbol - Enable Symbol extraction in Scripts extraction
156
+ ```
157
+
158
+ Example code:
159
+
160
+ ```bash
161
+ // Do not extract Scripts
162
+ R3EXS ex_strings ./JSON
163
+
164
+ // Extract Scripts
165
+ R3EXS ex_strings -s ./JSON
166
+
167
+ // Extract Scripts and separate them into ManualTransFile_scripts.json
168
+ R3EXS ex_strings -s -p ./JSON
169
+ ```
170
+
171
+ ### [Inject all strings](#function-list)
172
+
173
+ ```bash
174
+ NAME
175
+ in_strings - Inject all strings
176
+
177
+ SYNOPSIS
178
+
179
+ R3EXS [global options] in_strings [command options] <the *.json dir>
180
+
181
+ COMMAND OPTIONS
182
+ -m, --manualtransfile_path=FILE - The ManualTransFile.json path (default: ./ManualTransFile.json)
183
+ -o, --output_dir=DIRECTORY - The NEW *.json output dir (default: ./JSON_NEW)
184
+ -s, --[no-]with_scripts - Enable Scripts Injection
185
+ ```
186
+
187
+ Example code:
188
+
189
+ ```bash
190
+ // Do not inject into Scripts
191
+ R3EXS in_strings ./JSON
192
+
193
+ // Inject into Scripts
194
+ R3EXS in_strings -s ./JSON
195
+ ```
196
+
197
+ ---
198
+
199
+ For more information, use
200
+
201
+ ```bash
202
+ R3EXS help
203
+ ```
204
+
205
+ ## [Project Build](#contents)
206
+
207
+ To build and run the project, first clone the entire repository:
208
+
209
+ ```bash
210
+ git clone git@github.com:LuoTat/R3EXS.git
211
+ ```
212
+
213
+ Then use `bundle` to install dependencies:
214
+
215
+ ```bash
216
+ bundle install
217
+ ```
218
+
219
+ Finally, compile the C extension:
220
+
221
+ ```bash
222
+ rake compile
223
+ ```
224
+
225
+ ---
226
+
227
+ Build the local documentation:
228
+
229
+ ```bash
230
+ yardoc
231
+ ```
232
+
233
+ Build the `R3EXS_Ocran.exe` file:
234
+
235
+ ```bash
236
+ rake ocran
237
+ ```
238
+
239
+ View all rake tasks:
240
+
241
+ ```bash
242
+ rake -T
243
+ ```
244
+
245
+ ## [Documentation](#contents)
246
+
247
+ [R3EXS Api Documentation](https://rubydoc.info/gems/R3EXS)
248
+
249
+ ## [Links](#contents)
250
+
251
+ - [oj](https://github.com/ohler55/oj)
252
+ - [gli](https://github.com/davetron5000/gli)
253
+ - [Prism](https://github.com/ruby/prism)
254
+ - [Ocran](https://github.com/Largo/ocran)
255
+ - [Tebako](https://github.com/tamatebako/tebako)
256
+ - [RGSS3](https://github.com/taroxd/RGSS3)
257
+ - [rvdata2json](https://github.com/DICE2000/rvdata2json)
258
+ - [VX-Ace-Translator](https://github.com/AhmedAhmedEG/VX-Ace-Translator)
259
+ - [RPGMakerDecrypter](https://github.com/uuksu/RPGMakerDecrypter)
260
+ - [RPGMaker VX Ace F1-Manual](https://miaowm5.github.io/RMVA-F1)
data/bin/R3EXS CHANGED
@@ -60,7 +60,7 @@ class App
60
60
 
61
61
  c.action do |global_options, options, args|
62
62
  begin
63
- R3EXS.rvdata2_json(args[0], options[:output_dir], options[:complete], options[:with_scripts], options[:with_notes])
63
+ R3EXS.rvdata2_json(Pathname(args[0]), Pathname(options[:output_dir]), options[:complete], options[:with_scripts], options[:with_notes])
64
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}"
@@ -92,7 +92,7 @@ class App
92
92
 
93
93
  c.action do |global_options, options, args|
94
94
  begin
95
- R3EXS.json_rvdata2(args[0], options[:output_dir], options[:original_dir], options[:complete], options[:with_scripts])
95
+ R3EXS.json_rvdata2(Pathname(args[0]), Pathname(options[:output_dir]), Pathname(options[:original_dir]), options[:complete], options[:with_scripts])
96
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}"
@@ -114,13 +114,9 @@ class App
114
114
  rescue R3EXS::Rvdata2DirError => e
115
115
  $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
116
116
  $stderr.puts 'You are supposed to privide the original rvdata2 dir in complete deserialization mode'
117
- rescue R3EXS::ScriptsDirError => e
118
- $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
119
- $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"
120
- $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help rvdata2_json#{R3EXS::Utils::RESET_COLOR}'"
121
117
  rescue R3EXS::ScriptsInfoPathError => e
122
118
  $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
123
- $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"
119
+ $stderr.puts "Make sure the Scripts_info.json is in the Scripts directory"
124
120
  $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help rvdata2_json#{R3EXS::Utils::RESET_COLOR}'"
125
121
  end
126
122
  end
@@ -145,7 +141,7 @@ class App
145
141
 
146
142
  c.action do |global_options, options, args|
147
143
  begin
148
- R3EXS.ex_strings(args[0], options[:output_dir], options[:with_scripts], options[:with_symbol], options[:with_scripts_separate])
144
+ R3EXS.ex_strings(Pathname(args[0]), Pathname(options[:output_dir]), options[:with_scripts], options[:with_symbol], options[:with_scripts_separate])
149
145
  if options[:with_scripts_separate]
150
146
  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
147
  else
@@ -158,10 +154,6 @@ class App
158
154
  $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help json_rvdata2#{R3EXS::Utils::RESET_COLOR}'"
159
155
  rescue R3EXS::JsonDirError => e
160
156
  $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
161
- rescue R3EXS::ScriptsDirError => e
162
- $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
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"
164
- $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help rvdata2_json#{R3EXS::Utils::RESET_COLOR}'"
165
157
  end
166
158
  end
167
159
  end
@@ -184,7 +176,7 @@ class App
184
176
 
185
177
  c.action do |global_options, options, args|
186
178
  begin
187
- R3EXS.in_strings(args[0], options[:output_dir], options[:manualtransfile_path], options[:with_scripts])
179
+ R3EXS.in_strings(Pathname(args[0]), Pathname(options[:output_dir]), Pathname(options[:manualtransfile_path]), options[:with_scripts])
188
180
  puts "#{R3EXS::Utils::GREEN_COLOR}All new JSON files have been written to #{options[:output_dir]}#{R3EXS::Utils::RESET_COLOR}"
189
181
  rescue R3EXS::R3EXSJsonFileError => e
190
182
  $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
@@ -193,13 +185,9 @@ class App
193
185
  $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help json_rvdata2#{R3EXS::Utils::RESET_COLOR}'"
194
186
  rescue R3EXS::JsonDirError => e
195
187
  $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
196
- rescue R3EXS::ScriptsDirError => e
197
- $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
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
- $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help rvdata2_json#{R3EXS::Utils::RESET_COLOR}'"
200
188
  rescue R3EXS::ScriptsInfoPathError => e
201
189
  $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"
190
+ $stderr.puts "Make sure the Scripts_info.json is in the Scripts directory"
203
191
  $stderr.puts "For more information, please enter '#{R3EXS::Utils::GREEN_COLOR}R3EXS help rvdata2_json#{R3EXS::Utils::RESET_COLOR}'"
204
192
  rescue R3EXS::ManualTransFilePathError => e
205
193
  $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{e.message}#{R3EXS::Utils::RESET_COLOR}"
@@ -220,7 +208,9 @@ class App
220
208
  on_error do |exception|
221
209
  # Error logic here
222
210
  # return false to skip default error handling
223
- true
211
+ $stderr.puts "#{R3EXS::Utils::RED_COLOR}#{exception.message}#{R3EXS::Utils::RESET_COLOR}"
212
+ $stderr.puts exception.backtrace
213
+ false
224
214
  end
225
215
  end
226
216