paru 0.2.5.10 → 0.2.5.11

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/paru.rb +1 -1
  3. data/lib/paru/pandoc.rb +12 -3
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4b6cb248dbcef616c5d6552f3dbe65a2e15d479
4
- data.tar.gz: 24919ff8bd3ae7ce696e6a5c3c88fba95aa2d691
3
+ metadata.gz: 9282ef053ebf34c9fa984dfa659ee43a5c709c69
4
+ data.tar.gz: bac7b12462299030feb2a1b98bbad33d2b7a58ae
5
5
  SHA512:
6
- metadata.gz: 3e603abb1e85a89b70db7e893d42926da15fe6ec2121b161d26d9ee5c185f682fe77c0a15781174b9716e27a8c05a217f313597934d3300b544b65d728f9c352
7
- data.tar.gz: 6aecc7c1f1e2a2c361c73a544f64be15043cb73822d6cc534e06f230f0cc87f8506feae39230a769dee851fe48e1ac9cb0fd9eae8dadd9c9042282ebef189e9f
6
+ metadata.gz: 9b13bcac43915c16c0ca09506917e8dc4dff83474a147b2fed9eece8c3458059c0c5d11aa035c7e96f560a970159c8299c68be6c5e28b22b46e9fed78d9659ad
7
+ data.tar.gz: '068180d8606414780dcd121b2bd1f4835eab8042b8258a6cae82dbd3e57762c343f15cb5bc6e680931f03f9978208ba314611e8c72a648364fc0ef75f705ae0e'
data/lib/paru.rb CHANGED
@@ -18,5 +18,5 @@
18
18
  #++
19
19
  module Paru
20
20
  # Paru's current version
21
- VERSION = [0, 2, 5, 10]
21
+ VERSION = [0, 2, 5, 11]
22
22
  end
data/lib/paru/pandoc.rb CHANGED
@@ -179,7 +179,7 @@ module Paru
179
179
  # @param option_sep [String] the string to separate options with
180
180
  # @return [String] This converter's command line invocation string.
181
181
  def to_command(option_sep = DEFAULT_OPTION_SEP)
182
- "#{@@pandoc_exec.shellescape}\t#{to_option_string option_sep}"
182
+ "#{escape(@@pandoc_exec)}\t#{to_option_string option_sep}"
183
183
  end
184
184
 
185
185
  private
@@ -199,11 +199,11 @@ module Paru
199
199
  when Array then
200
200
  # This option can occur multiple times: list each with its value.
201
201
  # For example: --css=main.css --css=print.css
202
- options_arr.push value.map {|val| "#{option_string}=#{val.to_s.shellescape}"}.join(option_sep)
202
+ options_arr.push value.map {|val| "#{option_string}=#{escape(val.to_s)}"}.join(option_sep)
203
203
  else
204
204
  # All options that aren't flags and can occur only once have the
205
205
  # same pattern: --option=value
206
- options_arr.push "#{option_string}=#{value.to_s.shellescape}"
206
+ options_arr.push "#{option_string}=#{escape(value.to_s)}"
207
207
  end
208
208
  end
209
209
  options_arr.join(option_sep)
@@ -282,6 +282,15 @@ module Paru
282
282
 
283
283
  private
284
284
 
285
+ def escape(str)
286
+ if Gem.win_platform?
287
+ escaped = str.gsub("\\", "\\\\")
288
+ "\"#{escaped}\""
289
+ else
290
+ str.shellescape
291
+ end
292
+ end
293
+
285
294
  def run_converter(command, input = nil)
286
295
  begin
287
296
  output = ''
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5.10
4
+ version: 0.2.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Huub de Beer
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project:
110
- rubygems_version: 2.5.2
110
+ rubygems_version: 2.6.11
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Paru is a ruby wrapper around pandoc