tahweel 0.1.3 → 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: 6027595d10d04766f78272cac14463b3e03170e70657f7ac4816892071e2b32e
4
- data.tar.gz: 0f9018f0685cc4ca405457f32be6634726ef94ae95cfbb033de377c02b2efdd3
3
+ metadata.gz: 8cb3d1bf1d0d59df923c5e053495365686b801ead838b1c5ad0a041dd7d41680
4
+ data.tar.gz: 217f9c4cb6c1b80c9b6e2e1339017118db0267da1658b92c838ba8c27068c704
5
5
  SHA512:
6
- metadata.gz: 45965d2c724c3321c139b20c4e26b3d69a6563bdad3458c9ceff7f6e69d8bb36bc8692ad7c7012621d59c721a50bad7fb14574d7f062c8a2efbb7baf39491b03
7
- data.tar.gz: 4fe13629f6c265d3850860a04eb199a845980bb41ba9427686eee751b0e04c70501c6435507b9b28f2a672d91dd1a5c80e957da0a0de9e9bd3009071e786c407
6
+ metadata.gz: 065fe83ee58f3971854e806f83e2a0704e4eb1c93b65d69794b9a4c96965dc83aca89e49cb597cd36a030f282b6fb9a3b2cb1be52d32bf829182f822a6ab13b7
7
+ data.tar.gz: 4da39bb05db82d55b46ad1758719b60a0757d0a32eee320b72e0a8a583db8f2689b4baecf10f11a16cacef310ab339d16cd11114727dbf7ccf32f90788ec2ba9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
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
+
9
+ ## [0.1.4] - 2026-01-07
10
+
11
+ ### Changed
12
+
13
+ - Fix Windows encoding issue in `PdfSplitter#total_pages`
14
+
3
15
  ## [0.1.3] - 2026-01-07
4
16
 
5
17
  ### 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,10 +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}"`.encode(
164
- "UTF-8",
165
- invalid: :replace, undef: :replace, replace: ""
166
- )
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: "")
167
167
 
168
168
  pages = output[/Pages:\s*(\d+)/, 1]
169
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.3"
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.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ali Hamdi Ali Fadel