ezprint 0.3.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +12 -6
- data/README.rdoc +12 -6
- data/ezprint.gemspec +2 -6
- data/lib/ezprint/processors/pdfkit.rb +3 -3
- data/lib/ezprint/processors/prince.rb +3 -3
- metadata +35 -54
- data/Rakefile +0 -42
data/README
CHANGED
@@ -2,9 +2,9 @@ Ezprint
|
|
2
2
|
=======
|
3
3
|
|
4
4
|
Ezprint is a drop in replacement for the princely plugin. It uses PDFKit
|
5
|
-
as the backend instead of princexml, possibly saving you millions of
|
6
|
-
dollars. I recommend using the Rack middleware component of PDFKit to
|
7
|
-
print PDFs in rails, but this plugin makes an easy transition from
|
5
|
+
as the backend instead of princexml, possibly saving you millions of
|
6
|
+
dollars. I recommend using the Rack middleware component of PDFKit to
|
7
|
+
print PDFs in rails, but this plugin makes an easy transition from
|
8
8
|
prince->PDFKit for those using princely.
|
9
9
|
|
10
10
|
Installation
|
@@ -23,7 +23,7 @@ then run "bundle install"
|
|
23
23
|
Example
|
24
24
|
=======
|
25
25
|
|
26
|
-
The examples here are similar to princely, since the
|
26
|
+
The examples here are similar to princely, since the
|
27
27
|
plugin is basically a reworking of the princely source
|
28
28
|
|
29
29
|
class PDFExample < ApplicationController
|
@@ -31,14 +31,14 @@ class PDFExample < ApplicationController
|
|
31
31
|
respond_to do |format|
|
32
32
|
format.html
|
33
33
|
format.pdf do
|
34
|
-
render :pdf => "My Awesome PDF",
|
34
|
+
render :pdf => "My Awesome PDF",
|
35
35
|
:template => "controller/action.pdf.erb",
|
36
36
|
:stylesheets => ["application","print"]
|
37
37
|
:layout => "pdf"
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
# Alternatively, you can use make_and_send_pdf to
|
43
43
|
# render out a PDF for the action without a
|
44
44
|
# respond_to block.
|
@@ -76,6 +76,12 @@ module Ezprint
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
Possible Gotchas
|
80
|
+
================
|
81
|
+
|
82
|
+
If you're getting a "Broken Pipe" error when rendering PDF documents, you may need to
|
83
|
+
install the wkhtmltopdf-binary gem or put it in your Gemfile.
|
84
|
+
|
79
85
|
|
80
86
|
Credits
|
81
87
|
=======
|
data/README.rdoc
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
= Ezprint
|
2
2
|
|
3
3
|
Ezprint is a drop in replacement for the princely plugin. It uses PDFKit
|
4
|
-
as the backend instead of princexml, possibly saving you millions of
|
5
|
-
dollars. I recommend using the Rack middleware component of PDFKit to
|
6
|
-
print PDFs in rails, but this plugin makes an easy transition from
|
4
|
+
as the backend instead of princexml, possibly saving you millions of
|
5
|
+
dollars. I recommend using the Rack middleware component of PDFKit to
|
6
|
+
print PDFs in rails, but this plugin makes an easy transition from
|
7
7
|
prince->PDFKit for those using princely.
|
8
8
|
|
9
9
|
== Installation
|
@@ -22,7 +22,7 @@ then run "bundle install"
|
|
22
22
|
|
23
23
|
== Example
|
24
24
|
|
25
|
-
The examples here are similar to princely, since the
|
25
|
+
The examples here are similar to princely, since the
|
26
26
|
plugin is basically a reworking of the princely source
|
27
27
|
|
28
28
|
class PDFExample < ApplicationController
|
@@ -30,14 +30,14 @@ then run "bundle install"
|
|
30
30
|
respond_to do |format|
|
31
31
|
format.html
|
32
32
|
format.pdf do
|
33
|
-
render :pdf => "My Awesome PDF",
|
33
|
+
render :pdf => "My Awesome PDF",
|
34
34
|
:template => "controller/action.pdf.erb",
|
35
35
|
:stylesheets => ["application","print"]
|
36
36
|
:layout => "pdf"
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
# Alternatively, you can use make_and_send_pdf to
|
42
42
|
# render out a PDF for the action without a
|
43
43
|
# respond_to block.
|
@@ -73,6 +73,12 @@ It's also easy to create your own processor:
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
== Possible Gotchas
|
77
|
+
|
78
|
+
If you're getting a "Broken Pipe" error when rendering PDF documents, you may need to
|
79
|
+
install the wkhtmltopdf-binary gem or put it in your Gemfile.
|
80
|
+
|
81
|
+
|
76
82
|
== Credits
|
77
83
|
|
78
84
|
* Michael Bleigh for writing the awesome princely plugin, which most of the code is reworked from.
|
data/ezprint.gemspec
CHANGED
@@ -1,15 +1,12 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
5
2
|
|
6
3
|
Gem::Specification.new do |s|
|
7
4
|
s.name = %q{ezprint}
|
8
|
-
s.version = "0.
|
5
|
+
s.version = "1.0.0"
|
9
6
|
|
10
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
8
|
s.authors = ["Jason Stewart"]
|
12
|
-
s.date = %q{
|
9
|
+
s.date = %q{2012-10-27}
|
13
10
|
s.description = %q{A Rails wrapper for the PDFkit library. Meant to be a drop in replacement for princely.}
|
14
11
|
s.email = %q{jstewart@fusionary.com}
|
15
12
|
s.extra_rdoc_files = [
|
@@ -21,7 +18,6 @@ Gem::Specification.new do |s|
|
|
21
18
|
"MIT-LICENSE",
|
22
19
|
"README",
|
23
20
|
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
21
|
"VERSION",
|
26
22
|
"ezprint.gemspec",
|
27
23
|
"init.rb",
|
@@ -12,9 +12,9 @@ module Ezprint
|
|
12
12
|
|
13
13
|
def self.process_html(html)
|
14
14
|
# reroute absolute paths
|
15
|
-
html.gsub!("src=\"/", "src=\"#{
|
16
|
-
html.gsub!("href=\"/", "src=\"#{
|
17
|
-
html.gsub!("url(/", "url(#{
|
15
|
+
html.gsub!("src=\"/", "src=\"#{Rails.public_path}/")
|
16
|
+
html.gsub!("href=\"/", "src=\"#{Rails.public_path}/")
|
17
|
+
html.gsub!("url(/", "url(#{Rails.public_path}/")
|
18
18
|
html
|
19
19
|
end
|
20
20
|
end
|
@@ -25,9 +25,9 @@ module Ezprint
|
|
25
25
|
|
26
26
|
def self.process_html(html)
|
27
27
|
# reroute absolute paths
|
28
|
-
html.gsub!("src=\"/", "src=\"#{
|
29
|
-
html.gsub!("href=\"/", "src=\"#{
|
30
|
-
html.gsub!("url(/", "url(#{
|
28
|
+
html.gsub!("src=\"/", "src=\"#{Rails.public_path}/")
|
29
|
+
html.gsub!("href=\"/", "src=\"#{Rails.public_path}/")
|
30
|
+
html.gsub!("url(/", "url(#{Rails.public_path}/")
|
31
31
|
html
|
32
32
|
end
|
33
33
|
end
|
metadata
CHANGED
@@ -1,54 +1,45 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ezprint
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
- 1
|
10
|
-
version: 0.3.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jason Stewart
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-10-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: pdfkit
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
18
|
+
requirements:
|
27
19
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 11
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 5
|
33
|
-
- 0
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 0.5.0
|
35
22
|
type: :runtime
|
36
|
-
|
37
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.5.0
|
30
|
+
description: A Rails wrapper for the PDFkit library. Meant to be a drop in replacement
|
31
|
+
for princely.
|
38
32
|
email: jstewart@fusionary.com
|
39
33
|
executables: []
|
40
|
-
|
41
34
|
extensions: []
|
42
|
-
|
43
|
-
extra_rdoc_files:
|
35
|
+
extra_rdoc_files:
|
44
36
|
- README
|
45
37
|
- README.rdoc
|
46
|
-
files:
|
38
|
+
files:
|
47
39
|
- .document
|
48
40
|
- MIT-LICENSE
|
49
41
|
- README
|
50
42
|
- README.rdoc
|
51
|
-
- Rakefile
|
52
43
|
- VERSION
|
53
44
|
- ezprint.gemspec
|
54
45
|
- init.rb
|
@@ -58,39 +49,29 @@ files:
|
|
58
49
|
- lib/ezprint/processors/pdfkit.rb
|
59
50
|
- lib/ezprint/processors/prince.rb
|
60
51
|
- lib/ezprint/railtie.rb
|
61
|
-
has_rdoc: true
|
62
52
|
homepage: http://github.com/jstewart/ezprint
|
63
53
|
licenses: []
|
64
|
-
|
65
54
|
post_install_message:
|
66
55
|
rdoc_options: []
|
67
|
-
|
68
|
-
require_paths:
|
56
|
+
require_paths:
|
69
57
|
- lib
|
70
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
59
|
none: false
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
|
77
|
-
- 0
|
78
|
-
version: "0"
|
79
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
65
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
|
85
|
-
segments:
|
86
|
-
- 0
|
87
|
-
version: "0"
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
88
70
|
requirements: []
|
89
|
-
|
90
71
|
rubyforge_project:
|
91
|
-
rubygems_version: 1.
|
72
|
+
rubygems_version: 1.8.23
|
92
73
|
signing_key:
|
93
74
|
specification_version: 3
|
94
|
-
summary: A Rails wrapper for the PDFkit library. Meant to be a drop in replacement
|
75
|
+
summary: A Rails wrapper for the PDFkit library. Meant to be a drop in replacement
|
76
|
+
for princely.
|
95
77
|
test_files: []
|
96
|
-
|
data/Rakefile
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "ezprint"
|
8
|
-
gem.summary = %Q{A Rails wrapper for the PDFkit library. Meant to be a drop in replacement for princely.}
|
9
|
-
gem.description = %Q{A Rails wrapper for the PDFkit library. Meant to be a drop in replacement for princely.}
|
10
|
-
gem.email = "jstewart@fusionary.com"
|
11
|
-
gem.homepage = "http://github.com/jstewart/ezprint"
|
12
|
-
gem.authors = ["Jason Stewart"]
|
13
|
-
gem.add_dependency 'pdfkit', '~> 0.5.0'
|
14
|
-
end
|
15
|
-
|
16
|
-
rescue LoadError
|
17
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
18
|
-
end
|
19
|
-
|
20
|
-
require 'rake/testtask'
|
21
|
-
Rake::TestTask.new(:test) do |test|
|
22
|
-
test.libs << 'lib' << 'test'
|
23
|
-
test.pattern = 'test/**/*_test.rb'
|
24
|
-
test.verbose = true
|
25
|
-
end
|
26
|
-
|
27
|
-
task :default => :test
|
28
|
-
|
29
|
-
require 'rake/rdoctask'
|
30
|
-
Rake::RDocTask.new do |rdoc|
|
31
|
-
if File.exist?('VERSION')
|
32
|
-
version = File.read('VERSION')
|
33
|
-
else
|
34
|
-
version = ""
|
35
|
-
end
|
36
|
-
|
37
|
-
rdoc.rdoc_dir = 'rdoc'
|
38
|
-
rdoc.title = "ezprint #{version}"
|
39
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
40
|
-
rdoc.rdoc_files.include('README*')
|
41
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
42
|
-
end
|