umbrellio-utils 0.5.1 → 0.5.2

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: 3d58375aae7fbe533515bb3437dd111f9b857fac6b6b1281ba707c262abcc406
4
- data.tar.gz: 8440dc7bf3bdb1fe7dc36d534055e586f7f1f9831beb37c8f50c10347f2b1862
3
+ metadata.gz: a50b129107cbc0b88c6ca792692965517f94d37d55585a4c872ac7ed33f96144
4
+ data.tar.gz: 5fb7a079b3510edd5ea05a93e9752eba6ce02aba59a7160f8bd06c1ea2344086
5
5
  SHA512:
6
- metadata.gz: c426a03b8f9f915c5d39581381ec96083cbf79c463fe15ff94d42c97b5c95feb92efee53329d46639b353398ad7616aa750e054ac0a9d309f7b0bcf7f6fc3fb3
7
- data.tar.gz: e9583b6c1d3fe2071ff3d18fc1e8cc0b51eb648575dddc02098df2134516d4edd73089435e32ef11b577b8860ea0e5ffe50efdce1754255b360a6357163842c2
6
+ metadata.gz: c3d0a08ffac0fac4c414bcdc695ec4b34730f7c1d6570cc8f73328885d3e950ef684c0a96911fd3838de5d4c008b56d96a702599f0b7e7f039bd65ee146a7e21
7
+ data.tar.gz: e066d6dc4d56ffc7842cc26e787431d053ba441b8c2ebeaa57d57533a4eb47416778860959fb65ace91d95d965d7782591964983d762c587b998666b856e752f
@@ -3,52 +3,60 @@ name: Test
3
3
  on: [push, pull_request]
4
4
 
5
5
  env:
6
- FULL_COVERAGE_CHECK: false # Sometimes, sometimes...
6
+ FULL_COVERAGE_CHECK: false # Someday, someday...
7
7
 
8
8
  jobs:
9
- full-check:
9
+ test:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  # We want to run on external PRs, but not on our own internal PRs as they'll be run on push event
13
13
  if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'umbrellio/utils'
14
14
 
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: ["2.7", "3.0", "3.1"]
19
+
20
+ services:
21
+ postgres:
22
+ image: postgres
23
+ env:
24
+ POSTGRES_USER: root
25
+ POSTGRES_HOST_AUTH_METHOD: trust
26
+ options: >-
27
+ --health-cmd pg_isready
28
+ --health-interval 10s
29
+ --health-timeout 5s
30
+ --health-retries 5
31
+ ports:
32
+ - 5432:5432
33
+ env:
34
+ PGHOST: localhost
35
+ PGUSER: root
36
+
15
37
  steps:
16
38
  - uses: actions/checkout@v2
39
+
17
40
  - uses: ruby/setup-ruby@v1
18
41
  with:
19
- ruby-version: "3.1"
42
+ ruby-version: ${{ matrix.ruby }}
20
43
  bundler-cache: true
44
+
45
+ - run: psql -c 'CREATE DATABASE umbrellio_utils_test'
46
+
21
47
  - name: Run Linter
22
48
  run: bundle exec ci-helper RubocopLint
49
+
23
50
  - name: Check missed spec suffixes
24
51
  run: bundle exec ci-helper CheckSpecSuffixes --extra-paths spec/*.rb --ignored-paths spec/*_helper.rb
52
+
25
53
  - name: Run specs
26
54
  run: bundle exec ci-helper RunSpecs
55
+
27
56
  - name: Audit
28
57
  run: bundle exec ci-helper BundlerAudit
58
+
29
59
  - name: Coveralls
30
60
  uses: coverallsapp/github-action@master
31
61
  with:
32
62
  github-token: ${{ secrets.GITHUB_TOKEN }}
33
- specs:
34
- runs-on: ubuntu-latest
35
-
36
- env:
37
- FULL_TEST_COVERAGE_CHECK: false
38
-
39
- # We want to run on external PRs, but not on our own internal PRs as they'll be run on push event
40
- if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'umbrellio/utils'
41
-
42
- strategy:
43
- fail-fast: false
44
- matrix:
45
- ruby: ["2.7", "3.0"]
46
-
47
- steps:
48
- - uses: actions/checkout@v2
49
- - uses: ruby/setup-ruby@v1
50
- with:
51
- ruby-version: ${{ matrix.ruby }}
52
- bundler-cache: true
53
- - name: Run specs
54
- run: bundle exec rspec
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /log/
data/.rubocop.yml CHANGED
@@ -21,3 +21,6 @@ Naming/RescuedExceptionsVariableName:
21
21
  Style/HashConversion:
22
22
  Exclude:
23
23
  - spec/**/*_spec.rb
