openxml-docx 0.11.0 → 0.11.4
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 +40 -40
- data/lib/openxml/docx/package.rb +4 -4
- data/lib/openxml/docx/properties/tab.rb +1 -1
- data/lib/openxml/docx/version.rb +1 -1
- data/lib/openxml/vml/elements/group.rb +1 -1
- data/lib/openxml/vml/elements/rectangle.rb +1 -1
- data/lib/openxml/vml/elements/rounded_rectangle.rb +1 -1
- data/openxml-docx.gemspec +2 -6
- metadata +10 -17
- 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: c043249c00d51ea622a2bbe412c85e44d19f684f66cea17039864801f0e63a0a
|
|
4
|
+
data.tar.gz: 19130fc1b08df6b6e2a9880f0c8984818ecb2ec0068854d8e5505703727fca5d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b8d63ae7366c58096db5898fb9c38119b60089186140a99d46d98b3c5bc461081add2b2d30ea693f6ab4405b3c79d66a96ed401f485f27c8bdc35af64cd94b4
|
|
7
|
+
data.tar.gz: e3316a118cc6f756c39e36cabe6a2f8de4e57e2e8f49ec1b90f12d3a2e5528b2349a5a8ef74daebb2b18f98ff2fd7a7cba35e10ca7b10c9e74662bf1037516a9
|
|
@@ -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,58 +1,58 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
openxml-docx (0.11.
|
|
4
|
+
openxml-docx (0.11.4)
|
|
5
5
|
nokogiri
|
|
6
6
|
openxml-drawingml
|
|
7
7
|
openxml-package (>= 0.2.2)
|
|
8
|
-
ox (~> 2.
|
|
8
|
+
ox (~> 2.9)
|
|
9
9
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
coderay (1.1.
|
|
13
|
+
coderay (1.1.2)
|
|
14
14
|
diff-lcs (1.3)
|
|
15
|
-
docile (1.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
openxml-drawingml (0.1
|
|
15
|
+
docile (1.4.0)
|
|
16
|
+
method_source (1.0.0)
|
|
17
|
+
mini_portile2 (2.6.1)
|
|
18
|
+
nokogiri (1.12.5)
|
|
19
|
+
mini_portile2 (~> 2.6.1)
|
|
20
|
+
racc (~> 1.4)
|
|
21
|
+
openxml-drawingml (0.2.1)
|
|
22
22
|
nokogiri
|
|
23
|
-
openxml-package (~> 0.2
|
|
24
|
-
openxml-package (0.
|
|
23
|
+
openxml-package (~> 0.3.2)
|
|
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 (~> 0
|
|
32
|
-
|
|
33
|
-
rake (
|
|
34
|
-
rr (1.2.
|
|
35
|
-
rspec (3.
|
|
36
|
-
rspec-core (~> 3.
|
|
37
|
-
rspec-expectations (~> 3.
|
|
38
|
-
rspec-mocks (~> 3.
|
|
39
|
-
rspec-core (3.
|
|
40
|
-
rspec-support (~> 3.
|
|
41
|
-
rspec-expectations (3.
|
|
27
|
+
rubyzip
|
|
28
|
+
ox (2.14.6)
|
|
29
|
+
pry (0.13.1)
|
|
30
|
+
coderay (~> 1.1)
|
|
31
|
+
method_source (~> 1.0)
|
|
32
|
+
racc (1.6.0)
|
|
33
|
+
rake (13.0.1)
|
|
34
|
+
rr (1.2.1)
|
|
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)
|
|
42
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
43
|
-
rspec-support (~> 3.
|
|
44
|
-
rspec-mocks (3.
|
|
43
|
+
rspec-support (~> 3.9.0)
|
|
44
|
+
rspec-mocks (3.9.1)
|
|
45
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
46
|
-
rspec-support (~> 3.
|
|
47
|
-
rspec-support (3.
|
|
48
|
-
rubyzip (
|
|
49
|
-
simplecov (0.
|
|
50
|
-
docile (~> 1.1
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
simplecov-html (0.
|
|
54
|
-
|
|
55
|
-
timecop (0.
|
|
46
|
+
rspec-support (~> 3.9.0)
|
|
47
|
+
rspec-support (3.9.3)
|
|
48
|
+
rubyzip (2.3.2)
|
|
49
|
+
simplecov (0.21.2)
|
|
50
|
+
docile (~> 1.1)
|
|
51
|
+
simplecov-html (~> 0.11)
|
|
52
|
+
simplecov_json_formatter (~> 0.1)
|
|
53
|
+
simplecov-html (0.12.3)
|
|
54
|
+
simplecov_json_formatter (0.1.3)
|
|
55
|
+
timecop (0.9.1)
|
|
56
56
|
|
|
57
57
|
PLATFORMS
|
|
58
58
|
ruby
|
|
@@ -67,4 +67,4 @@ DEPENDENCIES
|
|
|
67
67
|
timecop
|
|
68
68
|
|
|
69
69
|
BUNDLED WITH
|
|
70
|
-
1.
|
|
70
|
+
2.1.4
|
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
|
|
@@ -4,7 +4,7 @@ module OpenXml
|
|
|
4
4
|
class Tab < BaseProperty
|
|
5
5
|
attr_reader :position, :type, :leader
|
|
6
6
|
|
|
7
|
-
VALID_TYPES = %i(bar center clear decimal end num start)
|
|
7
|
+
VALID_TYPES = %i(bar center clear decimal end num start left right)
|
|
8
8
|
VALID_LEADERS = [nil, :dot, :heavy, :hyphen, :middleDot, :none, :underscore]
|
|
9
9
|
|
|
10
10
|
def initialize(position, type, leader=nil)
|
data/lib/openxml/docx/version.rb
CHANGED
|
@@ -61,7 +61,7 @@ module OpenXml
|
|
|
61
61
|
|
|
62
62
|
def valid_diagram_layout(value)
|
|
63
63
|
message = "Invalid diagram layout. Must be a single digit between 0 and 3 inclusive"
|
|
64
|
-
raise ArgumentError, message unless (value.is_a?(
|
|
64
|
+
raise ArgumentError, message unless (value.is_a?(Integer) && (0..3).include?(value)) || value =~ /^[0-3]$/
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
end
|
|
@@ -76,7 +76,7 @@ module OpenXml
|
|
|
76
76
|
|
|
77
77
|
def valid_diagram_layout(value)
|
|
78
78
|
message = "Invalid diagram layout. Must be a single digit between 0 and 3 inclusive"
|
|
79
|
-
raise ArgumentError, message unless (value.is_a?(
|
|
79
|
+
raise ArgumentError, message unless (value.is_a?(Integer) && (0..3).include?(value)) || value =~ /^[0-3]$/
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
82
|
end
|
|
@@ -82,7 +82,7 @@ module OpenXml
|
|
|
82
82
|
|
|
83
83
|
def valid_diagram_layout(value)
|
|
84
84
|
message = "Invalid diagram layout. Must be a single digit between 0 and 3 inclusive"
|
|
85
|
-
raise ArgumentError, message unless (value.is_a?(
|
|
85
|
+
raise ArgumentError, message unless (value.is_a?(Integer) && (0..3).include?(value)) || value =~ /^[0-3]$/
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
end
|
data/openxml-docx.gemspec
CHANGED
|
@@ -19,16 +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
|
-
|
|
28
|
-
# Ox 2.4.10 changed how special characters are encoded,
|
|
29
|
-
# but a few of openxml-docx's tests rely on the previous
|
|
30
|
-
# behavior. Remove this line after refactoring those tests.
|
|
31
|
-
spec.add_dependency "ox", "~> 2.4.3", "< 2.4.10"
|
|
27
|
+
spec.add_dependency "ox", "~> 2.9"
|
|
32
28
|
|
|
33
29
|
spec.add_development_dependency "pry"
|
|
34
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.4
|
|
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: 2021-11-04 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: nokogiri
|
|
@@ -59,20 +59,14 @@ dependencies:
|
|
|
59
59
|
requirements:
|
|
60
60
|
- - "~>"
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: 2.
|
|
63
|
-
- - "<"
|
|
64
|
-
- !ruby/object:Gem::Version
|
|
65
|
-
version: 2.4.10
|
|
62
|
+
version: '2.9'
|
|
66
63
|
type: :runtime
|
|
67
64
|
prerelease: false
|
|
68
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
69
66
|
requirements:
|
|
70
67
|
- - "~>"
|
|
71
68
|
- !ruby/object:Gem::Version
|
|
72
|
-
version: 2.
|
|
73
|
-
- - "<"
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: 2.4.10
|
|
69
|
+
version: '2.9'
|
|
76
70
|
- !ruby/object:Gem::Dependency
|
|
77
71
|
name: pry
|
|
78
72
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -165,8 +159,8 @@ executables: []
|
|
|
165
159
|
extensions: []
|
|
166
160
|
extra_rdoc_files: []
|
|
167
161
|
files:
|
|
162
|
+
- ".github/workflows/ci.yml"
|
|
168
163
|
- ".gitignore"
|
|
169
|
-
- ".travis.yml"
|
|
170
164
|
- Gemfile
|
|
171
165
|
- Gemfile.lock
|
|
172
166
|
- LICENSE.txt
|
|
@@ -468,13 +462,13 @@ homepage: https://github.com/openxml/openxml-docx
|
|
|
468
462
|
licenses:
|
|
469
463
|
- MIT
|
|
470
464
|
metadata: {}
|
|
471
|
-
post_install_message:
|
|
465
|
+
post_install_message:
|
|
472
466
|
rdoc_options: []
|
|
473
467
|
require_paths:
|
|
474
468
|
- lib
|
|
475
469
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
476
470
|
requirements:
|
|
477
|
-
- - "
|
|
471
|
+
- - ">="
|
|
478
472
|
- !ruby/object:Gem::Version
|
|
479
473
|
version: '2.0'
|
|
480
474
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
@@ -483,9 +477,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
483
477
|
- !ruby/object:Gem::Version
|
|
484
478
|
version: '0'
|
|
485
479
|
requirements: []
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
signing_key:
|
|
480
|
+
rubygems_version: 3.2.22
|
|
481
|
+
signing_key:
|
|
489
482
|
specification_version: 4
|
|
490
483
|
summary: Implements the Office Open XML spec for creating WordprocessingML documents
|
|
491
484
|
test_files: []
|