word-to-markdown 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/word-to-markdown.rb +8 -1
- data/lib/word-to-markdown/version.rb +1 -1
- 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: b10e59ed47c691019e5e3fab11c739a10bb2d527
|
4
|
+
data.tar.gz: 2570568e6cb60e1a4edece91170958f97972a21a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a99f39ae16bba3d3dc5c99fa90c852257631f92eb76b51480355257881543fa2d2b07bed4f650984553d47c13fb68621e9da3be2a4fe68257383a3cb5c9b5e5
|
7
|
+
data.tar.gz: 8902090e82f2f6446d94f6764ba3052a863c2dc92cf31106d687ef606843aa37e39b1b1364fe78e37bd66f60fb9760a2f51efe08505e70db823e75047074b31f
|
data/lib/word-to-markdown.rb
CHANGED
@@ -63,14 +63,21 @@ class WordToMarkdown
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
+
def self.soffice?
|
67
|
+
@soffice ||= !(soffice_path.nil? || soffice_version.nil?)
|
68
|
+
end
|
69
|
+
|
66
70
|
def self.run_command(*args)
|
71
|
+
raise "LibreOffice executable not found" unless soffice?
|
67
72
|
output, status = Open3.capture2e(soffice_path, *args)
|
68
73
|
raise "Command `#{soffice_path} #{args.join(" ")}` failed: #{output}" if status != 0
|
69
74
|
output
|
70
75
|
end
|
71
76
|
|
72
77
|
def self.soffice_version
|
73
|
-
|
78
|
+
return if soffice_path.nil?
|
79
|
+
output, status = Open3.capture2e(soffice_path, "--version")
|
80
|
+
output.strip.sub "LibreOffice ", "" if status == 0
|
74
81
|
end
|
75
82
|
|
76
83
|
# Pretty print the class in console
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: word-to-markdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reverse_markdown
|