worker_tools 1.3.1 → 1.4.0

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: 36547805fb8cfbbf750b84c31fb325a918c54501830bbdfd68f8f2c8f5b1267e
4
- data.tar.gz: 47361b96ca6e8964b688b0ea50e426c2786edc9b0415984fc9dd4c5247c9cc1d
3
+ metadata.gz: 5536ad30b89a41547dd366a636e5af73fcf2d4cccbf82121368908c6b93aa335
4
+ data.tar.gz: 3b21113a5df263e2bf725c6c6f6551e1a13bbe490327427d89e3f7f48acb5209
5
5
  SHA512:
6
- metadata.gz: d0fbe8c88c4aa16ea93840bae76823d43aa98539110ba3f347607ca809ddf0ae5687a84608d86b73ae3b771816ad746d9e2006c681192fca3c1bec33c04a9af6
7
- data.tar.gz: c0bbd1d018d2d77a61fd538c337423d6380ed1a351e8844eb930e6fd416068461df06fa8732527cadd5949348be44f3ec70bf6ac97dcfdb1b7eec02825dfd0e2
6
+ metadata.gz: da03a3492b4ba03378e1bbfc19f838203dc3a33eb1b5b709175bf7a79667d4f353e21ac70b3c55e7dfc57f3c049264a9738daa17ae334b57e3f09ac699e09eaa
7
+ data.tar.gz: 511063cdd88398859bf04cbf4561c8172af3e655e72c2225dc96a9fa351f81e2d113fc1d479f063cd7aefb0125b1233184f43db8e677f09474ba76e5eeab0413
data/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0] - 2026-12-02
4
+
5
+ Apart from the fix, no changes to the modules or their methods.
6
+
7
+ ### Fixed
8
+
9
+ - `XlsxInput`: the rows enumerator did not keep the Roo workbook alive. Roo removes the extracted files as soon as the workbook is garbage collected, so reading could fail with `Errno::ENOENT` (`/tmp/roo_.../roo_sheet1`) or, more misleading, with `DuplicatedColumns: [""]`, depending on when the garbage collector ran. All previous versions are affected. `xlsx_rows_enum` now reads the rows through the workbook, which lives as long as the enumerator does.
10
+
11
+ ### Changed
12
+
13
+ - Requires Ruby 3.3 or newer.
14
+ - `benchmark` and `csv` are declared as dependencies: they are no longer default gems in current Rubies.
15
+ - The modules require the standard libraries they use (`benchmark`, `tempfile`, `logger`, `fileutils`) instead of relying on something else having loaded them. Outside a full Rails app the `Benchmark` wrapper ended in `NameError: uninitialized constant Benchmark` with Active Record 8.1.
16
+ - The gem package only ships `lib`, the README, the changelog and the license.
17
+
18
+ ### Internal
19
+
20
+ - GitHub Actions instead of Travis: tests on Ruby 3.3, 3.4 and 4.0 against roo 2, 3 and 4.
21
+ - rubocop is gone, it was pinned to a version from 2019 and ran as a test.
22
+ - `compose.yml` for developing without a local Ruby.
23
+
24
+ ## [1.3.1] - 2026-01-12
25
+
26
+ - `CsvInput` and `XlsxInput` raise `Errors::EmptyFile` when the file is missing or has 0 bytes, `Basics` then sets the state `empty`.
27
+
28
+ ## [1.3.0] - 2025-09-24
29
+
30
+ - `MemoryUsage` wrapper.
31
+
32
+ ## [1.2.0] - 2025-03-18
33
+
34
+ - `xlsx_output_number_format`.
35
+
36
+ ## [1.1.1] - 2024-02-01
37
+
38
+ - The `Recorder` logger creates its log directory.
39
+
3
40
  ## [1.1.0] - 2023-07-13
4
41
 
5
42
  ### New
@@ -15,6 +52,14 @@
15
52
 
16
53
  The method `non_failure_error?` has being replaced with `silent_error?`
17
54
 
55
+ ## [1.0.2] - 2022-07-26
56
+
57
+ - Fixes an error of the `Benchmark` wrapper being raised again in later runs.
58
+
59
+ ## [1.0.1] - 2022-07-24
60
+
61
+ - The `Benchmark` wrapper records the duration even if the task fails.
62
+
18
63
  ## [1.0.0] - 2022-05-20
19
64
 
20
65
  Compared to 0.2.1
data/README.md CHANGED
@@ -34,6 +34,7 @@
34
34
  </li>
35
35
  <li><a href="#changelog">Changelog</a></li>
36
36
  <li><a href="#requirements">Requirements</a></li>
37
+ <li><a href="#development">Development</a></li>
37
38
  <li><a href="#contributing">Contributing</a></li>
38
39
  <li><a href="#license">License</a></li>
39
40
  <li><a href="#acknowledgement">Acknowledgement</a></li>
@@ -51,7 +52,7 @@ These modules provide some features and conventions to address the following poi
51
52
  - How to log the details
52
53
  - How to handle exceptions and send notifications
53
54
  - How to process CSV files (as input and output)
54
- - How to process XLXS files (as input, output coming next)
55
+ - How to process XLSX files (as input and output)
55
56
  - How to set options
56
57
 
57
58
  ## Installation
@@ -78,22 +79,22 @@ An example of this model for an Import using Paperclip would be something like t
78
79
 
79
80
  ```ruby
80
81
  class Import < ApplicationRecord
81
- enum state: %w[
82
+ enum :state, %w[
82
83
  waiting
83
84
  complete
84
85
  complete_with_warnings
85
86
  failed
86
87
  running
87
88
  empty
88
- ].map { |e| [e, e] }.to_h
89
+ ].index_by(&:itself)
89
90
 
90
- enum kind: { foo: 0, bar: 1 }
91
+ enum :kind, { foo: 0, bar: 1 }
91
92
 
92
93
  has_attached_file :attachment
93
94
 
94
95
  validates :kind, presence: true
95
96
  validates :state, presence: true
96
- end
97
+ end
97
98
  ```
98
99
 
99
100
  The state `complete` and `failed` are used by the modules. Both `state` and `kind` could be an enum or just a string field. Whether you have one, none or many attachments, and which library you use to handle it's up to you.
@@ -129,7 +130,7 @@ A simple example would be as follows:
129
130
 
130
131
  ```ruby
131
132
  class MyImporter
132
- include WorkerTools::Basic
133
+ include WorkerTools::Basics
133
134
  wrappers :basics
134
135
 
135
136
  def model_class
@@ -152,13 +153,13 @@ By default errors subclassed from WorkerTools::Errors::Silent (such as those rel
152
153
 
153
154
  ## Module 'Recorder'
154
155
 
155
- Provides some methods to manage a log and the `notes` field of the model. The main methods are `add_info`, `add_log`, and `record` (which both logs and appends the message to the notes field). See all methods in [recorder](/lib/worker_tools/recorder.rb)
156
+ Provides some methods to manage a log and the `notes` field of the model. The main methods are `add_note`, `add_log`, and `record` (which both logs and appends the message to the notes field). See all methods in [recorder](/lib/worker_tools/recorder.rb)
156
157
 
157
- This module has a _recoder_ wrapper that will register the exception details into the log and notes field in case of error:
158
+ This module has a _recorder_ wrapper that will register the exception details into the log and notes field in case of error:
158
159
 
159
160
  ```ruby
160
161
  class MyImporter
161
- include WorkerTools::Basic
162
+ include WorkerTools::Basics
162
163
  wrappers :basics, :recorder
163
164
  # ...
164
165
  end
@@ -184,15 +185,16 @@ Provides a Slack error notifier wrapper. To do this, you need to define SLACK_NO
184
185
 
185
186
  ```ruby
186
187
  class MyImporter
188
+ include WorkerTools::Basics
187
189
  include WorkerTools::SlackErrorNotifier
188
190
 
189
- wrappers :slack_error_notifier
191
+ wrappers :basics, :slack_error_notifier
190
192
 
191
- def perform
192
- with_wrapper_logger do
193
- # do stuff
194
- end
193
+ def run
194
+ # do stuff
195
195
  end
196
+
197
+ # ..
196
198
  end
197
199
  ```
198
200
 
@@ -238,7 +240,7 @@ The following code
238
240
 
