tahweel 0.1.4 → 0.1.5

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: 162fd5253be8e0c0873bbedb1bd0218a57964bbbfd27616e327aaa5624092894
4
- data.tar.gz: 1ce916a6abd98caa715e226ceacb0cbc32aecd5a317f75c397ac353fee9006c4
3
+ metadata.gz: 8cb3d1bf1d0d59df923c5e053495365686b801ead838b1c5ad0a041dd7d41680
4
+ data.tar.gz: 217f9c4cb6c1b80c9b6e2e1339017118db0267da1658b92c838ba8c27068c704
5
5
  SHA512:
6
- metadata.gz: 7f7aee9ddc925f4b351bf167420cbf5176a06e522aa5c82164778b4bd2e6abf028574c8835ab887f2ac9333ba7e45e14f5f80697d135961066a14f375313498e
7
- data.tar.gz: 11e0c1347dfa5a7d746ce15d5702c5edf5ad115162b9698e07a76d340d5ba7116e1aa438cd98433d6833f7df46a74bdc635c64f0a79e0a617b5efa373aa7dcb6
6
+ metadata.gz: 065fe83ee58f3971854e806f83e2a0704e4eb1c93b65d69794b9a4c96965dc83aca89e49cb597cd36a030f282b6fb9a3b2cb1be52d32bf829182f822a6ab13b7
7
+ data.tar.gz: 4da39bb05db82d55b46ad1758719b60a0757d0a32eee320b72e0a8a583db8f2689b4baecf10f11a16cacef310ab339d16cd11114727dbf7ccf32f90788ec2ba9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.5] - 2026-01-07
4
+
5
+ ### Changed
6
+
7
+ - Fix Windows encoding issue in `PdfSplitter#total_pages` using `Open3.capture2`
8
+
3
9
  ## [0.1.4] - 2026-01-07
4
10
 
5
11
  ### Changed
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "etc"
4
4
  require "fileutils"
5
+ require "open3"
5
6
  require "securerandom"
6
7
  require "tmpdir"
7
8
 
@@ -160,9 +161,9 @@ module Tahweel
160
161
  # @return [Integer] The page count.
161
162
  def total_pages
162
163
  @total_pages ||= begin
163
- output = `#{PopplerInstaller.pdfinfo_path} "#{pdf_path}"`
164
- .b # Force to binary to handle Windows encoding issues
165
- .encode("UTF-8", invalid: :replace, undef: :replace, replace: "")
164
+ # Use Open3.capture2 to avoid shell interpolation encoding issues with Arabic/Unicode paths
165
+ output, = Open3.capture2(PopplerInstaller.pdfinfo_path, pdf_path)
166
+ output = output.b.encode("UTF-8", invalid: :replace, undef: :replace, replace: "")
166
167
 
167
168
  pages = output[/Pages:\s*(\d+)/, 1]
168
169
  raise "Failed to get page count from PDF: #{output}" unless pages
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tahweel
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tahweel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ali Hamdi Ali Fadel