umbrellio-utils 0.6.0 → 0.6.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: ec19f3835e4ffb14ac0640e7ebca549343e2f91f190fc06d5fd7419f549dbe11
4
- data.tar.gz: fc6cb1c5b66662b087e6c8febb8c0727bb3f96dabf1ca668f2e850081d6261d2
3
+ metadata.gz: 3f9bf2d2029e95f5036e94891e9eb7880ccd3008a6276841edaa1eb4dc4a8c4d
4
+ data.tar.gz: 9e2b59f9badb3358751916847aef57345c6108dceb24001f559a6449593aaed8
5
5
  SHA512:
6
- metadata.gz: f4088a39103d9ba5a6e1cf7490049f4cb7194df22aca62fe47d56dc69f5822b2eecc148527b40e7f36e23749fb50be150941fb051eb1ba2cfc92d54376f05306
7
- data.tar.gz: 6f339403d5d06d7b71ae547f21ddb1a3d776e04852a38d53867092215c3742b92dc5beac1ae587de978025a22d01d5c91b6eb4086d940b13203f02f422fc6fa0
6
+ metadata.gz: 97bf35d68402b7ff28fbdd0f2b6ee6eae0e5267185640ca42639562fc3d1eb9dfe7874e0b8c969c989381476d76d8b0052f1b674ee5d367afedcc434ddf4e925
7
+ data.tar.gz: 47c973bda46d8a7f518a57be0a6f90e6177a2cb11037cc1af3aac487dd1cf03b75e4ec535560ddfdf8985824bbb6102d16c2aac7f3c69b06ee9d89949d71924d
@@ -15,7 +15,7 @@ jobs:
15
15
  strategy:
16
16
  fail-fast: false
17
17
  matrix:
18
- ruby: ["2.7", "3.0", "3.1"]
18
+ ruby: ["2.7", "3.0", "3.1", "3.2"]
19
19
 
20
20
  services:
21
21
  postgres:
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- umbrellio-utils (0.6.0)
4
+ umbrellio-utils (0.6.2)
5
5
  memery (~> 1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (7.0.3.1)
10
+ activesupport (7.0.4.2)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 1.6, < 2)
13
13
  minitest (>= 5.1)
@@ -23,95 +23,95 @@ GEM
23
23
  umbrellio-sequel-plugins (~> 0.4)
24
24
  coderay (1.1.3)
25
25
  colorize (0.8.1)
26
- concurrent-ruby (1.1.10)
26
+ concurrent-ruby (1.2.0)
27
27
  diff-lcs (1.5.0)
28
28
  docile (1.4.0)
29
29
  dry-inflector (0.3.0)
30
30
  i18n (1.12.0)
31
31
  concurrent-ruby (~> 1.0)
32
- json (2.6.2)
32
+ json (2.6.3)
33
33
  memery (1.4.1)
34
34
  ruby2_keywords (~> 0.0.2)
35
35
  method_source (1.0.0)
36
- mini_portile2 (2.8.0)
37
- minitest (5.16.3)
38
- nokogiri (1.13.8)
36
+ mini_portile2 (2.8.1)
37
+ minitest (5.17.0)
38
+ nokogiri (1.14.1)
39
39
  mini_portile2 (~> 2.8.0)
40
40
  racc (~> 1.4)
41
- nokogiri (1.13.8-arm64-darwin)
41
+ nokogiri (1.14.1-arm64-darwin)
42
42
  racc (~> 1.4)
43
- nokogiri (1.13.8-x86_64-darwin)
43
+ nokogiri (1.14.1-x86_64-darwin)
44
44
  racc (~> 1.4)
45
- nokogiri (1.13.8-x86_64-linux)
45
+ nokogiri (1.14.1-x86_64-linux)
46
46
  racc (~> 1.4)
47
47
  nori (2.6.0)
48
48
  parallel (1.22.1)
49
- parser (3.1.2.1)
49
+ parser (3.2.1.0)
50
50
  ast (~> 2.4.1)
51
- pg (1.4.3)
52
- pry (0.14.1)
51
+ pg (1.4.5)
52
+ pry (0.14.2)
53
53
  coderay (~> 1.1)
54
54
  method_source (~> 1.0)
55
- racc (1.6.0)
56
- rack (2.2.4)
55
+ racc (1.6.2)
56
+ rack (3.0.4.1)
57
57
  rainbow (3.1.1)
58
58
  rake (13.0.6)
59
- regexp_parser (2.5.0)
59
+ regexp_parser (2.7.0)
60
60
  rexml (3.2.5)
61
- rspec (3.11.0)
62
- rspec-core (~> 3.11.0)
63
- rspec-expectations (~> 3.11.0)
64
- rspec-mocks (~> 3.11.0)
65
- rspec-core (3.11.0)
66
- rspec-support (~> 3.11.0)
67
- rspec-expectations (3.11.0)
61
+ rspec (3.12.0)
62
+ rspec-core (~> 3.12.0)
63
+ rspec-expectations (~> 3.12.0)
64
+ rspec-mocks (~> 3.12.0)
65
+ rspec-core (3.12.1)
66
+ rspec-support (~> 3.12.0)
67
+ rspec-expectations (3.12.2)
68
68
  diff-lcs (>= 1.2.0, < 2.0)
69
- rspec-support (~> 3.11.0)
69
+ rspec-support (~> 3.12.0)
70
70
  rspec-json_matcher (0.2.0)
71
71
  amazing_print
72
72
  json
73
- rspec-mocks (3.11.1)
73
+ rspec-mocks (3.12.3)
74
74
  diff-lcs (>= 1.2.0, < 2.0)
75
- rspec-support (~> 3.11.0)
76
- rspec-support (3.11.0)
77
- rubocop (1.35.0)
75
+ rspec-support (~> 3.12.0)
76
+ rspec-support (3.12.0)
77
+ rubocop (1.43.0)
78
78
  json (~> 2.3)
79
79
  parallel (~> 1.10)
80
- parser (>= 3.1.2.1)
80
+ parser (>= 3.2.0.0)
81
81
  rainbow (>= 2.2.2, < 4.0)
82
82
  regexp_parser (>= 1.8, < 3.0)
83
83
  rexml (>= 3.2.5, < 4.0)
84
- rubocop-ast (>= 1.20.1, < 2.0)
84
+ rubocop-ast (>= 1.24.1, < 2.0)
85
85
  ruby-progressbar (~> 1.7)
86
- unicode-display_width (>= 1.4.0, < 3.0)
87
- rubocop-ast (1.21.0)
86
+ unicode-display_width (>= 2.4.0, < 3.0)
87
+ rubocop-ast (1.24.1)
88
88
  parser (>= 3.1.1.0)
89
- rubocop-config-umbrellio (1.35.0.69)
90
- rubocop (~> 1.35.0)
91
- rubocop-performance (~> 1.14.0)
92
- rubocop-rails (~> 2.15.0)
89
+ rubocop-config-umbrellio (1.43.0.81)
90
+ rubocop (~> 1.43.0)
91
+ rubocop-performance (~> 1.15.0)
92
+ rubocop-rails (~> 2.17.0)
93
93
  rubocop-rake (~> 0.6.0)
94
- rubocop-rspec (~> 2.12.0)
94
+ rubocop-rspec (~> 2.16.0)
95
95
  rubocop-sequel (~> 0.3.3)
96
- rubocop-performance (1.14.3)
96
+ rubocop-performance (1.15.2)
97
97
  rubocop (>= 1.7.0, < 2.0)
98
98
  rubocop-ast (>= 0.4.0)
99
- rubocop-rails (2.15.2)
99
+ rubocop-rails (2.17.4)
100
100
  activesupport (>= 4.2.0)
101
101
  rack (>= 1.1)
102
- rubocop (>= 1.7.0, < 2.0)
102
+ rubocop (>= 1.33.0, < 2.0)
103
103
  rubocop-rake (0.6.0)
104
104
  rubocop (~> 1.0)
105
- rubocop-rspec (2.12.1)
106
- rubocop (~> 1.31)
105
+ rubocop-rspec (2.16.0)
106
+ rubocop (~> 1.33)
107
107
  rubocop-sequel (0.3.4)
108
108
  rubocop (~> 1.0)
109
109
  ruby-progressbar (1.11.0)
110
110
  ruby2_keywords (0.0.5)
111
- semantic_logger (4.11.0)
111
+ semantic_logger (4.12.0)
112
112
  concurrent-ruby (~> 1.0)
113
- sequel (5.59.0)
114
- simplecov (0.21.2)
113
+ sequel (5.65.0)
114
+ simplecov (0.22.0)
115
115
  docile (~> 1.1)
116
116
  simplecov-html (~> 0.11)
117
117
  simplecov_json_formatter (~> 0.1)
@@ -120,13 +120,13 @@ GEM
120
120
  simplecov_json_formatter (0.1.4)
121
121
  symbiont-ruby (0.7.0)
122
122
  thor (1.2.1)
123
- timecop (0.9.5)
124
- tzinfo (2.0.5)
123
+ timecop (0.9.6)
124
+ tzinfo (2.0.6)
125
125
  concurrent-ruby (~> 1.0)
126
- umbrellio-sequel-plugins (0.9.0.76)
126
+ umbrellio-sequel-plugins (0.11.0.143)
127
127
  sequel
128
128
  symbiont-ruby
129
- unicode-display_width (2.2.0)
129
+ unicode-display_width (2.4.2)
130
130
  webrick (1.7.0)
131
131
  yard (0.9.28)
132
132
  webrick (~> 1.7.0)
@@ -160,4 +160,4 @@ DEPENDENCIES
160
160
  yard
161
161
 
162
162
  BUNDLED WITH
163
- 2.3.20
163
+ 2.4.5
@@ -6,7 +6,7 @@ module UmbrellioUtils
6
6
 
7
7
  VOWELS_REGEX = /[AEIOUY]/.freeze
8
8
  CONSONANTS_REGEX = /[BCDFGHJKLMNPQRSTVXZW]/.freeze
9
- EMAIL_REGEXP = /\A([\w+\-].?)+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i.freeze
9
+ EMAIL_REGEXP = /\A([\w+-].?)+@[a-z\d-]+(\.[a-z]+)*\.[a-z]+\z/i.freeze
10
10
 
11
11
  def secure_compare(src, dest)
12
12
  ActiveSupport::SecurityUtils.secure_compare(
@@ -64,7 +64,7 @@ module UmbrellioUtils
64
64
  def create_temp_table(dataset, primary_key:)
65
65
  model = dataset.model
66
66
  time = Time.current
67
- temp_table_name = "temp_#{model.table_name}_#{time.to_i}#{time.nsec}".to_sym
67
+ temp_table_name = "temp_#{model.table_name}_#{time.to_i}_#{time.nsec}".to_sym
68
68
  type = model.db_schema[primary_key][:db_type]
69
69
 
70
70
  DB.drop_table?(temp_table_name)
@@ -73,7 +73,8 @@ module UmbrellioUtils
73
73
  end
74
74
 
75
75
  insert_ds = dataset.select(Sequel[model.table_name][primary_key])
76
- DB[temp_table_name].insert(insert_ds)
76
+ DB[temp_table_name].disable_insert_returning.insert(insert_ds)
77
+
77
78
  temp_table_name
78
79
  end
79
80
 
@@ -70,18 +70,30 @@ module UmbrellioUtils
70
70
  log.level.upcase,
71
71
  log.name,
72
72
  thread_fingerprint_for(log),
73
- log.message,
73
+ log_to_message(log),
74
74
  log.tags,
75
75
  log.named_tags,
76
76
  log.time.utc.iso8601(9),
77
77
  ]
78
78
  end
79
79
 
80
- # Calculates MD5 fingerprint for the thread, in which the log was made.
80
+ # Calculates MD5 fingerprint for the thread in which the log was made.
81
81
  # @return [String] truncated `MD5` hash.
82
82
  def thread_fingerprint_for(log)
83
83
  Digest::MD5.hexdigest("#{log.thread_name}#{Process.pid}")[0...8]
84
84
  end
85
+
86
+ # Renders either exception or message of the log.
87
+ # @return [String]
88
+ def log_to_message(log)
89
+ if (e = log.exception)
90
+ msg = +"#{e.message} (#{e.class})"
91
+ msg << "\n#{e.backtrace.join("\n")}" if e.backtrace
92
+ msg
93
+ else
94
+ log.message
95
+ end
96
+ end
85
97
  end
86
98
  end
87
99
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UmbrellioUtils
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.2"
5
5
  end
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.6.0
4
+ version: 0.6.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-08-23 00:00:00.000000000 Z
11
+ date: 2023-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: memery
@@ -338,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  - !ruby/object:Gem::Version
339
339
  version: '0'
340
340
  requirements: []
341
- rubygems_version: 3.3.20
341
+ rubygems_version: 3.4.6
342
342
  signing_key:
343
343
  specification_version: 4
344
344
  summary: A set of utilities that speed up development