html2doc 0.8.11 → 0.8.12

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: c5bdb51d900d8bd3b35528088a3cc46711f24ccd0deb83837d79867bc9baa4bc
4
- data.tar.gz: bb85c99530a86d8aef5d751bc48a270a557370592a9dc2fa8b66d2ea43580fb6
3
+ metadata.gz: 191cd1fe8deb855e4bfcd1bf41dcd3344a7bc9d32aa6f0f401d77d74139c14e1
4
+ data.tar.gz: 594f82bd74235cfafdf5842d87ecc45d7e55c0a67678774e0cdde194f54fad73
5
5
  SHA512:
6
- metadata.gz: 352fb5f300298c6ff36016c1dda714238da40d1e53dfe78090eed901d4b017dabfd4fda5a31779491ff77e9869969d8a8aec687863fcd246fd2f5f523374f23c
7
- data.tar.gz: 7d935d336546d8419fb5dfa4d25c4c88ac22e52a9a330a862992767d73771eca40cd92c375d394ab6fb88e186c2775d84db0de1a42e1ba3e33c08e9a51684316
6
+ metadata.gz: b06fe28198bd58d983ab516326f78cdf8e57d25d823143c3581f7eec4bc14fd627871b7b501b45464279c39d8540661f367aeed582835b50eb62f24ea34b7878
7
+ data.tar.gz: 65e03e59e478dd54f5741dc7b1c851e7a495ea62d865469e12ede5292d5e9904c547d5556e6ce020fb1ad8d9f9a4e06bc6579c73c4373189b5a0cba682dda0f1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- html2doc (0.8.10)
4
+ html2doc (0.8.12)
5
5
  asciimath (~> 1.0.7)
6
6
  htmlentities (~> 4.3.4)
7
7
  image_size
@@ -18,7 +18,7 @@ GEM
18
18
  byebug (9.1.0)
19
19
  coderay (1.1.2)
20
20
  diff-lcs (1.3)
21
- docile (1.3.1)
21
+ docile (1.3.2)
22
22
  equivalent-xml (0.6.0)
23
23
  nokogiri (>= 1.4.3)
24
24
  ffi (1.11.1)
@@ -72,17 +72,17 @@ GEM
72
72
  rspec-core (~> 3.8.0)
73
73
  rspec-expectations (~> 3.8.0)
74
74
  rspec-mocks (~> 3.8.0)
75
- rspec-core (3.8.0)
75
+ rspec-core (3.8.2)
76
76
  rspec-support (~> 3.8.0)
77
- rspec-expectations (3.8.3)
77
+ rspec-expectations (3.8.4)
78
78
  diff-lcs (>= 1.2.0, < 2.0)
79
79
  rspec-support (~> 3.8.0)
80
80
  rspec-match_fuzzy (0.1.3)
81
81
  rspec (>= 3.2)
82
- rspec-mocks (3.8.0)
82
+ rspec-mocks (3.8.1)
83
83
  diff-lcs (>= 1.2.0, < 2.0)
84
84
  rspec-support (~> 3.8.0)
85
- rspec-support (3.8.0)
85
+ rspec-support (3.8.2)
86
86
  rubocop (0.54.0)
87
87
  parallel (~> 1.10)
88
88
  parser (>= 2.5)
@@ -14,7 +14,7 @@ module Html2Doc
14
14
  generate_filelist(hash[:filename], hash[:dir1])
15
15
  File.open("#{hash[:filename]}.htm", "w:UTF-8") { |f| f.write(result) }
16
16
  mime_package result, hash[:filename], hash[:dir1]
17
- rm_temp_files(hash[:filename], hash[:dir], hash[:dir1])
17
+ rm_temp_files(hash[:filename], hash[:dir], hash[:dir1]) unless hash[:debug]
18
18
  end
19
19
 
20
20
  def self.process_header(headerfile, hash)
@@ -1,3 +1,3 @@
1
1
  module Html2Doc
2
- VERSION = "0.8.11".freeze
2
+ VERSION = "0.8.12".freeze
3
3
  end
@@ -723,4 +723,15 @@ RSpec.describe Html2Doc do
723
723
  OUTPUT
724
724
  end
725
725
 
726
+ it "test image base64 image encoding" do
727
+ simple_body = '<img src="19160-6.png">'
728
+ Html2Doc.process(html_input(simple_body), filename: "spec/test", debug: true)
729
+ testdoc = File.read("spec/test.doc", encoding: "utf-8")
730
+ base64_image = testdoc[/image\/png\n\n(.*?)\n\n----/m, 1].gsub!("\n", "")
731
+ base64_image_basename = testdoc[%r{Content-Location: file:///C:/Doc/test_files/([0-9a-z\-]+)\.png}m, 1]
732
+ doc_bin_image = Base64.strict_decode64(base64_image)
733
+ file_bin_image = IO.read("spec/test_files/#{base64_image_basename}.png", mode: "rb")
734
+ expect(doc_bin_image).to eq file_bin_image
735
+ FileUtils.rm_rf %w[spec/test_files spec/test.doc spec/test.htm]
736
+ end
726
737
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html2doc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.11
4
+ version: 0.8.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-03 00:00:00.000000000 Z
11
+ date: 2019-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -338,7 +338,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  - !ruby/object:Gem::Version
339
339
  version: '0'
340
340
  requirements: []
341
- rubygems_version: 3.0.3
341
+ rubyforge_project:
342
+ rubygems_version: 2.7.6
342
343
  signing_key:
343
344
  specification_version: 4
344
345
  summary: Convert HTML document to Microsoft Word document