239
241
  ```ruby
240
242
  class MyImporter
241
- include WorkerTools::Basic
243
+ include WorkerTools::Basics
242
244
  wrappers :basics
243
245
 
244
246
  def run
@@ -531,7 +533,7 @@ class CsvOutputExample
531
533
  end
532
534
 
533
535
  def csv_output_entries
534
- @csv_output_entries ||= User.includes(...).find_each do |user|
536
+ @csv_output_entries ||= User.includes(...).find_each.lazy.map do |user|
535
537
  {
536
538
  foo: user.foo,
537
539
  bar: user.bar
@@ -576,8 +578,8 @@ class XlsxOutputExample
576
578
  def xlsx_output_entries
577
579
  @xlsx_output_entries ||= SomeArray.lazy.map do |entry|
578
580
  {
579
- foo: user.foo,
580
- bar: user.bar
581
+ foo: entry.foo,
582
+ bar: entry.bar
581
583
  }
582
584
  end
583
585
  end
@@ -590,7 +592,21 @@ See [CHANGELOG](CHANGELOG.md)
590
592
 
591
593
  ## Requirements
592
594
 
593
- - ruby > 2.3.1
595
+ - ruby >= 3.3
596
+
597
+ ## Development
598
+
599
+ With a local Ruby (see `.tool-versions`):
600
+
601
+ $ bin/setup
602
+ $ bundle exec rake
603
+
604
+ Without one, the same in a container:
605
+
606
+ $ docker compose run --rm dev bin/setup
607
+ $ docker compose run --rm dev bundle exec rake
608
+
609
+ CI runs the tests on every supported Ruby and roo major. To do the same locally, see the comments in `compose.yml`.
594
610
 
595
611
  ## Contributing
596
612
 
@@ -612,10 +628,10 @@ The gem is available under the MIT License. See `LICENSE` for more information.
612
628
 
613
629
  <!--shield-styles-->
614
630
 
615
- [build-badge]: https://travis-ci.org/i22-digitalagentur/worker-tools.svg?branch=master
616
- [build-url]: https://travis-ci.org/i22-digitalagentur/worker-tools
631
+ [build-badge]: https://github.com/i22-digitalagentur/worker-tools/actions/workflows/ci.yml/badge.svg?branch=master
632
+ [build-url]: https://github.com/i22-digitalagentur/worker-tools/actions/workflows/ci.yml
617
633
  [maintained-shield]: https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=flat
618
- [release-shield]: https://img.shields.io/github/release/i22-digitalagentur/coverage-badge-creator.svg?style=flat
619
- [release-url]: https://github.com/i22-digitalagentur/worker-tools/releases/
634
+ [release-shield]: https://img.shields.io/gem/v/worker_tools.svg?style=flat
635
+ [release-url]: https://rubygems.org/gems/worker_tools
620
636
  [license-shield]: https://img.shields.io/badge/License-MIT-yellow.svg?style=flat
621
637
  [license-url]: https://github.com/i22-digitalagentur/worker-tools/blob/master/LICENSE
@@ -54,9 +54,7 @@ module WorkerTools
54
54
  finalize
55
55
  # this time we do want to catch Exception to attempt to handle some of the
56
56
  # critical errors.
57
- # rubocop:disable Lint/RescueException
58
57
  rescue Exception => e
59
- # rubocop:enable Lint/RescueException
60
58
  state = e.is_a?(WorkerTools::Errors::EmptyFile) ? 'empty' : 'failed'
61
59
  save_state_without_validate(state)
62
60
 
@@ -1,3 +1,5 @@
1
+ require 'benchmark'
2
+
1
3
  module WorkerTools
2
4
  module Benchmark
3
5
  extend ActiveSupport::Concern
@@ -88,7 +88,7 @@ module WorkerTools
88
88
  def csv_input_columns_hash_check_missing(actual_names, expected_names)
89
89
  missing = expected_names.reject do |name|
90
90
  matchable = name.is_a?(String) ? csv_input_header_normalized(name) : name
91
- actual_names.any? { |n| case n when matchable then true end } # rubocop does not like ===
91
+ actual_names.any? { |n| case n when matchable then true end }
92
92
  end
93
93
  raise Errors::MissingColumns, "Some columns are missing: #{missing}" unless missing.empty?
94
94
  end
@@ -1,4 +1,5 @@
1
1
  require 'csv'
2
+ require 'tempfile'
2
3
 
3
4
  module WorkerTools
4
5
  module CsvOutput
@@ -5,7 +5,6 @@ module WorkerTools
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
- # rubocop:disable Metrics/MethodLength
9
8
  def with_wrapper_memory_usage(&block)
10
9
  memory_error = nil
11
10
  start_memory = GetProcessMem.new.mb
@@ -22,7 +21,6 @@ module WorkerTools
22
21
 
23
22
  raise memory_error if memory_error
24
23
  end
25
- # rubocop:enable Metrics/MethodLength
26
24
  end
27
25
  end
28
26
  end
@@ -1,12 +1,13 @@
1
+ require 'fileutils'
2
+ require 'logger'
3
+
1
4
  module WorkerTools
2
5
  module Recorder
3
6
  def with_wrapper_recorder(&block)
4
7
  block.yield
5
8
  # this time we do want to catch Exception to attempt to handle some of the
6
9
  # critical errors.
7
- # rubocop:disable Lint/RescueException
8
10
  rescue Exception => e
9
- # rubocop:enable Lint/RescueException
10
11
  record_fail(e)
11
12
  raise
12
13
  end
@@ -15,9 +16,7 @@ module WorkerTools
15
16
  block.yield
16
17
  # this time we do want to catch Exception to attempt to handle some of the
17
18
  # critical errors.
18
- # rubocop:disable Lint/RescueException
19
19
  rescue Exception => e
20
- # rubocop:enable Lint/RescueException
21
20
  add_log(e, :error)
22
21
  raise
23
22
  end
@@ -1,3 +1,3 @@
1
1
  module WorkerTools
2
- VERSION = '1.3.1'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
@@ -91,7 +91,7 @@ module WorkerTools
91
91
  def xlsx_input_columns_hash_check_missing(actual_names, expected_names)
92
92
  missing = expected_names.reject do |name|
93
93
  matchable = name.is_a?(String) ? xlsx_input_header_normalized(name) : name
94
- actual_names.any? { |n| case n when matchable then true end } # rubocop does not like ===
94
+ actual_names.any? { |n| case n when matchable then true end }
95
95
  end
96
96
  raise Errors::MissingColumns, "Some columns are missing: #{missing}" unless missing.empty?
97
97
  end
@@ -131,10 +131,18 @@ module WorkerTools
131
131
  model.attachment.path.to_s
132
132
  end
133
133
 
134
+ # Roo extracts the file into a temporary directory and removes it as soon
135
+ # as the workbook is garbage collected. The enumerator that
136
+ # each_row_streaming returns without a block references the sheet only, so
137
+ # the rows are read through the workbook instead: whoever holds the
138
+ # enumerator keeps the extracted files alive.
134
139
  def xlsx_rows_enum
135
140
  @xlsx_rows_enum ||= begin
136
141
  spreadsheet = Roo::Excelx.new(xlsx_input_file_path)
137
- spreadsheet.each_row_streaming(sheet: spreadsheet.sheets.first, pad_cells: true)
142
+ sheet = spreadsheet.sheets.first
143
+ Enumerator.new do |rows|
144
+ spreadsheet.each_row_streaming(sheet: sheet, pad_cells: true) { |row| rows << row }
145
+ end
138
146
  end
139
147
  end
140
148
 
@@ -1,8 +1,8 @@
1
1
  require 'rubyXL'
2
2
  require 'rubyXL/convenience_methods'
3
+ require 'tempfile'
3
4
 
4
5
  module WorkerTools
5
- # rubocop:disable Metrics/ModuleLength
6
6
  module XlsxOutput
7
7
  def xlsx_output_entries
8
8
  raise "xlsx_output_entries has to be defined in #{self}"
@@ -81,8 +81,6 @@ module WorkerTools
81
81
  end
82
82
  end
83
83
 
84
- # rubocop:disable Metrics/AbcSize
85
- # rubocop:disable Metrics/MethodLength
86
84
  def xlsx_output_insert_rows(spreadsheet, rows, headers, number_formats)
87
85
  number_format_by_col_index = Hash(number_formats).each_with_object({}) do |(col, number_format), hash|
88
86
  hash[headers.keys.index(col)] = number_format
@@ -103,8 +101,6 @@ module WorkerTools
103
101
  end
104
102
  end
105
103
  end
106
- # rubocop:enable Metrics/AbcSize
107
- # rubocop:enable Metrics/MethodLength
108
104
 
109
105
  def xlsx_output_iterators(iterable, compare_hash = nil)
110
106
  if iterable.is_a? Hash
@@ -144,7 +140,6 @@ module WorkerTools
144
140
  )
145
141
  end
146
142
 
147
- # rubocop:disable Metrics/AbcSize
148
143
  def xlsx_output_write_sheet(workbook, sheet_content, index)
149
144
  sheet = workbook.worksheets[index]
150
145
  sheet = workbook.add_worksheet(sheet_content[:label]) if sheet.nil?
@@ -154,7 +149,6 @@ module WorkerTools
154
149
  xlsx_output_insert_headers(sheet, sheet_content[:headers])
155
150
  xlsx_output_insert_rows(sheet, sheet_content[:rows], sheet_content[:headers], sheet_content[:number_format])
156
151
  end
157
- # rubocop:enable Metrics/AbcSize
158
152
 
159
153
  def xlsx_output_write_file
160
154
  book = RubyXL::Workbook.new
@@ -167,5 +161,4 @@ module WorkerTools
167
161
  xlsx_output_add_attachment
168
162
  end
169
163
  end
170
- # rubocop:enable Metrics/ModuleLength
171
164
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: worker_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - fsainz
8
- autorequire:
9
- bindir: exe
8
+ bindir: bin
10
9
  cert_chain: []
11
- date: 2026-01-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -25,7 +24,7 @@ dependencies:
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
26
  - !ruby/object:Gem::Dependency
28
- name: get_process_mem
27
+ name: benchmark
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
@@ -39,7 +38,7 @@ dependencies:
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
41
40
  - !ruby/object:Gem::Dependency
42
- name: roo
41
+ name: csv
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - ">="
@@ -53,7 +52,7 @@ dependencies:
53
52
  - !ruby/object:Gem::Version
54
53
  version: '0'
55
54
  - !ruby/object:Gem::Dependency
56
- name: rubyXL
55
+ name: get_process_mem
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - ">="
@@ -67,7 +66,7 @@ dependencies:
67
66
  - !ruby/object:Gem::Version
68
67
  version: '0'
69
68
  - !ruby/object:Gem::Dependency
70
- name: slack-notifier
69
+ name: roo
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - ">="
@@ -81,139 +80,13 @@ dependencies:
81
80
  - !ruby/object:Gem::Version
82
81
  version: '0'
83
82
  - !ruby/object:Gem::Dependency
84
- name: activerecord
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: bundler
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: database_cleaner
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: m
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: minitest
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: mocha
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - ">="
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: pry
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: rake
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: rubocop
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - '='
200
- - !ruby/object:Gem::Version
201
- version: 0.72.0
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - '='
207
- - !ruby/object:Gem::Version
208
- version: 0.72.0
209
- - !ruby/object:Gem::Dependency
210
- name: simplecov
83
+ name: rubyXL
211
84
  requirement: !ruby/object:Gem::Requirement
212
85
  requirements:
213
86
  - - ">="
214
87
  - !ruby/object:Gem::Version
215
88
  version: '0'
216
- type: :development
89
+ type: :runtime
217
90
  prerelease: false
218
91
  version_requirements: !ruby/object:Gem::Requirement
219
92
  requirements:
@@ -221,37 +94,28 @@ dependencies:
221
94
  - !ruby/object:Gem::Version
222
95
  version: '0'
223
96
  - !ruby/object:Gem::Dependency
224
- name: sqlite3
97
+ name: slack-notifier
225
98
  requirement: !ruby/object:Gem::Requirement
226
99
  requirements:
227
100
  - - ">="
228
101
  - !ruby/object:Gem::Version
229
102
  version: '0'
230
- type: :development
103
+ type: :runtime
231
104
  prerelease: false
232
105
  version_requirements: !ruby/object:Gem::Requirement
233
106
  requirements:
234
107
  - - ">="
235
108
  - !ruby/object:Gem::Version
236
109
  version: '0'
237
- description:
238
110
  email:
239
111
  - fernando.sainz@i22.de
240
112
  executables: []
241
113
  extensions: []
242
114
  extra_rdoc_files: []
243
115
  files:
244
- - ".gitignore"
245
- - ".rubocop.yml"
246
- - ".tool-versions"
247
- - ".travis.yml"
248
116
  - CHANGELOG.md
249
- - Gemfile
250
117
  - LICENSE
251
118
  - README.md
252
- - Rakefile
253
- - bin/console
254
- - bin/setup
255
119
  - lib/worker_tools.rb
256
120
  - lib/worker_tools/basics.rb
257
121
  - lib/worker_tools/benchmark.rb
@@ -267,13 +131,13 @@ files:
267
131
  - lib/worker_tools/version.rb
268
132
  - lib/worker_tools/xlsx_input.rb
269
133
  - lib/worker_tools/xlsx_output.rb
270
- - worker_tools.gemspec
271
134
  homepage: https://github.com/i22-digitalagentur/worker-tools
272
135
  licenses:
273
136
  - MIT
274
137
  metadata:
275
138
  allowed_push_host: https://rubygems.org
276
- post_install_message:
139
+ source_code_uri: https://github.com/i22-digitalagentur/worker-tools
140
+ changelog_uri: https://github.com/i22-digitalagentur/worker-tools/blob/master/CHANGELOG.md
277
141
  rdoc_options: []
278
142
  require_paths:
279
143
  - lib
@@ -281,15 +145,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
281
145
  requirements:
282
146
  - - ">="
283
147
  - !ruby/object:Gem::Version
284
- version: '0'
148
+ version: '3.3'
285
149
  required_rubygems_version: !ruby/object:Gem::Requirement
286
150
  requirements:
287
151
  - - ">="
288
152
  - !ruby/object:Gem::Version
289
153
  version: '0'
290
154
  requirements: []
291
- rubygems_version: 3.1.6
292
- signing_key:
155
+ rubygems_version: 3.6.9
293
156
  specification_version: 4
294
- summary: A collection of modules to help writing common worker tasks)
157
+ summary: A collection of modules to help writing common worker tasks
295
158
  test_files: []
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- .DS_Store
data/.rubocop.yml DELETED
@@ -1,42 +0,0 @@
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
5
-
6
- # run bundle exec rubocop -D to see what cop is reporting
7
-
8
- # If you want to skip the check for line length in a specific case do:
9
- # rubocop:disable LineLength
10
- # superlong-line-with-unavoidable-excesive-length
11
- # rubocop:enable LineLength
12
-
13
- AllCops:
14
- TargetRubyVersion: 2.7
15
- Exclude:
16
- - bin/*
17
- - Rakefile
18
-
19
- Documentation:
20
- Enabled: false
21
-
22
- Metrics/BlockLength:
23
- Exclude:
24
- - test/**/*
25
- - ./*.gemspec
26
-
27
- Metrics/LineLength:
28
- Max: 120
29
- Exclude:
30
- - test/**/*
31
-
32
- Metrics/MethodLength:
33
- Exclude:
34
- - test/**/*
35
-
36
- Style/FrozenStringLiteralComment:
37
- Enabled: false
38
-
39
- # Although casecmp is more performant, downcase is more readable
40
- # 'Foo'.downcase.eql?('foo') vs 'Foo'.casecmp('foo').zero?
41
- Performance/Casecmp:
42
- Enabled: false
data/.tool-versions DELETED
@@ -1 +0,0 @@
1
- ruby 2.7.5
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.1
5
- - 2.7.0
6
- before_install: gem install bundler -v 2.1.4
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in worker_tools.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList['test/**/*_test.rb']
8
- end
9
-
10
- task :default => :test
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "worker_tools"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/worker_tools.gemspec DELETED
@@ -1,46 +0,0 @@
1
- lib = File.expand_path('lib', __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'worker_tools/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'worker_tools'
7
- spec.version = WorkerTools::VERSION
8
- spec.authors = ['fsainz']
9
- spec.email = ['fernando.sainz@i22.de']
10
-
11
- spec.summary = 'A collection of modules to help writing common worker tasks)'
12
- # spec.description = %q{TODO: Write a longer description or delete this line.}
13
- spec.homepage = 'https://github.com/i22-digitalagentur/worker-tools'
14
- spec.license = 'MIT'
15
-
16
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
17
- # to allow pushing to a single host or delete this section to allow pushing to any host.
18
- raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.' unless spec.respond_to?(:metadata)
19
-
20
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
-
22
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
23
- f.match(%r{^(test|spec|features)/})
24
- end
25
- spec.bindir = 'exe'
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
- spec.require_paths = ['lib']
28
-
29
- spec.add_dependency 'activesupport'
30
- spec.add_dependency 'get_process_mem'
31
- spec.add_dependency 'roo'
32
- spec.add_dependency 'rubyXL'
33
- spec.add_dependency 'slack-notifier'
34
-
35
- spec.add_development_dependency 'activerecord'
36
- spec.add_development_dependency 'bundler'
37
- spec.add_development_dependency 'database_cleaner'
38
- spec.add_development_dependency 'm'
39
- spec.add_development_dependency 'minitest'
40
- spec.add_development_dependency 'mocha'
41
- spec.add_development_dependency 'pry'
42
- spec.add_development_dependency 'rake'
43
- spec.add_development_dependency 'rubocop', '0.72.0'
44
- spec.add_development_dependency 'simplecov'
45
- spec.add_development_dependency 'sqlite3'
46
- end