ooxml_parser 0.9.1 → 0.10.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: d0461247fd721db5b3c6bf0693093bdb035c822a4ad806d2d2352dd37b134697
4
- data.tar.gz: '09654ec146d467d1a42e1d81addd5a7e5c526af05a0c04fa82981c0e908f0992'
3
+ metadata.gz: 728a4727e30c90aebf48cd417a9865dbf3726719e08bd20403b558377311105d
4
+ data.tar.gz: b73f86cce58d63354209f84fbe9d496301acb3d3b5ae7973639912d87b85b599
5
5
  SHA512:
6
- metadata.gz: 928f147291796cc71784f68229362dc5e2e9e552cfdb9e37fc6925369e8064b5e0a6abd421af5fa6c70a523cf08f1f41079011c43fdc672df40f99cb6ce9424c
7
- data.tar.gz: f04144a255bfe3529c59f319888c79056bd2854419469386fc8f2be3e1fb3c069c7d9c90cdedaa5348793ff82927c0ef47e63e9fd9b707fae835386e5b5613ed
6
+ metadata.gz: d985dddf15a50d7ec8796805009057f7149a3958a24e735279a9fcdc622156c1837662a56947a841d68958ac5eedb9afae7947eba48cf8929941def9e34c1832
7
+ data.tar.gz: '08ded5794f5a0745ee001b0a993d82c5790eb058d49436149ea13f65ebcd650da8e64cbbc9f8949a705a985d20b3e5d34f83552f264b441abd6a128923809013'
@@ -94,9 +94,9 @@ module OoxmlParser
94
94
  # @return [True, False] result of comparision
95
95
  def ==(other)
96
96
  if other.is_a?(Color)
97
- if (@red == other.red) && (@green == other.green) && (@blue == other.blue)
98
- true
99
- elsif (none? && other.white?) || (white? && other.none?)
97
+ if ((@red == other.red) && (@green == other.green) && (@blue == other.blue)) ||
98
+ (none? && other.white?) ||
99
+ (white? && other.none?)
100
100
  true
101
101
  else
102
102
  false
@@ -268,7 +268,7 @@ module OoxmlParser
268
268
  return Color.new(VALUE_FOR_NONE_COLOR, VALUE_FOR_NONE_COLOR, VALUE_FOR_NONE_COLOR) if str == 'none' || str == '' || str == 'transparent' || str.nil?
269
269
 
270
270
  split = if str.include?('RGB (') || str.include?('rgb(')
271
- str.gsub(/[(RGBrgb() )]/, '').split(',')
271
+ str.gsub(/[(RGBrgb) ]/, '').split(',')
272
272
  elsif str.include?('RGB ') || str.include?('rgb')
273
273
  str.gsub(/RGB |rgb/, '').split(', ')
274
274
  else
@@ -74,9 +74,7 @@ module OoxmlParser
74
74
  @numbering.start_at = node_child.attribute('startAt').value if node_child.attribute('startAt')
75
75
  when 'framePr'
76
76
  @frame_properties = FrameProperties.new(parent: self).parse(node_child)
77
- when 'tabs'
78
- @tabs = Tabs.new(parent: self).parse(node_child)
79
- when 'tabLst'
77
+ when 'tabs', 'tabLst'
80
78
  @tabs = Tabs.new(parent: self).parse(node_child)
81
79
  when 'ind'
82
80
  @indent = Indents.new(parent: self).parse(node_child)
@@ -180,7 +180,7 @@ module OoxmlParser
180
180
  case element.name
181
181
  when 'p'
182
182
  child = element.child
183
- unless child.nil? && doc_structure.elements.last.class == Table
183
+ unless child.nil? && doc_structure.elements.last.instance_of?(Table)
184
184
  paragraph_style = DocumentStructure.default_paragraph_style.dup.parse(element, number, DocumentStructure.default_run_style, parent: doc_structure)
185
185
  number += 1
186
186
  doc_structure.elements << paragraph_style.dup
@@ -41,7 +41,7 @@ module OoxmlParser
41
41
  @number = 0
42
42
  @bookmark_start = []
43
43
  @bookmark_end = []
44
- @align = 'left'
44
+ @align = :left
45
45
  @spacing = Spacing.new
46
46
  @ind = Indents.new
47
47
  @character_style_array = []
@@ -177,7 +177,7 @@ module OoxmlParser
177
177
  end
178
178
  end
179
179
  @number = par_number
180
- character_styles_array.last.text = character_styles_array.last.text.rstrip if character_styles_array.last.class == DocxParagraphRun
180
+ character_styles_array.last.text = character_styles_array.last.text.rstrip if character_styles_array.last.instance_of?(DocxParagraphRun)
181
181
  @character_style_array = character_styles_array
182
182
  @parent = parent
183
183
  self
@@ -20,9 +20,7 @@ module OoxmlParser
20
20
  case object
21
21
  when :image
22
22
  elements.find { |e| e.is_a? DocxPicture }.properties.transform
23
- when :chart
24
- elements.find { |e| e.is_a? GraphicFrame }.transform
25
- when :table
23
+ when :chart, :table
26
24
  elements.find { |e| e.is_a? GraphicFrame }.transform
27
25
  when :shape
28
26
  elements.find { |e| !e.shape_properties.preset.nil? }.shape_properties.transform
@@ -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.9.1'
7
+ STRING = '0.10.0'
8
8
  end
9
9
  end
@@ -43,9 +43,10 @@ module OoxmlParser
43
43
  return row.cells[column.to_i - 1]
44
44
  elsif sheet.is_a?(String)
45
45
  @worksheets.each do |worksheet|
46
- if worksheet.name == sheet
47
- return worksheet.rows[row.to_i - 1].cells[column.to_i - 1] unless worksheet.rows[row.to_i - 1].nil?
48
- end
46
+ next unless worksheet.name == sheet
47
+ next unless worksheet.rows[row.to_i - 1]
48
+
49
+ return worksheet.rows[row.to_i - 1].cells[column.to_i - 1]
49
50
  end
50
51
  return nil
51
52
  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.9.1
4
+ version: 0.10.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: 2020-08-21 00:00:00.000000000 Z
13
+ date: 2020-11-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: nokogiri
@@ -18,118 +18,182 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.6'
21
+ version: '1'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.6'
28
+ version: '1'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: ruby-filemagic
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '0.1'
35
+ version: '0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.1'
42
+ version: '0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rubyzip
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '1.1'
50
- - - "<"
47
+ - - "~>"
51
48
  - !ruby/object:Gem::Version
52
- version: '3.0'
49
+ version: '2'
53
50
  type: :runtime
54
51
  prerelease: false
55
52
  version_requirements: !ruby/object:Gem::Requirement
56
53
  requirements:
57
- - - ">="
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '2'
57
+ - !ruby/object:Gem::Dependency
58
+ name: overcommit
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ - !ruby/object:Gem::Dependency
72
+ name: parallel_tests
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
58
76
  - !ruby/object:Gem::Version
59
- version: '1.1'
60
- - - "<"
77
+ version: '3'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
61
83
  - !ruby/object:Gem::Version
62
- version: '3.0'
84
+ version: '3'
63
85
  - !ruby/object:Gem::Dependency
64
86
  name: rake
65
87
  requirement: !ruby/object:Gem::Requirement
66
88
  requirements:
67
89
  - - "~>"
68
90
  - !ruby/object:Gem::Version
69
- version: '13.0'
91
+ version: '13'
70
92
  type: :development
71
93
  prerelease: false
72
94
  version_requirements: !ruby/object:Gem::Requirement
73
95
  requirements:
74
96
  - - "~>"
75
97
  - !ruby/object:Gem::Version
