pandoc-ruby 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pandoc-ruby.rb +5 -3
- data/pandoc-ruby.gemspec +1 -1
- data/test/test_pandoc_ruby.rb +26 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1463781defea383e2173516fdbcd675b94e344744f46eecdd902a075e0ec9be8
|
4
|
+
data.tar.gz: 93e469307308ea223721b89c0084cbe5f05682417535956d3256653fa9824d7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5846c2d7a9dc807268512de610885fc6b10d1191273e85f229fced89bcec25e8b54faa05e8e5cc0660ee502cb5636dff0ac7eb4daa4b858ac676d97333f71476
|
7
|
+
data.tar.gz: 3121cc63b9f2739cae06d85ed008b138c113332f72ca45bc6268ae782e86ae139f5fdc2192d065bce8c99d8bd73ff93dc87064c517b81d0b6c6d8393f5c7b66d
|
data/lib/pandoc-ruby.rb
CHANGED
@@ -303,10 +303,12 @@ class PandocRuby
|
|
303
303
|
set_pandoc_ruby_options(flag, argument)
|
304
304
|
return '' if flag == 'timeout' # pandoc doesn't accept timeouts yet
|
305
305
|
|
306
|
-
if
|
307
|
-
"#{format_flag(flag)} #{argument}"
|
308
|
-
else
|
306
|
+
if argument.nil?
|
309
307
|
format_flag(flag)
|
308
|
+
elsif argument =~ /\s/
|
309
|
+
"#{format_flag(flag)} '#{argument}'"
|
310
|
+
else
|
311
|
+
"#{format_flag(flag)} #{argument}"
|
310
312
|
end
|
311
313
|
end
|
312
314
|
|
data/pandoc-ruby.gemspec
CHANGED
data/test/test_pandoc_ruby.rb
CHANGED
@@ -130,6 +130,32 @@ describe PandocRuby do
|
|
130
130
|
)
|
131
131
|
end
|
132
132
|
|
133
|
+
it 'supports output filenames without spaces' do
|
134
|
+
Tempfile.create('example') do |file|
|
135
|
+
PandocRuby.convert(
|
136
|
+
'# Example',
|
137
|
+
:from => 'markdown',
|
138
|
+
:to => 'html',
|
139
|
+
:output => file.path
|
140
|
+
)
|
141
|
+
file.rewind
|
142
|
+
assert_equal("<h1 id=\"example\">Example</h1>\n", file.read)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
it 'supports output filenames without spaces' do
|
147
|
+
Tempfile.create('example with spaces') do |file|
|
148
|
+
PandocRuby.convert(
|
149
|
+
'# Example',
|
150
|
+
:from => 'markdown',
|
151
|
+
:to => 'html',
|
152
|
+
:output => file.path
|
153
|
+
)
|
154
|
+
file.rewind
|
155
|
+
assert_equal("<h1 id=\"example\">Example</h1>\n", file.read)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
133
159
|
it 'raises RuntimeError from pandoc executable error' do
|
134
160
|
assert_raises(RuntimeError) do
|
135
161
|
PandocRuby.new('# hello', 'badopt').to_html5
|