24
+
25
+ Naming/VariableNumber:
26
+ CheckSymbols: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- umbrellio-utils (0.5.1)
4
+ umbrellio-utils (0.5.2)
5
5
  memery (~> 1)
6
6
 
7
7
  GEM
@@ -48,6 +48,7 @@ GEM
48
48
  parallel (1.22.1)
49
49
  parser (3.1.2.0)
50
50
  ast (~> 2.4.1)
51
+ pg (1.4.2)
51
52
  pry (0.14.1)
52
53
  coderay (~> 1.1)
53
54
  method_source (~> 1.0)
@@ -143,12 +144,14 @@ DEPENDENCIES
143
144
  ci-helper
144
145
  nokogiri
145
146
  nori
147
+ pg
146
148
  pry
147
149
  rake
148
150
  rspec
149
151
  rspec-json_matcher
150
152
  rubocop-config-umbrellio
151
153
  semantic_logger
154
+ sequel
152
155
  simplecov
153
156
  simplecov-lcov
154
157
  timecop
@@ -6,8 +6,6 @@ module UmbrellioUtils
6
6
 
7
7
  HandledConstaintError = Class.new(StandardError)
8
8
 
9
- DEFAULT_SLEEP_INTERVAL = defined?(Rails) && Rails.env.production? ? 1 : 0
10
-
11
9
  def handle_constraint_error(constraint_name, &block)
12
10
  DB.transaction(savepoint: true, &block)
13
11
  rescue Sequel::UniqueConstraintViolation => e
@@ -27,7 +25,7 @@ module UmbrellioUtils
27
25
  primary_key = primary_key_from(**options)
28
26
 
29
27
  with_temp_table(dataset, **options) do |ids|
30
- dataset.model.where(primary_key => ids).each(&block)
28
+ dataset.model.where(primary_key => ids).reverse(primary_key).each(&block)
31
29
  end
32
30
  end
33
31
 
@@ -51,7 +49,7 @@ module UmbrellioUtils
51
49
 
52
50
  break if pk_set.empty?
53
51
 
54
- sleep(sleep_interval) if sleep_interval.positive?
52
+ Kernel.sleep(sleep_interval) if sleep_interval.positive?
55
53
  clear_lamian_logs!
56
54
  end
57
55
  ensure
@@ -59,6 +57,7 @@ module UmbrellioUtils
59
57
  end
60
58
 
61
59
  def clear_lamian_logs!
60
+ return unless defined?(Lamian)
62
61
  Lamian.logger.send(:logdevs).each { |x| x.truncate(0) && x.rewind }
63
62
  end
64
63
 
@@ -91,7 +90,7 @@ module UmbrellioUtils
91
90
  when FalseClass
92
91
  0
93
92
  else
94
- DEFAULT_SLEEP_INTERVAL
93
+ defined?(Rails) && Rails.env.production? ? 1 : 0
95
94
  end
96
95
  end
97
96
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UmbrellioUtils
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
  end
data/log/.keep ADDED
File without changes
@@ -35,12 +35,14 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "ci-helper"
36
36
  spec.add_development_dependency "nokogiri"
37
37
  spec.add_development_dependency "nori"
38
+ spec.add_development_dependency "pg"
38
39
  spec.add_development_dependency "pry"
39
40
  spec.add_development_dependency "rake"
40
41
  spec.add_development_dependency "rspec"
41
42
  spec.add_development_dependency "rspec-json_matcher"
42
43
  spec.add_development_dependency "rubocop-config-umbrellio"
43
44
  spec.add_development_dependency "semantic_logger"
45
+ spec.add_development_dependency "sequel"
44
46
  spec.add_development_dependency "simplecov"
45
47
  spec.add_development_dependency "simplecov-lcov"
46
48
  spec.add_development_dependency "timecop"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umbrellio-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JustAnotherDude
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-29 00:00:00.000000000 Z
11
+ date: 2022-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: memery
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pg
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'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: pry
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -192,6 +206,20 @@ dependencies:
192
206
  - - ">="
193
207
  - !ruby/object:Gem::Version
194
208
  version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: sequel
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
195
223
  - !ruby/object:Gem::Dependency
196
224
  name: simplecov
197
225
  requirement: !ruby/object:Gem::Requirement
@@ -286,6 +314,7 @@ files:
286
314
  - lib/umbrellio_utils/store.rb
287
315
  - lib/umbrellio_utils/vault.rb
288
316
  - lib/umbrellio_utils/version.rb
317
+ - log/.keep
289
318
  - umbrellio_utils.gemspec
290
319
  homepage: https://github.com/umbrellio/utils
291
320
  licenses: