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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08754da1501d6e4918d753a0727a6fc28fe17962
4
- data.tar.gz: 4947e109b790a2c61575ce8349b0f11f51598320
3
+ metadata.gz: b10e59ed47c691019e5e3fab11c739a10bb2d527
4
+ data.tar.gz: 2570568e6cb60e1a4edece91170958f97972a21a
5
5
  SHA512:
6
- metadata.gz: b70ac3cf257afc4eea9e591923bb43835d6f1a31b45bf0d6a39728acbbd55bc759e2d88f9f3d9456740d683552f4379aa046b321121cf5721f7114ab634d788c
7
- data.tar.gz: f1e16e97e23ff20229f187474872496e1201409a5f606d25f5f62dba039ea2e8c66c20ead82278037861fe8d9a9256113f4064c894cf37015261d9b8635a83ca
6
+ metadata.gz: 8a99f39ae16bba3d3dc5c99fa90c852257631f92eb76b51480355257881543fa2d2b07bed4f650984553d47c13fb68621e9da3be2a4fe68257383a3cb5c9b5e5
7
+ data.tar.gz: 8902090e82f2f6446d94f6764ba3052a863c2dc92cf31106d687ef606843aa37e39b1b1364fe78e37bd66f60fb9760a2f51efe08505e70db823e75047074b31f
@@ -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
- run_command('--version').strip.sub "LibreOffice ", ""
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
@@ -1,3 +1,3 @@
1
1
  class WordToMarkdown
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
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.2
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-03-21 00:00:00.000000000 Z
11
+ date: 2015-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reverse_markdown