coradoc 1.1.7 → 1.1.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61351918127e3bddfa39198817d989d701b8acd4f12dac620953cbe774f225ad
4
- data.tar.gz: 32f37a1ad17a8cf4ef39cd9d55c8c67fc20a9fd4cfa2bd45e7aa2182f2b4526c
3
+ metadata.gz: aa6087920cf2a472b02e4e44bdf3b984f42e99e39d0290c7621d431629e747f2
4
+ data.tar.gz: 1f51521272e4ab8cb514ae1d0dafc7a68f83ecd95637cb7ed0a8c9fdfab7eba4
5
5
  SHA512:
6
- metadata.gz: b3e881fb0c7dab5fb554d38fa216f5c3c22bff1be1488106b7831c137f2a841d733c234ca1f41b5fbad92940a33b175f19ea43435a4379a978ab96c73908cef9
7
- data.tar.gz: d066670c69d78e1273aeb8b26307a06aa4a847b261dc6eb0175fd69d0443e2e4a2f23b78973a518e749f9f630a9fb14396c5617fd222aba8aa9f8ecd219ec64c
6
+ metadata.gz: 58a6a02fe1f0f6515da56c238a7068d18148cb91e3e172a2c8bdf7cc3af03363ba6ee4931a67f3d07ec9eaf5135a1d9092109a2c801aa37e516924a9b011be8d
7
+ data.tar.gz: 18ca28c32f330ba3a0457f07e3fd92732f7d91895b555791d5648fa7903f50345cbed89b09fdcb5e6c34537dbddb1ed5ca9c0ea2531044738892ffa9b7fa341c
@@ -1,10 +1,30 @@
1
- require "word-to-markdown"
2
1
  require "coradoc/input/html"
3
2
  require "fileutils"
4
3
 
5
4
  module Coradoc
6
5
  module Input
7
6
  module Docx
7
+ WORD_TO_MARKDOWN_MISSING_MSG =
8
+ "DOCX input requires the 'word-to-markdown' gem, " \
9
+ "which is unavailable on this platform. " \
10
+ "See https://github.com/metanorma/coradoc/issues/192".freeze
11
+
12
+ def self.windows_ruby4?
13
+ Gem.win_platform? &&
14
+ Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("4.0")
15
+ end
16
+
17
+ WORD_TO_MARKDOWN_AVAILABLE = if windows_ruby4?
18
+ false
19
+ else
20
+ begin
21
+ require "word-to-markdown"
22
+ true
23
+ rescue LoadError
24
+ false
25
+ end
26
+ end
27
+
8
28
  def self.processor_id
9
29
  :docx
10
30
  end
@@ -13,7 +33,14 @@ module Coradoc
13
33
  %w[.docx .doc].any? { |i| filename.downcase.end_with?(i) }
14
34
  end
15
35
 
36
+ def self.assert_word_to_markdown!
37
+ return if WORD_TO_MARKDOWN_AVAILABLE
38
+
39
+ raise LoadError, WORD_TO_MARKDOWN_MISSING_MSG
40
+ end
41
+
16
42
  def self.processor_execute(input, options = {})
43
+ assert_word_to_markdown!
17
44
  image_dir = Dir.mktmpdir
18
45
  options = options.merge(sourcedir: image_dir)
19
46
  doc = WordToMarkdown.new(input, image_dir)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coradoc
4
- VERSION = "1.1.7"
4
+ VERSION = "1.1.8"
5
5
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coradoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  - Abu Nashir
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2025-03-25 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: base64
@@ -325,7 +324,6 @@ licenses:
325
324
  metadata:
326
325
  homepage_uri: https://www.metanorma.org
327
326
  source_code_uri: https://github.com/metanorma/coradoc
328
- post_install_message:
329
327
  rdoc_options: []
330
328
  require_paths:
331
329
  - lib
@@ -340,8 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
340
338
  - !ruby/object:Gem::Version
341
339
  version: '0'
342
340
  requirements: []
343
- rubygems_version: 3.5.22
344
- signing_key:
341
+ rubygems_version: 3.6.9
345
342
  specification_version: 4
346
343
  summary: AsciiDoc parser for metanorma
347
344
  test_files: []