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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23041fbc74a59ee64b4345b3bc8d163be430add2eabcf57ed1a30a37dab19c81
4
- data.tar.gz: 52825859398c63cb40bb53a98332dc3c7b805a0b6ba67b4ace87ee7ceb57496e
3
+ metadata.gz: 6c85514bf874eaf5656a233a9083c9d0d39894be4bdc7f26c8237d1d9ad76638
4
+ data.tar.gz: d633d07153880c398ed6cdd2eee45d51a09b2bd4f9d38357166e122b49e9f158
5
5
  SHA512:
6
- metadata.gz: 3d9f377ec80053ae89b04c221a103a0151729cc377351ad82f8d77e25912abedad1415abcbc3779a921bf2714f1ddb167909fcc7a2992aaed21f1d083a591a2e
7
- data.tar.gz: ca4389df96f4208acf08062b3fd5b291fe39af0ce0b2d225cdc5f1c54f2d9202a84d7a76dd5a3b3ecaf4ab01fc69c224cd5ee77f177ed15d95d0e8a5e696c8ac
6
+ metadata.gz: 74c60f74afcac0e759a12e42b62ebecaae4fdbd9bf93f4a9d9df36b8ea8ea68abc8a23e514963bb9df429e4749be41c665e54c64fe9ccb8b8143cf6e3d9faa51
7
+ data.tar.gz: fddf3a735228b149809ae5b05f2d0cbaf69c154e693ce08159ecdfdd2961b2b30d13ce9f527b9e67585fdc7c03097976aca70f68a62132d5ce401491cdd028b2
@@ -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
- # 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?
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(dest_dir)
337
+ FileUtils.mkdir_p(File.dirname(target))
347
338
  entry.extract(target) { true } # overwrite existing
348
339
  end
349
340
  end
@@ -1,3 +1,3 @@
1
1
  module Kabosu
2
- VERSION = "0.6.11.2.dev.20260820.ec28095".freeze
2
+ VERSION = "0.6.11.2".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.ec28095
4
+ version: 0.6.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - davafons