pandoc-ruby 2.1.1 → 2.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 560fc0d0f2fe55196b4f1d981d66748af59d29f7b86afa4797fd25109d7ad04c
4
- data.tar.gz: 991843c076e7816e99ba11778190e4a0e2b0385f9659a0e5579ecbc5b743d4e0
3
+ metadata.gz: 1463781defea383e2173516fdbcd675b94e344744f46eecdd902a075e0ec9be8
4
+ data.tar.gz: 93e469307308ea223721b89c0084cbe5f05682417535956d3256653fa9824d7d
5
5
  SHA512:
6
- metadata.gz: 8ef270181fe562d955430d0e7fd8198d3a6ddffb4737c2b725f30a7333cd6d49ec36b1e16e72ce7c11273445506b9a861a0cbd42c2a0be15e6ac6d11e2086e04
7
- data.tar.gz: a70b8400f8d38bebce010bab5dc8be1ac6b4559b1ad332b237fb2befea15d9080e4850d5a1aab68160513a269000be9c4f3549862b726b092e3fff5047666dfd
6
+ metadata.gz: 5846c2d7a9dc807268512de610885fc6b10d1191273e85f229fced89bcec25e8b54faa05e8e5cc0660ee502cb5636dff0ac7eb4daa4b858ac676d97333f71476
7
+ data.tar.gz: 3121cc63b9f2739cae06d85ed008b138c113332f72ca45bc6268ae782e86ae139f5fdc2192d065bce8c99d8bd73ff93dc87064c517b81d0b6c6d8393f5c7b66d
@@ -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 !argument.nil?
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
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'pandoc-ruby'
8
- s.version = '2.1.1'
8
+ s.version = '2.1.2'
9
9
  s.authors = ['William Melody']
10
10
  s.date = '2020-03-23'
11
11
  s.description = 'Ruby wrapper for Pandoc'
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandoc-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Melody