Module: WKHTMLTOPDF

Defined in:
lib/wkhtmltopdf.rb

Class Method Summary collapse

Class Method Details

.get_binary_pathObject



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/wkhtmltopdf.rb', line 2

def self.get_binary_path
  if RUBY_PLATFORM =~ /linux/
    executable = 'wkhtmltopdf_linux_386'
  elsif RUBY_PLATFORM =~ /darwin/
    executable = 'wkhtmltopdf_darwin_386'
  else
    raise "Invalid platform. Must be running linux or intel-based Mac OS."
  end
  bin_path = File.join(File.dirname(File.dirname( __FILE__)), 'bin')
  return File.join(bin_path, executable)
end