-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathRakefile
More file actions
21 lines (16 loc) · 744 Bytes
/
Rakefile
File metadata and controls
21 lines (16 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
task :default => :docraptor
desc "Creates PDF via DocRaptor"
task :docraptor do
print 'Creating DocRaptor doc...'
require 'doc_raptor'
DocRaptor.api_key ENV['DRKEY']
pdf_html = File.read('output/Shopify-Developer-Book.html').gsub(/[^[:ascii:]]/) {|c| "&#x%X;" % c.ord}
File.open("output/Shopify-Developer-Book.raptor.pdf", "w+") do |f|
f.write DocRaptor.create(:document_content => pdf_html,
:name => "Shopify Developer Book",
:document_type => "pdf",
:prince_options => {:baseurl => 'http://cold-journey-9230.heroku.com/'},
:test => !ENV['REALDEAL'])
print "done!\n"
end
end