creek 2.6.2 → 2.6.3

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: d6c8bd9467a3772e8b09ecfce4dbef12d530cc094e44a0a9de3806d92930a46f
4
- data.tar.gz: de59455bb37db21574fb55f269dd12faa3c4aeecbb52139ce5fdb6b0a7bb740a
3
+ metadata.gz: c1b4c7fc5370d7342b94d1093ee6c862720df9ba290513719eb726c91beb67d9
4
+ data.tar.gz: 54000d7369f0b38f19486d6d15355fcda2baf9b848173e5a7d9e50c537626959
5
5
  SHA512:
6
- metadata.gz: c0d5f95b17cd1e3cd7f0fb1286aa6a3a57875949b8a1c55c7eb34e0afe6f9bb34c373126273e5b20f77553c4e350fa8089c0398dfe23c55757a9c43a5ebd141c
7
- data.tar.gz: ff1771e65a5add043080fa4ebb63c5b90a4e91d40ee7566996ae9e33a83dc0f6b54d327ee825a5759ee874a7219c4bcd2097b2e78e27374e5c7fc6d69fcccebd
6
+ metadata.gz: 34c2a023e06a47258b430595db38b3a2eb8b56df7e9b5b41c7b8e6878803e155adff60849b3d6568f6afe7f0ffb38dbd0cf7c333871e09bb7dcc1957e7ef3e33
7
+ data.tar.gz: bacf97b02bef5b6eeefb6acdd3a74e9af621aeeff2ea8688486c19f2e9860ada8dd7b65499d4b1c79eef981b92b4ed4b966c6c4390b3f38ec575a66055316c24
@@ -22,7 +22,7 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  strategy:
24
24
  matrix:
25
- ruby-version: ['2.6', '2.7', '3.0', '3.1']
25
+ ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
26
26
 
27
27
  steps:
28
28
  - uses: actions/checkout@v3
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![version](https://badge.fury.io/rb/creek.svg)](https://badge.fury.io/rb/creek)
2
- [![downloads](https://ruby-gem-downloads-badge.herokuapp.com/creek?type=total&total_label=downloads)](https://ruby-gem-downloads-badge.herokuapp.com/creek?type=total&total_label=downloads)
2
+ [![downloads](https://img.shields.io/gem/dt/creek)](https://rubygems.org/gems/creek)
3
3
 
4
4
  # Creek - Stream parser for large Excel (xlsx and xlsm) files.
5
5
 
data/lib/creek/book.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'zip/filesystem'
2
4
  require 'nokogiri'
3
5
  require 'date'
data/lib/creek/drawing.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pathname'
2
4
 
3
5
  module Creek
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'zip/filesystem'
2
4
  require 'nokogiri'
3
5
 
data/lib/creek/sheet.rb CHANGED
@@ -99,6 +99,10 @@ module Creek
99
99
  cell_style_idx = nil
100
100
  @book.files.file.open(path) do |xml|
101
101
  prefix = ''
102
+ name_row = "row"
103
+ name_c = "c"
104
+ name_v = "v"
105
+ name_t = "t"
102
106
  Nokogiri::XML::Reader.from_io(xml).each do |node|
103
107
  if prefix.empty? && node.namespaces.any?
104
108
  namespace = node.namespaces.detect{|_key, uri| uri == SPREADSHEETML_URI }
@@ -107,13 +111,17 @@ module Creek
107
111
  else
108
112
  ''
109
113
  end
114
+ name_row = "#{prefix}row"
115
+ name_c = "#{prefix}c"
116
+ name_v = "#{prefix}v"
117
+ name_t = "#{prefix}t"
110
118
  end
111
- if node.name == "#{prefix}row" && node.node_type == opener
119
+ if node.name == name_row && node.node_type == opener
112
120
  row = node.attributes
113
121
  row['cells'] = {}
114
122
  cells = {}
115
123
  y << (include_meta_data ? row : cells) if node.self_closing?
116
- elsif node.name == "#{prefix}row" && node.node_type == closer
124
+ elsif node.name == name_row && node.node_type == closer
117
125
  processed_cells = fill_in_empty_cells(cells, row['r'], cell, use_simple_rows_format)
118
126
  @headers = processed_cells if with_headers && row['r'] == HEADERS_ROW_NUMBER
119
127
 
@@ -127,11 +135,11 @@ module Creek
127
135
 
128
136
  row['cells'] = processed_cells
129
137
  y << (include_meta_data ? row : processed_cells)
130
- elsif node.name == "#{prefix}c" && node.node_type == opener
138
+ elsif node.name == name_c && node.node_type == opener
131
139
  cell_type = node.attributes['t']
132
140
  cell_style_idx = node.attributes['s']
133
141
  cell = node.attributes['r']
134
- elsif ["#{prefix}v", "#{prefix}t"].include?(node.name) && node.node_type == opener
142
+ elsif (node.name == name_v || node.name == name_t) && node.node_type == opener
135
143
  unless cell.nil?
136
144
  node.read
137
145
  cells[cell] = convert(node.value, cell_type, cell_style_idx)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'set'
2
4
 
3
5
  module Creek
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # https://github.com/hmcgowan/roo/blob/master/lib/roo/excelx.rb
2
4
  # https://github.com/woahdae/simple_xlsx_reader/blob/master/lib/simple_xlsx_reader.rb#L231
3
5
  module Creek
data/lib/creek/styles.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Creek
2
4
  class Styles
3
5
  attr_accessor :book
data/lib/creek/utils.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Creek
2
4
  module Utils
3
5
  def expand_to_rels_path(filepath)
data/lib/creek/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Creek
2
- VERSION = "2.6.2"
4
+ VERSION = "2.6.3"
3
5
  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.6.2
4
+ version: 2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - pythonicrubyist
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-29 00:00:00.000000000 Z
11
+ date: 2023-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler