word-to-markdown 1.1.3 → 1.1.4

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: b10e59ed47c691019e5e3fab11c739a10bb2d527
4
- data.tar.gz: 2570568e6cb60e1a4edece91170958f97972a21a
3
+ metadata.gz: 2ebb72caa54bd03cd393646e9458f228a47d4bb6
4
+ data.tar.gz: 9a11db1413481a4abd7a04f38b4fe9b31f765f7e
5
5
  SHA512:
6
- metadata.gz: 8a99f39ae16bba3d3dc5c99fa90c852257631f92eb76b51480355257881543fa2d2b07bed4f650984553d47c13fb68621e9da3be2a4fe68257383a3cb5c9b5e5
7
- data.tar.gz: 8902090e82f2f6446d94f6764ba3052a863c2dc92cf31106d687ef606843aa37e39b1b1364fe78e37bd66f60fb9760a2f51efe08505e70db823e75047074b31f
6
+ metadata.gz: 330dc12f0a9b438bc5485f702594690131a0a0e6306a12e75996017d4dddbbf5591d8d35ea2450fbf54b9e4bf67420d18940901025d1c730dc58d3e8563e46ce
7
+ data.tar.gz: 929e165957b4dbdce0becfb614539df57b0b7748ee204ee258bda450e68c4f0d55a112e09f308415f100d0d335275ab7a8ba8932865b49ce8ac81eb1eb626bc0
@@ -1,11 +1,13 @@
1
- require 'reverse_markdown'
2
1
  require 'descriptive_statistics'
2
+ require 'reverse_markdown'
3
+ require 'nokogiri-styles'
4
+ require 'sys/proctable'
3
5
  require 'premailer'
6
+ require 'rbconfig'
4
7
  require 'nokogiri'
5
- require 'nokogiri-styles'
6
8
  require 'tmpdir'
7
- require 'rbconfig'
8
9
  require 'open3'
10
+
9
11
  require_relative 'word-to-markdown/version'
10
12
  require_relative 'word-to-markdown/document'
11
13
  require_relative 'word-to-markdown/converter'
@@ -13,6 +15,8 @@ require_relative 'nokogiri/xml/element'
13
15
 
14
16
  class WordToMarkdown
15
17
 
18
+ include Sys
19
+
16
20
  attr_reader :document, :converter
17
21
 
18
22
  REVERSE_MARKDOWN_OPTIONS = {
@@ -67,8 +71,14 @@ class WordToMarkdown
67
71
  @soffice ||= !(soffice_path.nil? || soffice_version.nil?)
68
72
  end
69
73
 
74
+ def self.soffice_open?
75
+ ProcTable.ps.any? { |p| p.exe == soffice_path }
76
+ end
77
+
70
78
  def self.run_command(*args)
71
79
  raise "LibreOffice executable not found" unless soffice?
80
+ raise "LibreOffice already running" if soffice_open?
81
+
72
82
  output, status = Open3.capture2e(soffice_path, *args)
73
83
  raise "Command `#{soffice_path} #{args.join(" ")}` failed: #{output}" if status != 0
74
84
  output
@@ -1,3 +1,3 @@
1
1
  class WordToMarkdown
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
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.3
4
+ version: 1.1.4
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-06-13 00:00:00.000000000 Z
11
+ date: 2015-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reverse_markdown
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: sys-proctable
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.9'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.9'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement