command_wrap 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of command_wrap might be problematic. Click here for more details.
- data/lib/command_wrap.rb +2 -1
- data/tests/unit/command_wrap_test.rb +13 -1
- metadata +4 -4
data/lib/command_wrap.rb
CHANGED
@@ -69,7 +69,8 @@ module CommandWrap
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
command = CommandWrap::Config::Xvfb.command(File.dirname(__FILE__) + "/../bin/wkhtmltopdf --print-media-type #{source} #{params} #{target}")
|
72
|
+
command = CommandWrap::Config::Xvfb.command(File.dirname(__FILE__) + "/../bin/wkhtmltopdf --quiet --print-media-type #{source} #{params} #{target}")
|
73
|
+
|
73
74
|
`#{command}`
|
74
75
|
|
75
76
|
File.delete(header_html) if header_html != '' && File.exist?(header_html)
|
@@ -122,6 +122,19 @@ class CommandWrapTest < Test::Unit::TestCase
|
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
+
def test_htmltopdf_in_server_mode
|
126
|
+
sleep 1
|
127
|
+
CommandWrap::Config::Xvfb.server_mode= true
|
128
|
+
source = File.dirname(__FILE__) + "/../helpers/test.html"
|
129
|
+
target = CommandWrap.temp('pdf')
|
130
|
+
assert_nothing_raised do
|
131
|
+
CommandWrap.htmltopdf(source, target)
|
132
|
+
assert File.exists?(target)
|
133
|
+
File.delete(target)
|
134
|
+
end
|
135
|
+
CommandWrap::Config::Xvfb.server_mode=false
|
136
|
+
end
|
137
|
+
|
125
138
|
def test_htmltopdf_with_commands
|
126
139
|
sleep 1
|
127
140
|
source = File.dirname(__FILE__) + "/../helpers/test.html"
|
@@ -130,7 +143,6 @@ class CommandWrapTest < Test::Unit::TestCase
|
|
130
143
|
footer = "<html><head><title>Footer</title></head><body><p>testing\nmultiple\nlines</p></body></html>"
|
131
144
|
header = "<html><head><title>Header</title></head><body><p>testing\nmultiple\nlines</p></body></html>"
|
132
145
|
CommandWrap.htmltopdf(source, target, :footer => footer, :header => header)
|
133
|
-
puts target
|
134
146
|
assert File.exists?(target)
|
135
147
|
File.delete(target)
|
136
148
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: command_wrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 2
|
10
|
+
version: 0.5.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stefaan Colman
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-19 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|