paru 0.2.5.10 → 0.2.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paru.rb +1 -1
- data/lib/paru/pandoc.rb +12 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9282ef053ebf34c9fa984dfa659ee43a5c709c69
|
4
|
+
data.tar.gz: bac7b12462299030feb2a1b98bbad33d2b7a58ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b13bcac43915c16c0ca09506917e8dc4dff83474a147b2fed9eece8c3458059c0c5d11aa035c7e96f560a970159c8299c68be6c5e28b22b46e9fed78d9659ad
|
7
|
+
data.tar.gz: '068180d8606414780dcd121b2bd1f4835eab8042b8258a6cae82dbd3e57762c343f15cb5bc6e680931f03f9978208ba314611e8c72a648364fc0ef75f705ae0e'
|
data/lib/paru.rb
CHANGED
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
|
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
|
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
|
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.
|
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.
|
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
|