kabosu 0.6.11.2.dev.20260820.ec28095 → 0.6.11.2
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 +11 -20
- 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: 6c85514bf874eaf5656a233a9083c9d0d39894be4bdc7f26c8237d1d9ad76638
|
|
4
|
+
data.tar.gz: d633d07153880c398ed6cdd2eee45d51a09b2bd4f9d38357166e122b49e9f158
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 74c60f74afcac0e759a12e42b62ebecaae4fdbd9bf93f4a9d9df36b8ea8ea68abc8a23e514963bb9df429e4749be41c665e54c64fe9ccb8b8143cf6e3d9faa51
|
|
7
|
+
data.tar.gz: fddf3a735228b149809ae5b05f2d0cbaf69c154e693ce08159ecdfdd2961b2b30d13ce9f527b9e67585fdc7c03097976aca70f68a62132d5ce401491cdd028b2
|
data/lib/kabosu/dict_manager.rb
CHANGED
|
@@ -317,25 +317,16 @@ 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
|
-
|
|
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?
|
|
320
|
+
# Wheels (`sudachidict_{edition}/resources/system.dic`) carry the
|
|
321
|
+
# edition in the top-level directory; legacy zips name the file
|
|
322
|
+
# `system_{edition}.dic` already. When the entry is a `system.dic`
|
|
323
|
+
# inside a wheel and `edition:` was passed, land it at
|
|
324
|
+
# `dest_dir/system_{edition}.dic` so `find`/`installed` keep working
|
|
325
|
+
# without a separate code path.
|
|
326
|
+
target_name = entry.name
|
|
327
|
+
if edition && File.basename(entry.name) == "system.dic"
|
|
328
|
+
target_name = "system_#{edition}.dic"
|
|
329
|
+
end
|
|
339
330
|
|
|
340
331
|
target = File.join(dest_dir, target_name)
|
|
341
332
|
# Guard against zip-slip — refuse entries that escape dest_dir.
|
|
@@ -343,7 +334,7 @@ module Kabosu
|
|
|
343
334
|
raise DownloadError, "Refusing to extract entry outside dest_dir: #{entry.name}"
|
|
344
335
|
end
|
|
345
336
|
|
|
346
|
-
FileUtils.mkdir_p(
|
|
337
|
+
FileUtils.mkdir_p(File.dirname(target))
|
|
347
338
|
entry.extract(target) { true } # overwrite existing
|
|
348
339
|
end
|
|
349
340
|
end
|
data/lib/kabosu/version.rb
CHANGED