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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60b1612d27f5be3fb6f753559aaefba3afba4fc6805056254a040f931e9678bc
4
- data.tar.gz: faa01af31c2ba94e9e4424ede8ae040190686d3574ccdfb0e7c7468ca8801c22
3
+ metadata.gz: 23041fbc74a59ee64b4345b3bc8d163be430add2eabcf57ed1a30a37dab19c81
4
+ data.tar.gz: 52825859398c63cb40bb53a98332dc3c7b805a0b6ba67b4ace87ee7ceb57496e
5
5
  SHA512:
6
- metadata.gz: f34f6b4e6ef3ade64689dafe39e51d6f290b32e4eb9a9a39c85191404cb9e1113c02bd7a71c4cb61cb856c7c8d70a1577efeafad8f68fb4a1365c9c055ab671b
7
- data.tar.gz: 4a244ee7b70de397d22393cba80236ad702077897ca09df75ac5949f59688a5000df4293b8df10a4b13cc79a91281a744fa39ec8f53548e39782ae9e5bcae1eb
6
+ metadata.gz: 3d9f377ec80053ae89b04c221a103a0151729cc377351ad82f8d77e25912abedad1415abcbc3779a921bf2714f1ddb167909fcc7a2992aaed21f1d083a591a2e
7
+ data.tar.gz: ca4389df96f4208acf08062b3fd5b291fe39af0ce0b2d225cdc5f1c54f2d9202a84d7a76dd5a3b3ecaf4ab01fc69c224cd5ee77f177ed15d95d0e8a5e696c8ac
@@ -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
- # 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
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(File.dirname(target))
346
+ FileUtils.mkdir_p(dest_dir)
338
347
  entry.extract(target) { true } # overwrite existing
339
348
  end
340
349
  end
@@ -1,3 +1,3 @@
1
1
  module Kabosu
2
- VERSION = "0.6.11.2.dev.20260820.e3b82b2".freeze
2
+ VERSION = "0.6.11.2.dev.20260820.ec28095".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kabosu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11.2.dev.20260820.e3b82b2
4
+ version: 0.6.11.2.dev.20260820.ec28095
5
5
  platform: ruby
6
6
  authors:
7
7
  - davafons