wkhtmltopdf_for_rails 0.0.4 → 0.0.5
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.md +1 -0
- data/VERSION +1 -1
- data/bin/wkhtmltopdf +2 -2
- data/lib/render_pdf.rb +4 -4
- data/lib/wkhtmltopdf.rb +3 -1
- data/lib/wkhtmltopdf_for_rails.rb +1 -1
- metadata +28 -41
- data/README +0 -0
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
[](https://codeclimate.com/github/aratak/wkhtmltopdf_for_rails)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/bin/wkhtmltopdf
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
|
3
|
-
if RUBY_PLATFORM =~ /linux/ &&
|
3
|
+
if RUBY_PLATFORM =~ /linux/ && 1.size == 4
|
4
4
|
executable = 'wkhtmltopdf_linux_386'
|
5
|
-
elsif RUBY_PLATFORM =~ /linux/ &&
|
5
|
+
elsif RUBY_PLATFORM =~ /linux/ && 1.size == 8
|
6
6
|
executable = 'wkhtmltopdf-amd64'
|
7
7
|
elsif RUBY_PLATFORM =~ /darwin/
|
8
8
|
executable = 'wkhtmltopdf_darwin_386'
|
data/lib/render_pdf.rb
CHANGED
@@ -45,17 +45,17 @@ module RenderPdf
|
|
45
45
|
render_options[:template] = options.delete(:template)
|
46
46
|
render_options[:layout] = options.delete(:layout) if options.has_key?(:layout)
|
47
47
|
|
48
|
-
html_string = render_to_string(render_options)
|
48
|
+
html_string = render_to_string(render_options).to_str
|
49
49
|
|
50
50
|
# re-route absolute paths for images, scripts and stylesheets
|
51
|
-
html_string.gsub!( /src=["']+([^:]+?)["']/i ) { |m| "src=\"#{
|
52
|
-
html_string.gsub!( /<link href=["']+([^:]+?)["']/i ) { |m| "<link href=\"#{
|
51
|
+
html_string.gsub!( /src=["']+([^:]+?)["']/i ) { |m| "src=\"#{::Rails.root}/public" + $1 + '"' }
|
52
|
+
html_string.gsub!( /<link href=["']+([^:]+?)["']/i ) { |m| "<link href=\"#{::Rails.root}/public" + $1 + '"' }
|
53
53
|
|
54
54
|
# Remove asset ids on images, scripts, and stylesheets with a regex
|
55
55
|
html_string.gsub!( /src=["'](\S+\?\d*)["']/i ) { |m| 'src="' + $1.split('?').first + '"' }
|
56
56
|
html_string.gsub!( /<link href=["'](\S+\?\d*)["']/i ) { |m| '<link href="' + $1.split('?').first + '"' }
|
57
57
|
|
58
|
-
return html_string
|
58
|
+
return html_string.html_safe
|
59
59
|
end
|
60
60
|
|
61
61
|
end
|
data/lib/wkhtmltopdf.rb
CHANGED
metadata
CHANGED
@@ -1,40 +1,31 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: wkhtmltopdf_for_rails
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
version: 0.0.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Alexey Osipenko
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
date: 2010-04-29 00:00:00 +03:00
|
18
|
-
default_executable:
|
12
|
+
date: 2010-04-29 00:00:00.000000000 Z
|
19
13
|
dependencies: []
|
20
|
-
|
21
14
|
description: Provides WKHTMLTOPDF for ruby on rails.
|
22
15
|
email: alexey@osipenko.in.ua
|
23
|
-
executables:
|
16
|
+
executables:
|
24
17
|
- wkhtmltopdf
|
25
18
|
- wkhtmltopdf-amd64
|
26
19
|
- wkhtmltopdf-binary.rb
|
27
20
|
- wkhtmltopdf_darwin_386
|
28
21
|
- wkhtmltopdf_linux_386
|
29
|
-
- wkhtmltopdf
|
30
22
|
extensions: []
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
files:
|
23
|
+
extra_rdoc_files:
|
24
|
+
- README.md
|
25
|
+
files:
|
35
26
|
- .gitignore
|
36
27
|
- Manifest
|
37
|
-
- README
|
28
|
+
- README.md
|
38
29
|
- VERSION
|
39
30
|
- bin/wkhtmltopdf
|
40
31
|
- bin/wkhtmltopdf-amd64
|
@@ -52,37 +43,33 @@ files:
|
|
52
43
|
- test/tmp/.gitkeep
|
53
44
|
- test/wkhtmltopdf_test.rb
|
54
45
|
- test/wkhtmltopdf_test_controller_test.rb
|
55
|
-
has_rdoc: true
|
56
46
|
homepage: http://github.com/aratak/wkhtmltopdf_for_rails
|
57
47
|
licenses: []
|
58
|
-
|
59
48
|
post_install_message:
|
60
|
-
rdoc_options:
|
49
|
+
rdoc_options:
|
61
50
|
- --charset=UTF-8
|
62
|
-
require_paths:
|
51
|
+
require_paths:
|
63
52
|
- lib
|
64
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
- 0
|
77
|
-
version: "0"
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
78
65
|
requirements: []
|
79
|
-
|
80
66
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.
|
67
|
+
rubygems_version: 1.8.23
|
82
68
|
signing_key:
|
83
69
|
specification_version: 3
|
84
70
|
summary: Provides WKHTMLTOPDF for ruby on rails.
|
85
|
-
test_files:
|
71
|
+
test_files:
|
86
72
|
- test/test_helper.rb
|
87
73
|
- test/wkhtmltopdf_test.rb
|
88
74
|
- test/wkhtmltopdf_test_controller_test.rb
|
75
|
+
has_rdoc:
|
data/README
DELETED
File without changes
|