76
- version: '13.0'
98
+ version: '13'
99
+ - !ruby/object:Gem::Dependency
100
+ name: rspec
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: '3'
106
+ type: :development
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - "~>"
111
+ - !ruby/object:Gem::Version
112
+ version: '3'
77
113
  - !ruby/object:Gem::Dependency
78
114
  name: rubocop
79
115
  requirement: !ruby/object:Gem::Requirement
80
116
  requirements:
81
- - - '='
117
+ - - "~>"
82
118
  - !ruby/object:Gem::Version
83
- version: 0.89.1
119
+ version: '1'
84
120
  type: :development
85
121
  prerelease: false
86
122
  version_requirements: !ruby/object:Gem::Requirement
87
123
  requirements:
88
- - - '='
124
+ - - "~>"
89
125
  - !ruby/object:Gem::Version
90
- version: 0.89.1
126
+ version: '1'
91
127
  - !ruby/object:Gem::Dependency
92
128
  name: rubocop-performance
93
129
  requirement: !ruby/object:Gem::Requirement
94
130
  requirements:
95
- - - '='
131
+ - - "~>"
96
132
  - !ruby/object:Gem::Version
97
- version: 1.7.1
133
+ version: '1'
98
134
  type: :development
99
135
  prerelease: false
100
136
  version_requirements: !ruby/object:Gem::Requirement
101
137
  requirements:
102
- - - '='
138
+ - - "~>"
103
139
  - !ruby/object:Gem::Version
104
- version: 1.7.1
140
+ version: '1'
105
141
  - !ruby/object:Gem::Dependency
106
142
  name: rubocop-rake
107
143
  requirement: !ruby/object:Gem::Requirement
108
144
  requirements:
109
- - - '='
145
+ - - "~>"
110
146
  - !ruby/object:Gem::Version
111
- version: 0.5.1
147
+ version: '0'
112
148
  type: :development
113
149
  prerelease: false
114
150
  version_requirements: !ruby/object:Gem::Requirement
115
151
  requirements:
116
- - - '='
152
+ - - "~>"
117
153
  - !ruby/object:Gem::Version
118
- version: 0.5.1
154
+ version: '0'
119
155
  - !ruby/object:Gem::Dependency
120
156
  name: rubocop-rspec
121
157
  requirement: !ruby/object:Gem::Requirement
122
158
  requirements:
123
- - - '='
159
+ - - "~>"
124
160
  - !ruby/object:Gem::Version
125
- version: 1.43.1
161
+ version: '2'
126
162
  type: :development
127
163
  prerelease: false
128
164
  version_requirements: !ruby/object:Gem::Requirement
129
165
  requirements:
130
- - - '='
166
+ - - "~>"
167
+ - !ruby/object:Gem::Version
168
+ version: '2'
169
+ - !ruby/object:Gem::Dependency
170
+ name: simplecov
171
+ requirement: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - "~>"
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ type: :development
177
+ prerelease: false
178
+ version_requirements: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - "~>"
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ - !ruby/object:Gem::Dependency
184
+ name: yard
185
+ requirement: !ruby/object:Gem::Requirement
186
+ requirements:
187
+ - - ">="
188
+ - !ruby/object:Gem::Version
189
+ version: 0.9.20
190
+ type: :development
191
+ prerelease: false
192
+ version_requirements: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
131
195
  - !ruby/object:Gem::Version
132
- version: 1.43.1
196
+ version: 0.9.20
133
197
  description: Parse OOXML files (docx, xlsx, pptx)
134
198
  email:
135
199
  - shockwavenn@gmail.com
@@ -489,7 +553,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
489
553
  requirements:
490
554
  - - ">="
491
555
  - !ruby/object:Gem::Version
492
- version: '2.4'
556
+ version: '2.5'
493
557
  required_rubygems_version: !ruby/object:Gem::Requirement
494
558
  requirements:
495
559
  - - ">="