rggen-spreadsheet-loader 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0f3c849dfe3a2e44abfe3dc1014c4a4254fe8be92bdd4b64745fd1778cb0b42
|
4
|
+
data.tar.gz: 690e61fab0e402d9171aa2ee50befbf25111ad44810acf01cd5c9af11fba7e8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23770bfa1f24804808d6c75885f07338831f18833147c165783b8dd1bac3edde07e90f281f1ed2f326fcf71487ff972bb1f14353d08142491660a68997b57676
|
7
|
+
data.tar.gz: e162d610aa891cd2928370e9cb8f9bf6d4057be34f344efc855de1539ecc2b743054c4d00d4209a999747facbe579cf947fc8cdae44f2c36e72dfbd29cf33c40
|
@@ -8,19 +8,22 @@ module RgGen
|
|
8
8
|
support_types [:xlsx, :ods]
|
9
9
|
|
10
10
|
def read_spreadsheet(file, book)
|
11
|
-
read_roo(file
|
12
|
-
book.add_sheet(pagename, collect_cells(page))
|
13
|
-
end
|
11
|
+
read_roo(file, &page_processor(book))
|
14
12
|
end
|
15
13
|
|
16
14
|
private
|
17
15
|
|
18
|
-
def read_roo(file)
|
16
|
+
def read_roo(file, &block)
|
19
17
|
require 'roo'
|
20
18
|
Roo::Spreadsheet.open(file, extension: File.extname(file))
|
21
|
-
.each_with_pagename
|
22
|
-
|
23
|
-
|
19
|
+
.each_with_pagename(&block)
|
20
|
+
end
|
21
|
+
|
22
|
+
def page_processor(book)
|
23
|
+
lambda do |pagename_and_page|
|
24
|
+
pagename, page = pagename_and_page
|
25
|
+
page.first_row && book.add_sheet(pagename, collect_cells(page))
|
26
|
+
end
|
24
27
|
end
|
25
28
|
|
26
29
|
def collect_cells(page)
|
@@ -58,7 +58,8 @@ module RgGen
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def collect_register_data(sheet)
|
61
|
-
sheet
|
61
|
+
sheet
|
62
|
+
.rows(register_start_position.row)
|
62
63
|
.reject { |row| row.cells.all?(&:empty_cell?) }
|
63
64
|
.each_with_object([], &method(:collect_register_rows))
|
64
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rggen-spreadsheet-loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taichi Ishitani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: roo
|
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '2.
|
93
|
+
version: '2.5'
|
94
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
96
|
- - ">="
|
@@ -100,5 +100,5 @@ requirements: []
|
|
100
100
|
rubygems_version: 3.2.3
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
|
-
summary: rggen-spreadsheet-loader-0.
|
103
|
+
summary: rggen-spreadsheet-loader-0.20.0
|
104
104
|
test_files: []
|