worker_tools 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -4
- data/README.md +2 -2
- data/lib/worker_tools/benchmark.rb +7 -2
- data/lib/worker_tools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1275df6831c609edc5a402d937777c5a470eaec9d815f95f0818223cde2515fc
|
|
4
|
+
data.tar.gz: 4c2447d0e64e3a0d23da20d1fb665742c35c9b1a5d2802956257ba076a04f16d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8aa4a768008c5d5e27a355454f329370df2ebdae1ec2fe193677aea73c2a40ce3199277937bbb16fe15672e83b56441d2aaad8849b231f26b12d05b4f02b7c6c
|
|
7
|
+
data.tar.gz: 9463382d766043bcd77e079b3d9e0f85ef95187aa24ac8a83e1b6f7dee441c9215320580e7fac3096371a547c617663a896bca54707998bbb5d411317294031f
|
data/.rubocop.yml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# See all options in these files:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
# https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
|
3
|
+
# https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
|
|
4
|
+
# https://github.com/bbatsov/rubocop/blob/master/config/disabled.yml
|
|
5
5
|
|
|
6
6
|
# run bundle exec rubocop -D to see what cop is reporting
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# rubocop:enable LineLength
|
|
12
12
|
|
|
13
13
|
AllCops:
|
|
14
|
-
TargetRubyVersion: 2.
|
|
14
|
+
TargetRubyVersion: 2.7
|
|
15
15
|
Exclude:
|
|
16
16
|
- bin/*
|
|
17
17
|
- Rakefile
|
data/README.md
CHANGED
|
@@ -463,7 +463,7 @@ class CsvOutputExample
|
|
|
463
463
|
end
|
|
464
464
|
|
|
465
465
|
def csv_output_entries
|
|
466
|
-
@csv_output_entries ||= User.includes(...).
|
|
466
|
+
@csv_output_entries ||= User.includes(...).find_each do |user|
|
|
467
467
|
{
|
|
468
468
|
foo: user.foo,
|
|
469
469
|
bar: user.bar
|
|
@@ -506,7 +506,7 @@ class XlsxOutputExample
|
|
|
506
506
|
end
|
|
507
507
|
|
|
508
508
|
def xlsx_output_entries
|
|
509
|
-
@xlsx_output_entries ||= SomeArray.map do |entry|
|
|
509
|
+
@xlsx_output_entries ||= SomeArray.lazy.map do |entry|
|
|
510
510
|
{
|
|
511
511
|
foo: user.foo,
|
|
512
512
|
bar: user.bar
|
|
@@ -6,9 +6,14 @@ module WorkerTools
|
|
|
6
6
|
attr_accessor :benchmark
|
|
7
7
|
|
|
8
8
|
def with_wrapper_benchmark(&block)
|
|
9
|
-
|
|
9
|
+
benchmark = ::Benchmark.measure do
|
|
10
|
+
block.call
|
|
11
|
+
rescue StandardError => e
|
|
12
|
+
@benchmark_error = e
|
|
13
|
+
end
|
|
10
14
|
|
|
11
|
-
model.meta['duration'] =
|
|
15
|
+
model.meta['duration'] = benchmark.real.round if model.respond_to?(:meta)
|
|
16
|
+
raise @benchmark_error if @benchmark_error
|
|
12
17
|
end
|
|
13
18
|
end
|
|
14
19
|
end
|
data/lib/worker_tools/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: worker_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- fsainz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-07-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|