rvpacker-txt 1.9.1 → 1.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea9153be0a603a97b9e717c2406e5ca7dd650973b6905d2189fa9025fce0e596
4
- data.tar.gz: 4505485e158a91d4f57d81da8ef5faf19ae74d152dae5da99d6f7fa3cd28401d
3
+ metadata.gz: 1c9a3067dbcaf3b73ae6f5585a85ab9cfa2df8e278a126912dfc38c2a6b8ef28
4
+ data.tar.gz: 2677325c92499d90a253130e5e86710553543aec957ba5d91555fefcfdeff559
5
5
  SHA512:
6
- metadata.gz: b2b12ddb9a56f214daa46f8e4f47186ce44336713a98fbeebc279c9c8616f99c042100ff5be3d28cad99f35624cc52849a7abffbe68e19714e2454d211039df9
7
- data.tar.gz: b2d1b0bdb6e74e68a26591fb11b06eb4ef964122a2bc251e36b0be40dbec24e8153fbbca0b15bfe7c56bad96377c489fe556cc0332311aa22ac5d94168d91447
6
+ metadata.gz: 940f7e419d6df9a86dd5b49f3433f033e0b2af6925b3cd6a1e8d9875251e07669771dfab323ab59b87cd9bbd9f6bb3265874487d2929b9f9a150e9cd0af86e3f
7
+ data.tar.gz: 5a0156005aaab1ee3c443a862b5be0d2f1c75d410203317af9de038a86734ad5b073fa646d26afa8a065e9e2eac7c002e0c03ad671e91ae5309c215a95b38da6
data/lib/extensions.rb ADDED
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @param [String] string
4
+ # @return [String]
5
+ def self.romanize_string(string)
6
+ string.each_char.each_with_index do |char, i|
7
+ case char
8
+ when '。'
9
+ string[i] = '.'
10
+ when '、'
11
+ string[i] = ','
12
+ when '・'
13
+ string[i] = '·'
14
+ when '゠'
15
+ string[i] = '–'
16
+ when '='
17
+ string[i] = '—'
18
+ when '…', '‥'
19
+ string[i, 3] = '...'
20
+ when '「', '」', '〈', '〉'
21
+ string[i] = "'"
22
+ when '『', '』', '《', '》'
23
+ string[i] = '"'
24
+ when '(', '〔', '⦅', '〘'
25
+ string[i] = '('
26
+ when ')', '〕', '⦆', '〙'
27
+ string[i] = ')'
28
+ when '{'
29
+ string[i] = '{'
30
+ when '}'
31
+ string[i] = '}'
32
+ when '[', '【', '〖', '〚'
33
+ string[i] = '['
34
+ when ']', '】', '〗', '〛'
35
+ string[i] = ']'
36
+ when '〜'
37
+ string[i] = '~'
38
+ when '?'
39
+ string[i] = '?'
40
+ when ':'
41
+ string[i] = ':'
42
+ when '!'
43
+ string[i] = '!'
44
+ else
45
+ nil
46
+ end
47
+ end
48
+
49
+ string
50
+ end
data/lib/read.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'extensions'
4
3
  require 'zlib'
4
+ require_relative 'extensions'
5
5
 
6
6
  STRING_IS_ONLY_SYMBOLS_RE = /^[.()+-:;\[\]^~%&!*\/→×??x%▼| ]+$/
7
7
  APPEND_FLAG_OMIT_MSG = "Files aren't already parsed. Continuing as if --append flag was omitted."
data/lib/write.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'zlib'
4
- require 'extensions'
4
+ require_relative 'extensions'
5
5
 
6
6
  # @param [String] string A parsed scripts code string, containing raw Ruby code
7
7
  # @return [Array<Array<String, Integer>>] Hash of parsed from code strings and their start indices
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.9.1'
5
+ spec.version = '1.9.3'
6
6
  spec.authors = ['Howard Jeng', 'Andrew Kesterson', 'Solistra', 'Darkness9724', 'savannstm']
7
7
  spec.email = ['savannstm@gmail.com']
8
8
  spec.summary = 'Reads RPG Maker XP/VX/VXAce game text to .txt files and writes them to their initial form.'
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
 
13
13
  spec.metadata = { 'homepage_uri' => 'https://github.com/savannstm/rvpacker-txt' }
14
14
 
15
- spec.files = %w[bin/rvpacker-txt lib/classes.rb lib/read.rb lib/write.rb Gemfile LICENSE README.md rvpacker-txt.gemspec]
15
+ spec.files = %w[bin/rvpacker-txt lib/classes.rb lib/read.rb lib/write.rb lib/extensions.rb Gemfile LICENSE README.md rvpacker-txt.gemspec]
16
16
  spec.executables = ['rvpacker-txt']
17
17
  spec.require_paths = ['lib']
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rvpacker-txt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Howard Jeng
@@ -27,6 +27,7 @@ files:
27
27
  - README.md
28
28
  - bin/rvpacker-txt
29
29
  - lib/classes.rb
30
+ - lib/extensions.rb
30
31
  - lib/read.rb
31
32
  - lib/write.rb
32
33
  - rvpacker-txt.gemspec