markover 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +20 -0
- data/README.md +102 -0
- data/bin/markover +31 -0
- data/config/style.css +174 -0
- data/ext/github_markup.rb +11 -0
- data/lib/markover.rb +31 -0
- data/lib/markover/config.rb +28 -0
- data/lib/markover/converter.rb +120 -0
- data/lib/markover/markup.rb +28 -0
- data/lib/markover/markup/code.rb +40 -0
- data/lib/markover/markup/code_block.rb +30 -0
- data/lib/markover/markup/renderer.rb +67 -0
- data/lib/markover/markup/yaml_frontmatter_remover.rb +17 -0
- data/lib/markover/markupfile.rb +67 -0
- data/lib/markover/optionparser.rb +93 -0
- data/lib/markover/path.rb +29 -0
- data/lib/markover/version.rb +6 -0
- data/lib/markover/wkhtmltopdf.rb +39 -0
- data/spec/fixtures/autolink_url.md +3 -0
- data/spec/fixtures/code_block.textile +8 -0
- data/spec/fixtures/code_block_with_utf8.textile +7 -0
- data/spec/fixtures/code_with_utf8.textile +6 -0
- data/spec/fixtures/integration/markdown.md +60 -0
- data/spec/fixtures/integration/style.css +3 -0
- data/spec/fixtures/integration/textile.textile +47 -0
- data/spec/fixtures/long_code_block.md +5 -0
- data/spec/fixtures/recursion/level1.textile +1 -0
- data/spec/fixtures/recursion/level2/level2.markdown +1 -0
- data/spec/fixtures/table.md +7 -0
- data/spec/fixtures/yaml_front_matter.textile +7 -0
- data/spec/integration_spec.rb +41 -0
- data/spec/markover/converter_spec.rb +124 -0
- data/spec/markover/markup/code_block_spec.rb +21 -0
- data/spec/markover/markup/code_spec.rb +45 -0
- data/spec/markover/markup/renderer_spec.rb +18 -0
- data/spec/markover/markup/yaml_frontmatter_remover_spec.rb +21 -0
- data/spec/markover/markup_file_spec.rb +45 -0
- data/spec/markover/path_spec.rb +32 -0
- data/spec/markover/wkhtmltopdf_spec.rb +35 -0
- data/spec/spec_helper.rb +11 -0
- metadata +228 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require './spec/spec_helper'
|
4
|
+
|
5
|
+
require './lib/markover'
|
6
|
+
|
7
|
+
describe Markover::Path do
|
8
|
+
|
9
|
+
it 'should find all files in the current directory, with no specified target, without recursion' do
|
10
|
+
mock(Dir).pwd { './spec/fixtures/recursion/' }
|
11
|
+
Markover::Path.list_valid(nil, false).length.should == 1
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should find all files in all subdirectories, with no specified target, with recursion ' do
|
15
|
+
mock(Dir).pwd { './spec/fixtures/recursion/' }
|
16
|
+
Markover::Path.list_valid(nil, true).length.should == 2
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should find all files in all subdirectories, with a specified directory, with recursion' do
|
20
|
+
Markover::Path.list_valid('./spec/fixtures/recursion/', true).length.should == 2
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should find one file, with a specified file, without recursion' do
|
24
|
+
Markover::Path.list_valid('./spec/fixtures/recursion/level1.textile', false).length.should == 1
|
25
|
+
end
|
26
|
+
|
27
|
+
# What is the sound of one file recursing?
|
28
|
+
it 'should find one file, with a specified file, with recursion' do
|
29
|
+
Markover::Path.list_valid('README.md', true).length.should == 1
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require './spec/spec_helper'
|
4
|
+
|
5
|
+
require './lib/markover'
|
6
|
+
|
7
|
+
describe Markover::Wkhtmltopdf do
|
8
|
+
|
9
|
+
before do
|
10
|
+
@wkhtmltopdf = Markover::Wkhtmltopdf.new
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should assemble correct command' do
|
14
|
+
mock(@wkhtmltopdf).bin { '"wkhtmltopdf"' }
|
15
|
+
args = @wkhtmltopdf.command('test.pdf')
|
16
|
+
args.size.should eq 4
|
17
|
+
args.should include '"wkhtmltopdf"'
|
18
|
+
args.should include '--quiet'
|
19
|
+
args.should include '-'
|
20
|
+
args.should include '"test.pdf"'
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should use which to find wkhtmltopdf first time' do
|
24
|
+
mock(@wkhtmltopdf).__double_definition_create__.call(:`, "which wkhtmltopdf") { '~/wkhtmltopdf' }
|
25
|
+
@wkhtmltopdf.bin.should eq '"~/wkhtmltopdf"'
|
26
|
+
@wkhtmltopdf.bin.should eq '"~/wkhtmltopdf"' # Should be cached
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should generate a pdf' do
|
30
|
+
mock(@wkhtmltopdf).__double_definition_create__.call(:`, "which wkhtmltopdf") { '~/wkhtmltopdf' }
|
31
|
+
mock(IO).popen("\"~/wkhtmltopdf\" --quiet - \"\"", "wb+") { true }
|
32
|
+
@wkhtmltopdf.output_pdf('', '')
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,228 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: markover
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Benjamin Kammerl
|
8
|
+
- Fredrik Wallgren
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-04-30 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: github-markup
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.7.4
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.7.4
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: redcarpet
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 2.1.1
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 2.1.1
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: RedCloth
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 4.2.7
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 4.2.7
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: coderay
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.0.7
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.0.7
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: nokogiri
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - "~>"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 1.5.5
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 1.5.5
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: wkhtmltopdf-binary
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.9.9.1
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 0.9.9.1
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rake
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rspec
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rr
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: bundler
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
description: Fork of the dead gimli project.
|
155
|
+
email: benny@itws.de
|
156
|
+
executables:
|
157
|
+
- markover
|
158
|
+
extensions: []
|
159
|
+
extra_rdoc_files:
|
160
|
+
- README.md
|
161
|
+
- LICENSE
|
162
|
+
files:
|
163
|
+
- LICENSE
|
164
|
+
- README.md
|
165
|
+
- bin/markover
|
166
|
+
- config/style.css
|
167
|
+
- ext/github_markup.rb
|
168
|
+
- lib/markover.rb
|
169
|
+
- lib/markover/config.rb
|
170
|
+
- lib/markover/converter.rb
|
171
|
+
- lib/markover/markup.rb
|
172
|
+
- lib/markover/markup/code.rb
|
173
|
+
- lib/markover/markup/code_block.rb
|
174
|
+
- lib/markover/markup/renderer.rb
|
175
|
+
- lib/markover/markup/yaml_frontmatter_remover.rb
|
176
|
+
- lib/markover/markupfile.rb
|
177
|
+
- lib/markover/optionparser.rb
|
178
|
+
- lib/markover/path.rb
|
179
|
+
- lib/markover/version.rb
|
180
|
+
- lib/markover/wkhtmltopdf.rb
|
181
|
+
- spec/fixtures/autolink_url.md
|
182
|
+
- spec/fixtures/code_block.textile
|
183
|
+
- spec/fixtures/code_block_with_utf8.textile
|
184
|
+
- spec/fixtures/code_with_utf8.textile
|
185
|
+
- spec/fixtures/integration/markdown.md
|
186
|
+
- spec/fixtures/integration/style.css
|
187
|
+
- spec/fixtures/integration/textile.textile
|
188
|
+
- spec/fixtures/long_code_block.md
|
189
|
+
- spec/fixtures/recursion/level1.textile
|
190
|
+
- spec/fixtures/recursion/level2/level2.markdown
|
191
|
+
- spec/fixtures/table.md
|
192
|
+
- spec/fixtures/yaml_front_matter.textile
|
193
|
+
- spec/integration_spec.rb
|
194
|
+
- spec/markover/converter_spec.rb
|
195
|
+
- spec/markover/markup/code_block_spec.rb
|
196
|
+
- spec/markover/markup/code_spec.rb
|
197
|
+
- spec/markover/markup/renderer_spec.rb
|
198
|
+
- spec/markover/markup/yaml_frontmatter_remover_spec.rb
|
199
|
+
- spec/markover/markup_file_spec.rb
|
200
|
+
- spec/markover/path_spec.rb
|
201
|
+
- spec/markover/wkhtmltopdf_spec.rb
|
202
|
+
- spec/spec_helper.rb
|
203
|
+
homepage: https://github.com/phortx/markover
|
204
|
+
licenses: []
|
205
|
+
metadata: {}
|
206
|
+
post_install_message:
|
207
|
+
rdoc_options:
|
208
|
+
- "--charset=UTF-8"
|
209
|
+
require_paths:
|
210
|
+
- - lib
|
211
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
|
+
requirements:
|
218
|
+
- - ">="
|
219
|
+
- !ruby/object:Gem::Version
|
220
|
+
version: '0'
|
221
|
+
requirements: []
|
222
|
+
rubyforge_project: markover
|
223
|
+
rubygems_version: 2.2.2
|
224
|
+
signing_key:
|
225
|
+
specification_version: 4
|
226
|
+
summary: Utility for converting markup files to PDF files.
|
227
|
+
test_files: []
|
228
|
+
has_rdoc:
|