kabosu 0.6.11.2.dev.20260820.e3b82b2 → 0.6.11.2.dev.20260820.ec28095
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/kabosu/dict_manager.rb +20 -11
- data/lib/kabosu/version.rb +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: 23041fbc74a59ee64b4345b3bc8d163be430add2eabcf57ed1a30a37dab19c81
|
|
4
|
+
data.tar.gz: 52825859398c63cb40bb53a98332dc3c7b805a0b6ba67b4ace87ee7ceb57496e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d9f377ec80053ae89b04c221a103a0151729cc377351ad82f8d77e25912abedad1415abcbc3779a921bf2714f1ddb167909fcc7a2992aaed21f1d083a591a2e
|
|
7
|
+
data.tar.gz: ca4389df96f4208acf08062b3fd5b291fe39af0ce0b2d225cdc5f1c54f2d9202a84d7a76dd5a3b3ecaf4ab01fc69c224cd5ee77f177ed15d95d0e8a5e696c8ac
|
data/lib/kabosu/dict_manager.rb
CHANGED
|
@@ -317,16 +317,25 @@ module Kabosu
|
|
|
317
317
|
warn "Extracting..."
|
|
318
318
|
Zip::File.open(zip_path) do |archive|
|
|
319
319
|
archive.each do |entry|
|
|
320
|
-
#
|
|
321
|
-
#
|
|
322
|
-
#
|
|
323
|
-
#
|
|
324
|
-
#
|
|
325
|
-
#
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
320
|
+
# Both layouts are flattened into dest_dir, which is already
|
|
321
|
+
# `sudachi-dictionary-{version}`.
|
|
322
|
+
#
|
|
323
|
+
# Legacy zips nest their contents under a `sudachi-dictionary-{version}/`
|
|
324
|
+
# directory of their own, so joining the entry name to dest_dir landed
|
|
325
|
+
# the dictionary at `sudachi-dictionary-{version}/sudachi-dictionary-{version}/system_core.dic`
|
|
326
|
+
# and every install of a pre-v20260723 release failed with "expected
|
|
327
|
+
# ... after extraction, but file not found". It went unnoticed because a
|
|
328
|
+
# machine that already had a dictionary never re-installs one.
|
|
329
|
+
#
|
|
330
|
+
# Wheels nest differently again (`sudachidict_{edition}/resources/system.dic`)
|
|
331
|
+
# and name the file `system.dic`, so that one is renamed to carry the
|
|
332
|
+
# edition. Taking the basename handles both, and there is nothing in
|
|
333
|
+
# these archives whose structure is worth keeping: a `.dic`, a LEGAL and
|
|
334
|
+
# a licence.
|
|
335
|
+
target_name = File.basename(entry.name)
|
|
336
|
+
target_name = "system_#{edition}.dic" if edition && target_name == "system.dic"
|
|
337
|
+
|
|
338
|
+
next if entry.directory?
|
|
330
339
|
|
|
331
340
|
target = File.join(dest_dir, target_name)
|
|
332
341
|
# Guard against zip-slip — refuse entries that escape dest_dir.
|
|
@@ -334,7 +343,7 @@ module Kabosu
|
|
|
334
343
|
raise DownloadError, "Refusing to extract entry outside dest_dir: #{entry.name}"
|
|
335
344
|
end
|
|
336
345
|
|
|
337
|
-
FileUtils.mkdir_p(
|
|
346
|
+
FileUtils.mkdir_p(dest_dir)
|
|
338
347
|
entry.extract(target) { true } # overwrite existing
|
|
339
348
|
end
|
|
340
349
|
end
|
data/lib/kabosu/version.rb
CHANGED