rvpacker-txt 1.8.2 → 1.8.3
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/lib/read.rb +14 -21
- data/lib/write.rb +3 -1
- data/rvpacker-txt.gemspec +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: d5ce1335835077b4b76bf730aa575ea20154820b5b559f7d61380c79411b7e38
|
|
4
|
+
data.tar.gz: 0c3541e70ccd8e19a0b76bbc664dab7a4b577b9f6aea1c7cfa40347b4ddc7740
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d2fe0d75f34329cf4d81c7b8dea7d10c7cd428e0a95940d076cc3c792bfe5038df069ed2736a067defa80548baf96b541b6b457a51f4637d96279a7f90bec36
|
|
7
|
+
data.tar.gz: 7dc34c760e8d68817446552bd9930c3900ebe43bfac68bec9a5fa68ff23edceef0c6adcce353ea1f0554343994fbb6184f19fe0cf783dfca02d38e61dc938725
|
data/lib/read.rb
CHANGED
|
@@ -75,8 +75,9 @@ def self.parse_parameter(code, parameter, game_type)
|
|
|
75
75
|
when 401, 405
|
|
76
76
|
case game_type
|
|
77
77
|
when 'lisa'
|
|
78
|
-
match = parameter.scan(
|
|
79
|
-
|
|
78
|
+
match = parameter.scan(/^\\et\[[0-9]+\]/)
|
|
79
|
+
match = parameter.scan(/^\\nbt/) if match.empty?
|
|
80
|
+
parameter = parameter[match[0].length..] unless match.empty?
|
|
80
81
|
else
|
|
81
82
|
nil
|
|
82
83
|
end
|
|
@@ -93,23 +94,14 @@ def self.parse_parameter(code, parameter, game_type)
|
|
|
93
94
|
end
|
|
94
95
|
|
|
95
96
|
# @param [String] variable
|
|
96
|
-
# @param [String]
|
|
97
|
+
# @param [String] _game_type
|
|
97
98
|
# @return [String]
|
|
98
|
-
def self.parse_variable(variable,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
case game_type
|
|
106
|
-
when 'lisa'
|
|
107
|
-
return nil unless variable.split('\#').all? { |line| line.match?(/^<.*>\.?$/) || line.empty? }
|
|
108
|
-
else
|
|
109
|
-
nil
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
end
|
|
99
|
+
def self.parse_variable(variable, _game_type)
|
|
100
|
+
variable = variable.gsub(/\r?\n/, '\#') if variable.count("\n").positive?
|
|
101
|
+
return nil if variable.split('\#').all? { |line| line.strip.match?(/(^#? ?<.*>\.?$)|^$/) }
|
|
102
|
+
return nil if variable.match?(/^[+-]?[0-9]*$/) ||
|
|
103
|
+
variable.match?(/---/) ||
|
|
104
|
+
variable.match?(/restrict eval/)
|
|
113
105
|
|
|
114
106
|
variable
|
|
115
107
|
end
|
|
@@ -356,11 +348,12 @@ def self.read_other(other_files_paths, output_path, logging, game_type, processi
|
|
|
356
348
|
unless allowed_codes.include?(code)
|
|
357
349
|
if in_sequence
|
|
358
350
|
joined = line.join('\#').strip
|
|
351
|
+
parsed = parse_parameter(401, joined, game_type)
|
|
359
352
|
|
|
360
|
-
other_translation_map.insert_at_index(other_lines.length,
|
|
361
|
-
!other_translation_map.include?(
|
|
353
|
+
other_translation_map.insert_at_index(other_lines.length, parsed, '') if inner_processing_type == :append &&
|
|
354
|
+
!other_translation_map.include?(parsed)
|
|
362
355
|
|
|
363
|
-
other_lines.add(
|
|
356
|
+
other_lines.add(parsed)
|
|
364
357
|
|
|
365
358
|
line.clear
|
|
366
359
|
in_sequence = false
|
data/lib/write.rb
CHANGED
|
@@ -80,7 +80,8 @@ def self.get_parameter_translated(code, parameter, hashmap, game_type)
|
|
|
80
80
|
when 401, 405
|
|
81
81
|
case game_type
|
|
82
82
|
when 'lisa'
|
|
83
|
-
match = parameter.scan(
|
|
83
|
+
match = parameter.scan(/^\\et\[[0-9]+\]/)
|
|
84
|
+
match = parameter.scan(/^\\nbt/) if match.empty?
|
|
84
85
|
|
|
85
86
|
unless match.empty?
|
|
86
87
|
lisa_start = match[0]
|
|
@@ -98,6 +99,7 @@ def self.get_parameter_translated(code, parameter, hashmap, game_type)
|
|
|
98
99
|
end
|
|
99
100
|
|
|
100
101
|
gotten = hashmap[parameter]
|
|
102
|
+
return nil if gotten.nil?
|
|
101
103
|
|
|
102
104
|
case game_type
|
|
103
105
|
when 'lisa'
|
data/rvpacker-txt.gemspec
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = 'rvpacker-txt'
|
|
5
|
-
spec.version = '1.8.
|
|
5
|
+
spec.version = '1.8.3'
|
|
6
6
|
spec.authors = ['Howard Jeng', 'Andrew Kesterson', 'Solistra', 'Darkness9724', 'savannstm']
|
|
7
7
|
spec.email = ['savannstm@gmail.com']
|
|
8
8
|
spec.summary = 'Reads or writes RPG Maker XP/VX/VXAce game text to .txt files'
|