ooxml_parser 0.19.0 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 671e659de64bdde6bca41c908243249142b13c1befbc8eb3700bb349cecd763a
4
- data.tar.gz: ddac347c46aaf664a93f7350f06a03926dcb3a1b9aa664e78916b75dec1ee306
3
+ metadata.gz: ed12c90b346ab55a8a41932a3fb957bfbddccf71fdedf15ec6f7b140b1be88eb
4
+ data.tar.gz: 24bff23c9c3f29cfac0e6db68def27199d984366c07b951fe5adb0f88e54468d
5
5
  SHA512:
6
- metadata.gz: 38222b44da13b5cbc3fe2bbd0fb49b2cd8cd2e7ae2482586781a725d481c90144f39c0263d0c183db6094b11eebd065f57e9808a4c5dbe915a1854a436d97d33
7
- data.tar.gz: 1e7e3c540f2e9a441a4e65209c3ee12fe920d2ee2e663af7fb4a52aedb8d68d956fe548384644ed1fa6b0c8c5ad59b739c800ecfc1ff0851a0ae343d661af886
6
+ metadata.gz: '09bad9d23a5157e19fecf0989ac7c812a0b300920c5978f9f6c8ea9241e311dd4e3f3c68f965b52955eba1791c46b46ef22f47728148583e7a0a703d7aaadff0'
7
+ data.tar.gz: c31c20c9a9ca7e4ade83b93653d8d04eed3117a822d9a81d4b9f10f1d7323bb164c281e0f4b75a5c061acb430ee8d08e424a9a8c723c3346dbc74fddd0ed4685
@@ -76,14 +76,29 @@ module OoxmlParser
76
76
  @action = :last_slide
77
77
  when 'ppaction://hlinksldjump'
78
78
  @action = :slide
79
- @url = OOXMLDocumentObject.get_link_from_rels(@id).scan(/\d+/).join.to_i
79
+ parse_url_for_slide_link
80
80
  else
81
- if @id && !@id.empty?
81
+ if meaningful_id?
82
82
  @action = :external_link
83
83
  @url = OOXMLDocumentObject.get_link_from_rels(@id)
84
84
  end
85
85
  end
86
86
  self
87
87
  end
88
+
89
+ private
90
+
91
+ # Check if id parameter has any information in it
92
+ # @return [Boolean] Can id be used
93
+ def meaningful_id?
94
+ @id && !@id.empty?
95
+ end
96
+
97
+ # Parse url for slide link
98
+ def parse_url_for_slide_link
99
+ return unless meaningful_id?
100
+
101
+ @url = OOXMLDocumentObject.get_link_from_rels(@id).scan(/\d+/).join.to_i
102
+ end
88
103
  end
89
104
  end
@@ -4,6 +4,6 @@ module OoxmlParser
4
4
  # This module holds the RuboCop version information.
5
5
  module Version
6
6
  # [String] Version of Gem
7
- STRING = '0.19.0'
7
+ STRING = '0.20.0'
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ooxml_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-11-17 00:00:00.000000000 Z
13
+ date: 2021-11-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri