portable-writers-spreadsheet 1.0.0.pre.alpha.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/lib/portable/writers/spreadsheet.rb +12 -7
- data/lib/portable/writers/spreadsheet/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d66fdb595173e470ede73c7be2143cfc149bce05ea9fc325c7309da3cb601eb
|
4
|
+
data.tar.gz: 2a0759aa9409ef571bea33c1d32eaa967d7e185cd723e6f1f5b608da1f98aaae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7da04ea5089d27b54e8490d23a77ba884753a1899edd037a5655221f57b69a805540cdc7043f9d59d2463b9dd1ca7561fb5fc0f0fe170ed4c76caad10039381
|
7
|
+
data.tar.gz: ea701347bde39493b665b0095916873501c3502becf343dfbb0937ea6df63a9497a40f461cf008b1ee71f41f22d607f2dda3cfac17052a635fbe323d38579fe6
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
# LICENSE file in the root directory of this source tree.
|
8
8
|
#
|
9
9
|
|
10
|
+
require 'benchmark'
|
10
11
|
require 'fast_excel'
|
11
12
|
require 'portable'
|
12
13
|
|
@@ -17,8 +18,18 @@ module Portable
|
|
17
18
|
def write!(filename:, data_provider: Data::Provider.new, time: Time.now.utc)
|
18
19
|
raise ArgumentError, 'filename is required' if filename.to_s.empty?
|
19
20
|
|
20
|
-
|
21
|
+
time_in_seconds = Benchmark.measure do
|
22
|
+
ensure_directory_exists(filename)
|
21
23
|
|
24
|
+
write_file(filename, data_provider, time)
|
25
|
+
end.real
|
26
|
+
|
27
|
+
[Result.new(filename, time_in_seconds)]
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def write_file(filename, data_provider, time)
|
22
33
|
workbook = FastExcel.open(filename, constant_memory: true)
|
23
34
|
|
24
35
|
document.sheets.map do |sheet|
|
@@ -31,14 +42,8 @@ module Portable
|
|
31
42
|
end
|
32
43
|
|
33
44
|
workbook.close
|
34
|
-
|
35
|
-
time_in_seconds = 1.0
|
36
|
-
|
37
|
-
[Result.new(filename, time_in_seconds)]
|
38
45
|
end
|
39
46
|
|
40
|
-
private
|
41
|
-
|
42
47
|
def write_head(worksheet, sheet, data_source)
|
43
48
|
sheet.header_rows.each { |row| worksheet.append_row(row) }
|
44
49
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: portable-writers-spreadsheet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Ruggio
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fast_excel
|
@@ -195,9 +195,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
195
195
|
version: '2.5'
|
196
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
197
|
requirements:
|
198
|
-
- - "
|
198
|
+
- - ">="
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version:
|
200
|
+
version: '0'
|
201
201
|
requirements: []
|
202
202
|
rubygems_version: 3.0.3
|
203
203
|
signing_key:
|