Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added wicked_pdf support + tests for pdfkit (instead of exception if unavailable) #1

Merged
merged 4 commits into from

2 participants

@camdez

Hey Brad,

Thanks for wkhtmltopdf-heroku, it made my life a little easier! I didn't know if you'd be interested in merging my changes into the master branch—no hard feelings if you don't but I thought I'd offer them up.

Thanks again!

@bradphelan bradphelan merged commit b890573 into rposborne:master
@camdez

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 21, 2011
  1. @camdez

    Support wicked_pdf

    camdez authored
  2. @camdez

    Updated README

    camdez authored
  3. @camdez

    Minor clean-up

    camdez authored
Commits on Jan 3, 2012
  1. @camdez
This page is out of date. Refresh to see the latest.
View
10 README.mdown
@@ -0,0 +1,10 @@
+# wkhtmltopdf-heroku
+
+Provides a [wkhtmltopdf](http://code.google.com/p/wkhtmltopdf/) binary for [Heroku](http://www.heroku.com/).
+
+Preconfigures [pdfkit](https://rubygems.org/gems/pdfkit) and [wicked_pdf](https://rubygems.org/gems/wicked_pdf) to use this binary if they are loaded.
+
+## Copyright
+
+Copyright (c) 2011 Brad Phelan. See LICENSE.txt for further details.
+
View
9 README.rdoc
@@ -1,9 +0,0 @@
-= wkhtmltopdf-heroku
-
-Binaries for wkhtmltopdf for OSX and Heroku
-
-== Copyright
-
-Copyright (c) 2011 Brad Phelan. See LICENSE.txt for
-further details.
-
View
25 lib/wkhtmltopdf-heroku.rb
@@ -1,10 +1,17 @@
-# config/initializers/pdfkit.rb
-require 'pdfkit'
-PDFKit.configure do |config|
- config.wkhtmltopdf = File.expand_path "../../bin/wkhtmltopdf-linux-amd64", __FILE__
- # config.default_options = {
- # :page_size => 'Legal',
- # :print_media_type => true
- # }
- # config.root_url = "http://localhost" # Use only if your external hostname is unavailable on the server.
+WKHTMLTOPDF_PATH = File.expand_path "../../bin/wkhtmltopdf-linux-amd64", __FILE__
+
+begin
+ require 'pdfkit'
+
+ PDFKit.configure do |config|
+ config.wkhtmltopdf = WKHTMLTOPDF_PATH
+ end
+rescue LoadError
+end
+
+begin
+ require 'wicked_pdf'
+
+ WickedPdf.config[:exe_path] = WKHTMLTOPDF_PATH
+rescue LoadError
end
View
8 wkhtmltopdf-heroku.gemspec
@@ -9,20 +9,20 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = [%q{Brad Phelan}]
- s.date = %q{2011-09-26}
+ s.date = %q{2012-01-03}
s.description = %q{wkhtmltopdf binaries heroku}
s.email = %q{bradphelan@xtargets.com}
s.executables = [%q{wkhtmltopdf-linux-amd64}]
s.extra_rdoc_files = [
"LICENSE.txt",
- "README.rdoc"
+ "README.mdown"
]
s.files = [
".document",
"Gemfile",
"Gemfile.lock",
"LICENSE.txt",
- "README.rdoc",
+ "README.mdown",
"Rakefile",
"VERSION",
"bin/wkhtmltopdf-linux-amd64",
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
s.homepage = %q{http://github.com/bradphelan/wkhtmltopdf-heroku}
s.licenses = [%q{MIT}]
s.require_paths = [%q{lib}]
- s.rubygems_version = %q{1.8.8}
+ s.rubygems_version = %q{1.8.6}
s.summary = %q{wkhtmltopdf binaries for heroku}
if s.respond_to? :specification_version then
Something went wrong with that request. Please try again.