kabosu 0.6.11.2-aarch64-linux → 0.6.11.4-aarch64-linux

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: 6310222bef7890fd2ae5882d39f312a656d2bbfbb115d41a9dff80ac94b11932
4
- data.tar.gz: f6d831203d5a58c208f7fee1b21f0036b9d0c344fc16652f8cf1e5fe7ef38e46
3
+ metadata.gz: f280c805cbd2980833e2209d61058c86491e825f3effa0b0d00fe12dc1c29b36
4
+ data.tar.gz: 6fb1f2755f2d49ff2c6e28ba529dfe2339a21479475167b3863f07705526e913
5
5
  SHA512:
6
- metadata.gz: f945a86f63e3694fb8bb4a199dbb83470977ed77f1e0d0ae41f66482986e9ff4d9acf148affb77e7e7a4487f512924f54884f92d0155d85cb0787494dd9d825f
7
- data.tar.gz: 3a85e6084607c95ff81d0a1807813c625b1a4d9d84ae28c21626ae97d8b501b1a38131306cd38b8cd2939d1fb0e8acbe763cb415c9cb7fc80c44d5a027b775fc
6
+ metadata.gz: a5f0e29a22aedd8414662ac4d57469e6285454d7a45d7531d509231ea9062f7eeb77f07fb3ab36c768af81565d7c40f5f2fc60c4bf21b08ba76bfab288331b84
7
+ data.tar.gz: a23470c82e400dba78b37c799958cf7e945ce4331d5b76999fcf28e49b895cde282326c6c6de54a91e6db9f801218f4bca942edba459e81318e46cc9dd0b8c1e
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -58,19 +58,17 @@ module Kabosu
58
58
  raise DownloadError, "No downloadable assets for #{version}/#{edition}" if sources.empty?
59
59
 
60
60
  sources.each do |source|
61
- begin
62
- download(source.fetch(:url), source.fetch(:archive_path))
63
- extract(source.fetch(:archive_path), dest_dir, edition: edition)
64
- FileUtils.rm_f(source.fetch(:archive_path))
65
- break
66
- rescue DownloadError => e
67
- FileUtils.rm_f(source.fetch(:archive_path)) if File.exist?(source.fetch(:archive_path))
68
- # Try the next candidate (e.g. wheel if the zip 404s). If this was
69
- # the last one, surface the original error.
70
- raise if sources.last.equal?(source)
71
-
72
- warn " falling back: #{e.message}"
73
- end
61
+ download(source.fetch(:url), source.fetch(:archive_path))
62
+ extract(source.fetch(:archive_path), dest_dir, edition: edition)
63
+ FileUtils.rm_f(source.fetch(:archive_path))
64
+ break
65
+ rescue DownloadError => e
66
+ FileUtils.rm_f(source.fetch(:archive_path))
67
+ # Try the next candidate (e.g. wheel if the zip 404s). If this was
68
+ # the last one, surface the original error.
69
+ raise if sources.last.equal?(source)
70
+
71
+ warn " falling back: #{e.message}"
74
72
  end
75
73
 
76
74
  raise DownloadError, "Expected #{dic_path} after extraction, but file not found" unless File.exist?(dic_path)
@@ -214,7 +212,8 @@ module Kabosu
214
212
  def pick_release_sources(version, edition)
215
213
  candidates = []
216
214
  zip = release_asset_url(version, edition)
217
- candidates << { url: zip, archive_path: File.join(@dir, "sudachi-dictionary-#{version}-#{edition}.zip"), format: :zip }
215
+ candidates << { url: zip, archive_path: File.join(@dir, "sudachi-dictionary-#{version}-#{edition}.zip"),
216
+ format: :zip }
218
217
 
219
218
  begin
220
219
  release = fetch_release(version)
@@ -317,25 +316,28 @@ module Kabosu
317
316
  warn "Extracting..."
318
317
  Zip::File.open(zip_path) do |archive|
319
318
  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
330
-
331
- target = File.join(dest_dir, target_name)
332
- # Guard against zip-slip — refuse entries that escape dest_dir.
333
- unless File.expand_path(target).start_with?(File.expand_path(dest_dir) + File::SEPARATOR)
334
- raise DownloadError, "Refusing to extract entry outside dest_dir: #{entry.name}"
335
- end
336
-
337
- FileUtils.mkdir_p(File.dirname(target))
338
- entry.extract(target) { true } # overwrite existing
319
+ # Both layouts are flattened into dest_dir, which is already
320
+ # `sudachi-dictionary-{version}`.
321
+ #
322
+ # Legacy zips nest their contents under a `sudachi-dictionary-{version}/`
323
+ # directory of their own, so joining the entry name to dest_dir landed
324
+ # the dictionary at `sudachi-dictionary-{version}/sudachi-dictionary-{version}/system_core.dic`
325
+ # and every install of a pre-v20260723 release failed with "expected
326
+ # ... after extraction, but file not found". It went unnoticed because a
327
+ # machine that already had a dictionary never re-installs one.
328
+ #
329
+ # Wheels nest differently again (`sudachidict_{edition}/resources/system.dic`)
330
+ # and name the file `system.dic`, so that one is renamed to carry the
331
+ # edition. Taking the basename handles both, and there is nothing in
332
+ # these archives whose structure is worth keeping: a `.dic`, a LEGAL and
333
+ # a licence.
334
+ target_name = File.basename(entry.name)
335
+ target_name = "system_#{edition}.dic" if edition && target_name == "system.dic"
336
+
337
+ next if entry.directory?
338
+
339
+ FileUtils.mkdir_p(dest_dir)
340
+ entry.extract(target_name, destination_directory: dest_dir) { true }
339
341
  end
340
342
  end
341
343
  rescue Zip::Error => e
@@ -1,3 +1,3 @@
1
1
  module Kabosu
2
- VERSION = "0.6.11.2".freeze
2
+ VERSION = "0.6.11.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kabosu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11.2
4
+ version: 0.6.11.4
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - davafons
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-20 00:00:00.000000000 Z
11
+ date: 2026-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.3'
19
+ version: '3.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.3'
26
+ version: '3.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: benchmark
29
29
  requirement: !ruby/object:Gem::Requirement