creek 2.5.2 → 2.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/creek/sheet.rb +3 -2
- data/lib/creek/styles/converter.rb +1 -1
- data/lib/creek/version.rb +1 -1
- data/spec/sheet_spec.rb +12 -2
- 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: 0d90975898b7d260d37f6543755f8c2f4d5931d6e387a56c343bce23eee7e3b1
|
4
|
+
data.tar.gz: 0c381e483070a0e883f128e1a03147a5acf60c4a1095b42ef0d3106af7889f8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f23c318b54b45c2d1732c874e3f6519e7d528175a395b888e3352f302fb1f0b8625cdde965f16540081163282751dd410a712281651b9b3d3b91c9e89bec800
|
7
|
+
data.tar.gz: e601060be6ba35b3bc3ded42865bce8b46fc3ca92feec1439dc2e719f132bb2359d06129f1110dc6676d07f7707364fead716f8f584a5851388a1d183c6e6825
|
data/lib/creek/sheet.rb
CHANGED
@@ -92,6 +92,7 @@ module Creek
|
|
92
92
|
opener = Nokogiri::XML::Reader::TYPE_ELEMENT
|
93
93
|
closer = Nokogiri::XML::Reader::TYPE_END_ELEMENT
|
94
94
|
Enumerator.new do |y|
|
95
|
+
@headers = nil
|
95
96
|
row, cells, cell = nil, {}, nil
|
96
97
|
cell_type = nil
|
97
98
|
cell_style_idx = nil
|
@@ -104,7 +105,7 @@ module Creek
|
|
104
105
|
y << (include_meta_data ? row : cells) if node.self_closing?
|
105
106
|
elsif node.name == 'row' && node.node_type == closer
|
106
107
|
processed_cells = fill_in_empty_cells(cells, row['r'], cell, use_simple_rows_format)
|
107
|
-
@headers = processed_cells if row['r'] == HEADERS_ROW_NUMBER
|
108
|
+
@headers = processed_cells if with_headers && row['r'] == HEADERS_ROW_NUMBER
|
108
109
|
|
109
110
|
if @images_present
|
110
111
|
processed_cells.each do |cell_name, cell_value|
|
@@ -177,7 +178,7 @@ module Creek
|
|
177
178
|
parse_xml(sheet_rels_filepath).css("Relationship[@Id='#{drawing_rid}']").first.attributes['Target'].value
|
178
179
|
end
|
179
180
|
|
180
|
-
def cell_id(column, use_simple_rows_format, row_number
|
181
|
+
def cell_id(column, use_simple_rows_format, row_number)
|
181
182
|
return "#{column}#{row_number}" unless use_simple_rows_format
|
182
183
|
|
183
184
|
with_headers && headers ? headers[column] : column
|
data/lib/creek/version.rb
CHANGED
data/spec/sheet_spec.rb
CHANGED
@@ -112,13 +112,23 @@ describe 'sheet' do
|
|
112
112
|
context 'when enable with_headers property' do
|
113
113
|
before { sheet.with_headers = true }
|
114
114
|
|
115
|
-
subject { sheet.simple_rows.to_a[1] }
|
116
|
-
|
117
115
|
it 'returns values by headers name' do
|
118
116
|
expect(subject['HeaderA']).to eq 'value1'
|
119
117
|
expect(subject['HeaderB']).to eq 'value2'
|
120
118
|
expect(subject['HeaderC']).to eq 'value3'
|
121
119
|
end
|
120
|
+
|
121
|
+
it 'returns headers correctly when called multiple times' do
|
122
|
+
row = sheet.simple_rows.to_a[1]
|
123
|
+
expect(row['HeaderA']).to eq 'value1'
|
124
|
+
expect(row['HeaderB']).to eq 'value2'
|
125
|
+
expect(row['HeaderC']).to eq 'value3'
|
126
|
+
|
127
|
+
row = sheet.simple_rows.to_a[1]
|
128
|
+
expect(row['HeaderA']).to eq 'value1'
|
129
|
+
expect(row['HeaderB']).to eq 'value2'
|
130
|
+
expect(row['HeaderC']).to eq 'value3'
|
131
|
+
end
|
122
132
|
end
|
123
133
|
end
|
124
134
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: creek
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pythonicrubyist
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
|
-
rubygems_version: 3.0.
|
165
|
+
rubygems_version: 3.0.3
|
166
166
|
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: A Ruby gem for parsing large Excel(xlsx and xlsm) files.
|