html2pdf 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,101 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>~/Dropbox/spikes/code_exporter_original/spec/fixtures/sub_dir/demo4.xxx.rb.xhtml</title>
6
+ <meta name="Generator" content="Vim/7.4" />
7
+ <meta name="plugin-version" content="vim7.4_v1" />
8
+ <meta name="syntax" content="ruby" />
9
+ <meta name="settings" content="no_progress,number_lines,dynamic_folds,no_pre,use_xhtml,use_css,expand_tabs,line_ids,prevent_copy=" />
10
+ <meta name="colorscheme" content="Tomorrow-Night" />
11
+ <style type="text/css">
12
+
13
+ body { color: #bcbcbc; background-color: #262626; font-family: monospace; }
14
+ * { font-size: 1em; }
15
+ .Define { color: #af87af; }
16
+ .rubyConstant { color: #ffd787; }
17
+ .rubyInclude { color: #87afaf; }
18
+ .rubyStringDelimiter { color: #afaf5f; }
19
+ .Comment { color: #8a8a8a; }
20
+ .LineNr { color: #4e4e4e; }
21
+ .FoldColumn { color: #00ffff; background-color: #262626; padding-bottom: 1px; }
22
+ .String { color: #afaf5f; }
23
+ .FoldColumn { text-decoration: none; white-space: pre; }
24
+ .open-fold .Folded { display: none; }
25
+ .open-fold .fulltext { display: inline; }
26
+ .open-fold .toggle-open { display: none; }
27
+ .closed-fold .toggle-closed { display: inline; }
28
+
29
+ .closed-fold .fulltext { display: none; }
30
+ .closed-fold .Folded { display: inline; }
31
+ .closed-fold .toggle-open { display: inline; }
32
+ .closed-fold .toggle-closed { display: none; }
33
+
34
+ </style>
35
+
36
+ <script type='text/javascript'>
37
+ //<![CDATA[
38
+
39
+ function toggleFold(objID)
40
+ {
41
+ var fold;
42
+ fold = document.getElementById(objID);
43
+ if(fold.className == 'closed-fold')
44
+ {
45
+ fold.className = 'open-fold';
46
+ }
47
+ else if (fold.className == 'open-fold')
48
+ {
49
+ fold.className = 'closed-fold';
50
+ }
51
+ }
52
+
53
+ /* function to open any folds containing a jumped-to line before jumping to it */
54
+ function JumpToLine()
55
+ {
56
+ var lineNum;
57
+ lineNum = window.location.hash;
58
+ lineNum = lineNum.substr(1); /* strip off '#' */
59
+
60
+ if (lineNum.indexOf('L') == -1) {
61
+ lineNum = 'L'+lineNum;
62
+ }
63
+ lineElem = document.getElementById(lineNum);
64
+
65
+ /* navigate upwards in the DOM tree to open all folds containing the line */
66
+ var node = lineElem;
67
+ while (node && node.id != 'vimCodeElement')
68
+ {
69
+ if (node.className == 'closed-fold')
70
+ {
71
+ node.className = 'open-fold';
72
+ }
73
+ node = node.parentNode;
74
+ }
75
+ /* Always jump to new location even if the line was hidden inside a fold, or
76
+ * we corrected the raw number to a line ID.
77
+ */
78
+ if (lineElem) {
79
+ lineElem.scrollIntoView(true);
80
+ }
81
+ return true;
82
+ }
83
+ if ('onhashchange' in window) {
84
+ window.onhashchange = JumpToLine;
85
+ }
86
+
87
+ //]]>
88
+ </script>
89
+ </head>
90
+ <body onload='JumpToLine();'>
91
+ <div id='vimCodeElement'>
92
+ <span id="L1" class="LineNr">1&#160;</span><span class="Comment"># file: spec/fixtures/sub-dir/demo3.xxx.rb</span><br />
93
+ <span id="L2" class="LineNr">2&#160;</span><span class="Comment"># from: <a href="https://github.com/radar/guides/blob/master/gem-development/foodie/lib/foodie.rb">https://github.com/radar/guides/blob/master/gem-development/foodie/lib/foodie.rb</a></span><br />
94
+ <span id="L3" class="LineNr">3&#160;</span><span class="rubyInclude">require</span>&#160;<span class="rubyStringDelimiter">'</span><span class="String">foodie/food</span><span class="rubyStringDelimiter">'</span><br />
95
+ <span id="L4" class="LineNr">4&#160;</span><span class="Define">module</span>&#160;<span class="rubyConstant">Foodie</span><br />
96
+ <span id="L5" class="LineNr">5&#160;</span>&#160;&#160;<span class="Comment"># Your code goes here...</span><br />
97
+ <span id="L6" class="LineNr">6&#160;</span><span class="Define">end</span><br />
98
+ </div>
99
+ </body>
100
+ </html>
101
+ <!-- vim: set foldmethod=manual : -->
@@ -0,0 +1,14 @@
1
+ require_relative '../../test_helper'
2
+ describe Html2Pdf::Utils do
3
+ context '#to_pdf' do
4
+ it 'raises error on invalid input file' do
5
+ assert_raises(RuntimeError) { Html2Pdf::Utils.to_pdf('bad-file-name') }
6
+ end
7
+ end
8
+ context '#have_required_softwares' do
9
+ it 'raises error if the requirements are not met' do
10
+ assert(Html2Pdf::Utils.required_softwares?,
11
+ 'Must have valid installation of `wkhtmltopdf` and `ghostscript`')
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ require 'minitest/autorun'
2
+ require 'minitest/pride'
3
+ require 'minitest-spec-context'
4
+ require 'pry'
5
+ require 'awesome_print'
6
+ require_relative '../lib/html2pdf'
7
+ include Html2Pdf
metadata ADDED
@@ -0,0 +1,300 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: html2pdf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Burin Choomnuan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: agile_utils
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.5
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.0.5
41
+ - !ruby/object:Gem::Dependency
42
+ name: code_lister
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.6
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.6
55
+ - !ruby/object:Gem::Dependency
56
+ name: awesome_print
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.5'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.5'
83
+ - !ruby/object:Gem::Dependency
84
+ name: gem-ctags
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.6'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.6'
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard-minitest
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.2'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.2'
125
+ - !ruby/object:Gem::Dependency
126
+ name: minitest
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '4.2'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '4.2'
139
+ - !ruby/object:Gem::Dependency
140
+ name: minitest-filesystem
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 1.2.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 1.2.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: minitest-spec-context
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 0.0.3
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.0.3
167
+ - !ruby/object:Gem::Dependency
168
+ name: pry
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.9'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.9'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rake
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '10.1'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '10.1'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '0.20'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '0.20'
209
+ - !ruby/object:Gem::Dependency
210
+ name: yard
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '0.8'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '0.8'
223
+ description: Batch export html files to pdfs
224
+ email:
225
+ - agilecreativity@gmail.com
226
+ executables:
227
+ - html2pdf
228
+ extensions: []
229
+ extra_rdoc_files: []
230
+ files:
231
+ - ".gitignore"
232
+ - ".rubocop.yml"
233
+ - ".ruby-version"
234
+ - Gemfile
235
+ - Guardfile
236
+ - LICENSE.txt
237
+ - README.md
238
+ - Rakefile
239
+ - TODOs.md
240
+ - bin/html2pdf
241
+ - html2pdf.gemspec
242
+ - lib/html2pdf.rb
243
+ - lib/html2pdf/cli.rb
244
+ - lib/html2pdf/utils.rb
245
+ - lib/html2pdf/version.rb
246
+ - rubocop-todo.yml
247
+ - test/fixtures/samples/demo1_xxx.rb
248
+ - test/fixtures/samples/demo1_xxx.rb.xhtml
249
+ - test/fixtures/samples/demo1_xxx.rb.xhtml.pdf
250
+ - test/fixtures/samples/demo2_xxx.rb
251
+ - test/fixtures/samples/demo2_xxx.rb.xhtml
252
+ - test/fixtures/samples/demo2_xxx.rb.xhtml.pdf
253
+ - test/fixtures/samples/sub_dir/demo3_xxx.rb
254
+ - test/fixtures/samples/sub_dir/demo3_xxx.rb.xhtml
255
+ - test/fixtures/samples/sub_dir/demo3_xxx.rb.xhtml.pdf
256
+ - test/fixtures/samples/sub_dir/demo4_xxx.rb
257
+ - test/fixtures/samples/sub_dir/demo4_xxx.rb.xhtml
258
+ - test/fixtures/samples/sub_dir/demo4_xxx.rb.xhtml.pdf
259
+ - test/lib/html2pdf/test_utils.rb
260
+ - test/test_helper.rb
261
+ homepage: https://github.com/agilecreativity/html2pdf
262
+ licenses:
263
+ - MIT
264
+ metadata: {}
265
+ post_install_message:
266
+ rdoc_options: []
267
+ require_paths:
268
+ - lib
269
+ required_ruby_version: !ruby/object:Gem::Requirement
270
+ requirements:
271
+ - - ">="
272
+ - !ruby/object:Gem::Version
273
+ version: '0'
274
+ required_rubygems_version: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - ">="
277
+ - !ruby/object:Gem::Version
278
+ version: '0'
279
+ requirements: []
280
+ rubyforge_project:
281
+ rubygems_version: 2.2.2
282
+ signing_key:
283
+ specification_version: 4
284
+ summary: Export any list of html or xhtml files to pdfs
285
+ test_files:
286
+ - test/fixtures/samples/demo1_xxx.rb
287
+ - test/fixtures/samples/demo1_xxx.rb.xhtml
288
+ - test/fixtures/samples/demo1_xxx.rb.xhtml.pdf
289
+ - test/fixtures/samples/demo2_xxx.rb
290
+ - test/fixtures/samples/demo2_xxx.rb.xhtml
291
+ - test/fixtures/samples/demo2_xxx.rb.xhtml.pdf
292
+ - test/fixtures/samples/sub_dir/demo3_xxx.rb
293
+ - test/fixtures/samples/sub_dir/demo3_xxx.rb.xhtml
294
+ - test/fixtures/samples/sub_dir/demo3_xxx.rb.xhtml.pdf
295
+ - test/fixtures/samples/sub_dir/demo4_xxx.rb
296
+ - test/fixtures/samples/sub_dir/demo4_xxx.rb.xhtml
297
+ - test/fixtures/samples/sub_dir/demo4_xxx.rb.xhtml.pdf
298
+ - test/lib/html2pdf/test_utils.rb
299
+ - test/test_helper.rb
300
+ has_rdoc: