html2doc 0.8.10 → 0.8.11

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: d6f39dba753a7c5dd51015dae21f9ea71e236786c11bb0dd36b91e9865e0c312
4
- data.tar.gz: 5cdaae58206a346c6d160fe881d1a9f8a2bb28f4c6e71d81570d5f4b90ab607b
3
+ metadata.gz: c5bdb51d900d8bd3b35528088a3cc46711f24ccd0deb83837d79867bc9baa4bc
4
+ data.tar.gz: bb85c99530a86d8aef5d751bc48a270a557370592a9dc2fa8b66d2ea43580fb6
5
5
  SHA512:
6
- metadata.gz: cc6685a80b9b18c21eaf3720e15dd31ce7e9395e4649238ea8b54c34949c95c9b204b6205bd8e33fae2439f847330442b37b2108401ddb35f18281f57cbb184d
7
- data.tar.gz: 8c992042353b57b39b906a73a4a5af33965033a25b6e198a2eb96835683d0bc36791641006cd0119e8375ba36fde95a07261438fb2a01f0b1bff758f45045a51
6
+ metadata.gz: 352fb5f300298c6ff36016c1dda714238da40d1e53dfe78090eed901d4b017dabfd4fda5a31779491ff77e9869969d8a8aec687863fcd246fd2f5f523374f23c
7
+ data.tar.gz: 7d935d336546d8419fb5dfa4d25c4c88ac22e52a9a330a862992767d73771eca40cd92c375d394ab6fb88e186c2775d84db0de1a42e1ba3e33c08e9a51684316
@@ -1,3 +1,5 @@
1
+ # Auto-generated !!! Do not edit it manually
2
+ # use ci-master https://github.com/metanorma/metanorma-build-scripts
1
3
  language: ruby
2
4
  cache: bundler
3
5
  os:
@@ -6,11 +8,10 @@ os:
6
8
  rvm:
7
9
  - 2.5
8
10
  - 2.4
9
- - 2.3
10
11
  - ruby-head
11
- before_install:
12
+ before_install:
12
13
  - gem install bundler -v 2.0.1
13
14
  - bundle update
14
15
  matrix:
15
16
  allow_failures:
16
- - rvm: ruby-head
17
+ - rvm: ruby-head
@@ -21,7 +21,7 @@ GEM
21
21
  docile (1.3.1)
22
22
  equivalent-xml (0.6.0)
23
23
  nokogiri (>= 1.4.3)
24
- ffi (1.10.0)
24
+ ffi (1.11.1)
25
25
  formatador (0.2.5)
26
26
  guard (2.15.0)
27
27
  formatador (>= 0.2.4)
@@ -38,7 +38,7 @@ GEM
38
38
  guard-compat (~> 1.1)
39
39
  rspec (>= 2.99.0, < 4.0)
40
40
  htmlentities (4.3.4)
41
- image_size (2.0.0)
41
+ image_size (2.0.1)
42
42
  json (2.2.0)
43
43
  listen (3.1.5)
44
44
  rb-fsevent (~> 0.9, >= 0.9.4)
@@ -51,13 +51,13 @@ GEM
51
51
  mime-types-data (3.2019.0331)
52
52
  mini_portile2 (2.4.0)
53
53
  nenv (0.3.0)
54
- nokogiri (1.10.2)
54
+ nokogiri (1.10.3)
55
55
  mini_portile2 (~> 2.4.0)
56
56
  notiffany (0.1.1)
57
57
  nenv (~> 0.1)
58
58
  shellany (~> 0.0)
59
59
  parallel (1.17.0)
60
- parser (2.6.2.1)
60
+ parser (2.6.3.0)
61
61
  ast (~> 2.4.0)
62
62
  powerpack (0.1.2)
63
63
  pry (0.12.2)
@@ -74,7 +74,7 @@ GEM
74
74
  rspec-mocks (~> 3.8.0)
75
75
  rspec-core (3.8.0)
76
76
  rspec-support (~> 3.8.0)
77
- rspec-expectations (3.8.2)
77
+ rspec-expectations (3.8.3)
78
78
  diff-lcs (>= 1.2.0, < 2.0)
79
79
  rspec-support (~> 3.8.0)
