#!/usr/bin/ruby if RUBY_PLATFORM =~ /linux/ && 1.size == 4 executable = 'wkhtmltopdf_linux_386' elsif RUBY_PLATFORM =~ /linux/ && 1.size == 8 executable = 'wkhtmltopdf-amd64' elsif RUBY_PLATFORM =~ /darwin/ executable = 'wkhtmltopdf_darwin_386' else raise "Invalid platform. Must be running linux or intel-based Mac OS." end executable = File.join(File.dirname(__FILE__), executable) system(executable + " " + $*.join(" "))