docx 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docx/document.rb +11 -4
- data/lib/docx/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a33dcd9e31c60144261a15670cd1c01b37877044aaf33f7091b46cc85ab3412
|
4
|
+
data.tar.gz: 1911db027b3e2fbf8eb9363eaa99b95231f875afe8de2a0c060b38fee86c7238
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a823fedf1b0bfc542c88533c787aefa5e9cee12ae4422a01f106985a2f03e8b636aa70820a179f5501ba8f996672f8f75e24356282cd7d81505cbb1984fa967
|
7
|
+
data.tar.gz: c06b4078536bd8b12b5c5e4f61fe0ef5f2f9e03e9cbc7c4017f2d01d3e8a0bc9200fa7457fac54c0b110a57ddc4bff8ad74c28d3e873512900266ac00137c6e6
|
data/lib/docx/document.rb
CHANGED
@@ -87,12 +87,12 @@ module Docx
|
|
87
87
|
def hyperlinks
|
88
88
|
hyperlink_relationships.each_with_object({}) do |rel, hash|
|
89
89
|
hash[rel.attributes['Id'].value] = rel.attributes['Target'].value
|
90
|
-
end
|
90
|
+
end
|
91
91
|
end
|
92
92
|
|
93
93
|
def hyperlink_relationships
|
94
94
|
@rels.xpath("//xmlns:Relationship[contains(@Type,'hyperlink')]")
|
95
|
-
end
|
95
|
+
end
|
96
96
|
|
97
97
|
##
|
98
98
|
# *Deprecated*
|
@@ -168,13 +168,20 @@ module Docx
|
|
168
168
|
def load_styles
|
169
169
|
@styles_xml = @zip.read('word/styles.xml')
|
170
170
|
@styles = Nokogiri::XML(@styles_xml)
|
171
|
-
|
172
|
-
@rels = Nokogiri::XML(@rels_xml)
|
171
|
+
load_rels
|
173
172
|
rescue Errno::ENOENT => e
|
174
173
|
warn e.message
|
175
174
|
nil
|
176
175
|
end
|
177
176
|
|
177
|
+
def load_rels
|
178
|
+
rels_entry = @zip.glob('word/_rels/document*.xml.rels').first
|
179
|
+
raise Errno::ENOENT unless rels_entry
|
180
|
+
|
181
|
+
@rels_xml = rels_entry.get_input_stream.read
|
182
|
+
@rels = Nokogiri::XML(@rels_xml)
|
183
|
+
end
|
184
|
+
|
178
185
|
#--
|
179
186
|
# TODO: Flesh this out to be compatible with other files
|
180
187
|
# TODO: Method to set flag on files that have been edited, probably by inserting something at the
|
data/lib/docx/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Hunt
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2021-
|
15
|
+
date: 2021-07-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: nokogiri
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
rubygems_version: 3.
|
138
|
+
rubygems_version: 3.1.6
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: a ruby library/gem for interacting with .docx files
|