80
80
  rspec-match_fuzzy (0.1.3)
@@ -90,7 +90,7 @@ GEM
90
90
  rainbow (>= 2.2.2, < 4.0)
91
91
  ruby-progressbar (~> 1.7)
92
92
  unicode-display_width (~> 1.0, >= 1.0.1)
93
- ruby-progressbar (1.10.0)
93
+ ruby-progressbar (1.10.1)
94
94
  ruby_dep (1.5.0)
95
95
  shellany (0.0.1)
96
96
  simplecov (0.16.1)
@@ -101,7 +101,7 @@ GEM
101
101
  thor (0.20.3)
102
102
  thread_safe (0.3.6)
103
103
  timecop (0.9.1)
104
- unicode-display_width (1.5.0)
104
+ unicode-display_width (1.6.0)
105
105
  uuidtools (2.1.5)
106
106
 
107
107
  PLATFORMS
@@ -1,10 +1,14 @@
1
+ # Auto-generated !!! Do not edit it manually
2
+ # use ci-master https://github.com/metanorma/metanorma-build-scripts
1
3
  version: '{build}'
2
4
 
5
+ cache:
6
+ - vendor/bundle
7
+
3
8
  environment:
4
9
  matrix:
5
10
  - RUBY_VERSION: 25
6
11
  - RUBY_VERSION: 24
7
- - RUBY_VERSION: 23
8
12
  - RUBY_VERSION: _trunk
9
13
 
10
14
  matrix:
@@ -17,6 +21,8 @@ install:
17
21
 
18
22
  build_script:
19
23
  - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
24
+ - set GIT_TERMINAL_PROMPT=0
25
+ - bundle config --local path vendor/bundle
20
26
  - bundle update
21
27
  - bundle install
22
28
 
@@ -27,4 +33,3 @@ before_test:
27
33
 
28
34
  test_script:
29
35
  - bundle exec rake
30
-
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
  spec.files = `git ls-files`.split("\n")
25
25
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
26
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
26
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
27
27
 
28
28
  spec.add_dependency "htmlentities", "~> 4.3.4"
29
29
  spec.add_dependency "image_size"
@@ -20,14 +20,18 @@ module Html2Doc
20
20
  end
21
21
 
22
22
  def self.mime_attachment(boundary, filename, item, dir)
23
- encoded_file = Base64.strict_encode64(
24
- File.read("#{dir}/#{item}", encoding: "utf-8"),
25
- ).gsub(/(.{76})/, "\\1\n")
23
+ content_type = mime_type(item)
24
+ text_mode = %w[text application].any? { |p| content_type.start_with? p }
25
+
26
+ path = File.join(dir, item)
27
+ content = text_mode ? File.read(path, encoding: "utf-8") : IO.binread(path)
28
+
29
+ encoded_file = Base64.strict_encode64(content).gsub(/(.{76})/, "\\1\n")
26
30
  <<~"FILE"
27
31
  --#{boundary}
28
32
  Content-Location: file:///C:/Doc/#{File.basename(filename)}_files/#{item}
29
33
  Content-Transfer-Encoding: base64
30
- Content-Type: #{mime_type(item)}
34
+ Content-Type: #{content_type}
31
35
 
32
36
  #{encoded_file}
33
37
 
@@ -1,3 +1,3 @@
1
1
  module Html2Doc
2
- VERSION = "0.8.10".freeze
2
+ VERSION = "0.8.11".freeze
3
3
  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.10
4
+ version: 0.8.11
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-04-14 00:00:00.000000000 Z
11
+ date: 2019-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -331,15 +331,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
331
331
  requirements:
332
332
  - - ">="
333
333
  - !ruby/object:Gem::Version
334
- version: 2.3.0
334
+ version: 2.4.0
335
335
  required_rubygems_version: !ruby/object:Gem::Requirement
336
336
  requirements:
337
337
  - - ">="
338
338
  - !ruby/object:Gem::Version
339
339
  version: '0'
340
340
  requirements: []
341
- rubyforge_project:
342
- rubygems_version: 2.7.6
341
+ rubygems_version: 3.0.3
343
342
  signing_key:
344
343
  specification_version: 4
345
344
  summary: Convert HTML document to Microsoft Word document