File tree Expand file tree Collapse file tree 2 files changed +20
-38
lines changed Expand file tree Collapse file tree 2 files changed +20
-38
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ class BinaryManager
1212 def self . platform
1313 @platform ||= begin
1414 host_os = RbConfig ::CONFIG [ 'host_os' ]
15- puts "DEBUG: host_os: #{ host_os } "
1615 case host_os
1716 when /darwin|mac os/
1817 :macos
@@ -27,7 +26,6 @@ def self.platform
2726 def self . arch
2827 @arch ||= begin
2928 host_cpu = RbConfig ::CONFIG [ 'host_cpu' ]
30- puts "DEBUG: host_cpu: #{ host_cpu } "
3129 case host_cpu
3230 when /x86_64|amd64/
3331 :x64
@@ -42,26 +40,24 @@ def self.arch
4240 end
4341
4442 def self . binary_name
45- name = case platform
46- when :macos
47- case arch
48- when :x64
49- 'pdfium-mac-x64.tgz'
50- when :arm64
51- 'pdfium-mac-arm64.tgz'
52- end
53- when :linux
54- case arch
55- when :x64
56- 'pdfium-linux-x64.tgz'
57- when :x86
58- 'pdfium-linux-x86.tgz'
59- when :arm64
60- 'pdfium-linux-arm64.tgz'
61- end
62- end
63- puts "DEBUG: binary_name: #{ name } "
64- name
43+ case platform
44+ when :macos
45+ case arch
46+ when :x64
47+ 'pdfium-mac-x64.tgz'
48+ when :arm64
49+ 'pdfium-mac-arm64.tgz'
50+ end
51+ when :linux
52+ case arch
53+ when :x64
54+ 'pdfium-linux-x64.tgz'
55+ when :x86
56+ 'pdfium-linux-x86.tgz'
57+ when :arm64
58+ 'pdfium-linux-arm64.tgz'
59+ end
60+ end
6561 end
6662
6763 def self . binary_url
@@ -72,16 +68,12 @@ def self.install_path
7268 @install_path ||= begin
7369 # When running as a gem extension, install to the gem's directory
7470 gem_root = File . expand_path ( '../..' , __dir__ )
75- puts "DEBUG: __dir__: #{ __dir__ } "
76- puts "DEBUG: gem_root: #{ gem_root } "
7771 File . join ( gem_root , 'vendor' , 'pdfium' )
7872 end
7973 end
8074
8175 def self . library_path
82- path = File . join ( install_path , 'lib' , library_name )
83- puts "DEBUG: library_path: #{ path } "
84- path
76+ File . join ( install_path , 'lib' , library_name )
8577 end
8678
8779 def self . library_name
Original file line number Diff line number Diff line change 33module Pdfium
44 module Lib
55 extend ::FFI ::Library
6- path = BinaryManager . library_path
7- puts "DEBUG: Loading library from: #{ path } "
8- puts "DEBUG: File exists: #{ File . exist? ( path ) } "
9- if File . exist? ( path )
10- puts "DEBUG: File size: #{ File . size ( path ) } "
11- else
12- dir = File . dirname ( path )
13- puts "DEBUG: Directory exists: #{ File . exist? ( dir ) } "
14- puts "DEBUG: Directory contents: #{ Dir . glob ( dir + '/*' ) } " if File . exist? ( dir )
15- end
16- ffi_lib path
6+ ffi_lib BinaryManager . library_path
177
188 # Basic PDFium types
199 typedef :pointer , :fpdf_document
You can’t perform that action at this time.
0 commit comments