openxml-docx 0.11.2 → 0.11.5
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 +5 -5
- data/.github/workflows/ci.yml +21 -0
- data/Gemfile.lock +35 -33
- data/lib/openxml/docx/elements/hyperlink.rb +9 -0
- data/lib/openxml/docx/package.rb +4 -4
- data/lib/openxml/docx/version.rb +1 -1
- data/openxml-docx.gemspec +2 -2
- metadata +11 -11
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 4e9809b8a2afe820d3f996102d1258845c5a21f8ef890d85ef3116f9ec9d8a5c
|
|
4
|
+
data.tar.gz: ef20387b67a94103150fed40870d5921412122010e8ff52f8ca8f471a18b8c6f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a8d8a2c66a27f6bf5a1a45974d402a22ae0cbda70cf30875c9d0259a2d6eda9b325b9aff94651414b7bfbb6115d99bcab8d8043371d8de7f09050e0701246533
|
|
7
|
+
data.tar.gz: 4a9ef69f943d71e0917be8e88a63f0c6e9309eb2a04c9fb3d468ba0c9d5cd6690dfc8f3fd4ae784fa04fde5a150075220fab906cedb33ee265f3dbbbce0d3816
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
on: [push]
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
ruby:
|
|
6
|
+
name: Ruby Tests
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
ruby-version: [ "2.6", "2.7", "3.0" ]
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v2
|
|
15
|
+
- name: Setup Ruby
|
|
16
|
+
uses: ruby/setup-ruby@v1
|
|
17
|
+
with:
|
|
18
|
+
bundler-cache: true
|
|
19
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
20
|
+
- name: Run Tests
|
|
21
|
+
run: bundle exec rake spec
|
data/Gemfile.lock
CHANGED
|
@@ -1,55 +1,57 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
openxml-docx (0.11.
|
|
4
|
+
openxml-docx (0.11.5)
|
|
5
5
|
nokogiri
|
|
6
6
|
openxml-drawingml
|
|
7
7
|
openxml-package (>= 0.2.2)
|
|
8
|
-
ox (~> 2.9
|
|
8
|
+
ox (~> 2.9)
|
|
9
9
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
13
|
coderay (1.1.2)
|
|
14
14
|
diff-lcs (1.3)
|
|
15
|
-
docile (1.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
openxml-drawingml (0.
|
|
15
|
+
docile (1.4.0)
|
|
16
|
+
method_source (1.0.0)
|
|
17
|
+
mini_portile2 (2.8.0)
|
|
18
|
+
nokogiri (1.13.8)
|
|
19
|
+
mini_portile2 (~> 2.8.0)
|
|
20
|
+
racc (~> 1.4)
|
|
21
|
+
openxml-drawingml (0.3.0)
|
|
22
22
|
nokogiri
|
|
23
23
|
openxml-package (~> 0.3.2)
|
|
24
|
-
openxml-package (0.3.
|
|
24
|
+
openxml-package (0.3.4)
|
|
25
25
|
nokogiri
|
|
26
26
|
ox
|
|
27
|
-
rubyzip
|
|
28
|
-
ox (2.
|
|
29
|
-
pry (0.
|
|
30
|
-
coderay (~> 1.1
|
|
31
|
-
method_source (~>
|
|
32
|
-
|
|
27
|
+
rubyzip
|
|
28
|
+
ox (2.14.11)
|
|
29
|
+
pry (0.13.1)
|
|
30
|
+
coderay (~> 1.1)
|
|
31
|
+
method_source (~> 1.0)
|
|
32
|
+
racc (1.6.0)
|
|
33
|
+
rake (13.0.1)
|
|
33
34
|
rr (1.2.1)
|
|
34
|
-
rspec (3.
|
|
35
|
-
rspec-core (~> 3.
|
|
36
|
-
rspec-expectations (~> 3.
|
|
37
|
-
rspec-mocks (~> 3.
|
|
38
|
-
rspec-core (3.
|
|
39
|
-
rspec-support (~> 3.
|
|
40
|
-
rspec-expectations (3.
|
|
35
|
+
rspec (3.9.0)
|
|
36
|
+
rspec-core (~> 3.9.0)
|
|
37
|
+
rspec-expectations (~> 3.9.0)
|
|
38
|
+
rspec-mocks (~> 3.9.0)
|
|
39
|
+
rspec-core (3.9.2)
|
|
40
|
+
rspec-support (~> 3.9.3)
|
|
41
|
+
rspec-expectations (3.9.2)
|
|
41
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
42
|
-
rspec-support (~> 3.
|
|
43
|
-
rspec-mocks (3.
|
|
43
|
+
rspec-support (~> 3.9.0)
|
|
44
|
+
rspec-mocks (3.9.1)
|
|
44
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
45
|
-
rspec-support (~> 3.
|
|
46
|
-
rspec-support (3.
|
|
47
|
-
rubyzip (
|
|
48
|
-
simplecov (0.
|
|
46
|
+
rspec-support (~> 3.9.0)
|
|
47
|
+
rspec-support (3.9.3)
|
|
48
|
+
rubyzip (2.3.2)
|
|
49
|
+
simplecov (0.21.2)
|
|
49
50
|
docile (~> 1.1)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
simplecov-html (0.
|
|
51
|
+
simplecov-html (~> 0.11)
|
|
52
|
+
simplecov_json_formatter (~> 0.1)
|
|
53
|
+
simplecov-html (0.12.3)
|
|
54
|
+
simplecov_json_formatter (0.1.3)
|
|
53
55
|
timecop (0.9.1)
|
|
54
56
|
|
|
55
57
|
PLATFORMS
|
|
@@ -65,4 +67,4 @@ DEPENDENCIES
|
|
|
65
67
|
timecop
|
|
66
68
|
|
|
67
69
|
BUNDLED WITH
|
|
68
|
-
|
|
70
|
+
2.2.22
|
data/lib/openxml/docx/package.rb
CHANGED
|
@@ -55,7 +55,7 @@ module OpenXml
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def embed_truetype_font(path: nil, name: nil)
|
|
58
|
-
open(path, "rb") do |source_font|
|
|
58
|
+
URI.open(path, "rb") do |source_font|
|
|
59
59
|
obfuscation_data = obfuscate_font source_font
|
|
60
60
|
data = obfuscation_data[:bytes] << source_font.read
|
|
61
61
|
destination_font_name = "font#{fonts.fonts.count + 1}.odttf"
|
|
@@ -79,7 +79,7 @@ module OpenXml
|
|
|
79
79
|
content_type ||= extension_match[:extension] if extension_match
|
|
80
80
|
return if content_type.nil?
|
|
81
81
|
|
|
82
|
-
open(path, "rb") do |source_image|
|
|
82
|
+
URI.open(path, "rb") do |source_image|
|
|
83
83
|
embed_image_data(data: source_image.read, content_type: content_type, into_part: into_part)
|
|
84
84
|
end
|
|
85
85
|
end
|
|
@@ -102,7 +102,7 @@ module OpenXml
|
|
|
102
102
|
def add_header(header)
|
|
103
103
|
headers << header
|
|
104
104
|
header_name = "header#{headers.count}.xml"
|
|
105
|
-
|
|
105
|
+
content_types.add_override "/word/#{header_name}", TYPE_HEADER
|
|
106
106
|
add_part "word/#{header_name}", header
|
|
107
107
|
add_part "word/_rels/#{header_name}.rels", header.relationships
|
|
108
108
|
relationship = document.relationships.add_relationship REL_HEADER, header_name
|
|
@@ -112,7 +112,7 @@ module OpenXml
|
|
|
112
112
|
def add_footer(footer)
|
|
113
113
|
footers << footer
|
|
114
114
|
footer_name = "footer#{footers.count}.xml"
|
|
115
|
-
|
|
115
|
+
content_types.add_override "/word/#{footer_name}", TYPE_FOOTER
|
|
116
116
|
add_part "word/#{footer_name}", footer
|
|
117
117
|
add_part "word/_rels/#{footer_name}.rels", footer.relationships
|
|
118
118
|
relationship = document.relationships.add_relationship REL_FOOTER, footer_name
|
data/lib/openxml/docx/version.rb
CHANGED
data/openxml-docx.gemspec
CHANGED
|
@@ -19,12 +19,12 @@ Gem::Specification.new do |spec|
|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
20
20
|
spec.require_paths = ["lib"]
|
|
21
21
|
|
|
22
|
-
spec.required_ruby_version = "
|
|
22
|
+
spec.required_ruby_version = ">= 2.0"
|
|
23
23
|
|
|
24
24
|
spec.add_dependency "nokogiri"
|
|
25
25
|
spec.add_dependency "openxml-package", ">= 0.2.2"
|
|
26
26
|
spec.add_dependency "openxml-drawingml"
|
|
27
|
-
spec.add_dependency "ox", "~> 2.9
|
|
27
|
+
spec.add_dependency "ox", "~> 2.9"
|
|
28
28
|
|
|
29
29
|
spec.add_development_dependency "pry"
|
|
30
30
|
spec.add_development_dependency "rspec"
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openxml-docx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.11.
|
|
4
|
+
version: 0.11.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gene Doyel
|
|
8
8
|
- Bob Lail
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2022-09-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: nokogiri
|
|
@@ -59,14 +59,14 @@ dependencies:
|
|
|
59
59
|
requirements:
|
|
60
60
|
- - "~>"
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: 2.9
|
|
62
|
+
version: '2.9'
|
|
63
63
|
type: :runtime
|
|
64
64
|
prerelease: false
|
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
|
67
67
|
- - "~>"
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: 2.9
|
|
69
|
+
version: '2.9'
|
|
70
70
|
- !ruby/object:Gem::Dependency
|
|
71
71
|
name: pry
|
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -159,8 +159,8 @@ executables: []
|
|
|
159
159
|
extensions: []
|
|
160
160
|
extra_rdoc_files: []
|
|
161
161
|
files:
|
|
162
|
+
- ".github/workflows/ci.yml"
|
|
162
163
|
- ".gitignore"
|
|
163
|
-
- ".travis.yml"
|
|
164
164
|
- Gemfile
|
|
165
165
|
- Gemfile.lock
|
|
166
166
|
- LICENSE.txt
|
|
@@ -212,6 +212,7 @@ files:
|
|
|
212
212
|
- lib/openxml/docx/elements/font_sig.rb
|
|
213
213
|
- lib/openxml/docx/elements/grid_column.rb
|
|
214
214
|
- lib/openxml/docx/elements/group_shape.rb
|
|
215
|
+
- lib/openxml/docx/elements/hyperlink.rb
|
|
215
216
|
- lib/openxml/docx/elements/last_rendered_page_break.rb
|
|
216
217
|
- lib/openxml/docx/elements/level.rb
|
|
217
218
|
- lib/openxml/docx/elements/level_override.rb
|
|
@@ -462,13 +463,13 @@ homepage: https://github.com/openxml/openxml-docx
|
|
|
462
463
|
licenses:
|
|
463
464
|
- MIT
|
|
464
465
|
metadata: {}
|
|
465
|
-
post_install_message:
|
|
466
|
+
post_install_message:
|
|
466
467
|
rdoc_options: []
|
|
467
468
|
require_paths:
|
|
468
469
|
- lib
|
|
469
470
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
470
471
|
requirements:
|
|
471
|
-
- - "
|
|
472
|
+
- - ">="
|
|
472
473
|
- !ruby/object:Gem::Version
|
|
473
474
|
version: '2.0'
|
|
474
475
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
@@ -477,9 +478,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
477
478
|
- !ruby/object:Gem::Version
|
|
478
479
|
version: '0'
|
|
479
480
|
requirements: []
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
signing_key:
|
|
481
|
+
rubygems_version: 3.2.22
|
|
482
|
+
signing_key:
|
|
483
483
|
specification_version: 4
|
|
484
484
|
summary: Implements the Office Open XML spec for creating WordprocessingML documents
|
|
485
485
|
test_files: []
|