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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d73219c29b55493f0be76ce047dbe7f72259f4efaab15d1528230bdfc1920b5
4
- data.tar.gz: a8ef47af79183aa6e6b465a0cbc6c7396ccccf3cb92574c386b956ebd3415056
3
+ metadata.gz: 1275df6831c609edc5a402d937777c5a470eaec9d815f95f0818223cde2515fc
4
+ data.tar.gz: 4c2447d0e64e3a0d23da20d1fb665742c35c9b1a5d2802956257ba076a04f16d
5
5
  SHA512:
6
- metadata.gz: 30287518cdce7bb9536d802fffdaa54b893bfcc811b03f1c226ea59b45787c0f5b4090b82796984e5c77741679bd035620cd3e38aecb4ebb0f1dcac9de50cb16
7
- data.tar.gz: 18c1c3ff22097f710cea838c6cf4a8058c35343d7f76312e063771ef2dc02c6ad0fbdace866c1b3dc9e21ab3545ea91f041ff16f4d540402be601c44c834d0dc
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
- # 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
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.3
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(...).lazy.map do |user|
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
- @benchmark = ::Benchmark.measure(&block)
9
+ benchmark = ::Benchmark.measure do
10
+ block.call
11
+ rescue StandardError => e
12
+ @benchmark_error = e
13
+ end
10
14
 
11
- model.meta['duration'] = @benchmark.real.round if model.respond_to?(:meta)
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
@@ -1,3 +1,3 @@
1
1
  module WorkerTools
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
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.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-06-20 00:00:00.000000000 Z
11
+ date: 2022-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport