upfluence-utils 0.12.18 → 0.12.20
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/lib/upfluence/error_logger/sentry.rb +1 -1
- data/lib/upfluence/utils/env_helper.rb +20 -0
- data/lib/upfluence/utils/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c1153c2254907a24cfdf4158ecba796e11c64d33c16e1c768dc1d8bbbb373ffd
|
|
4
|
+
data.tar.gz: 18af6544045d8f1d8a9378be19e6e09daacc6ed5102b8a8a4af60af7516f1ff1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac346ac44165b16a01c5f3e0ffd4a32bc1c78337d50b033b422cf23dcd6b3662cade01d40b51ac242331cf629f94c8f8bc442cc79e6690d302160942beacd28c
|
|
7
|
+
data.tar.gz: 446c23bf81c04fead4cc60a6b70c8729372250654a59c3deedccc40e4c59c2c1c34ff181818a445a6115d4042d94231f48633ff5d4514f37979a63aedc3afa42
|
|
@@ -96,7 +96,7 @@ module Upfluence
|
|
|
96
96
|
::Sentry.with_scope do |scope|
|
|
97
97
|
context = args.reduce({}) do |acc, arg|
|
|
98
98
|
v = if arg.is_a?(Hash)
|
|
99
|
-
arg
|
|
99
|
+
arg.transform_keys(&:to_s).transform_values(&:inspect)
|
|
100
100
|
else
|
|
101
101
|
key = acc.empty? ? 'method' : "arg_#{acc.length}"
|
|
102
102
|
{ key => arg.inspect }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Upfluence
|
|
4
|
+
module Utils
|
|
5
|
+
module EnvHelper
|
|
6
|
+
TRUTHY_ENV_VALUES = %w[t true yes y 1 on].freeze
|
|
7
|
+
FALSY_ENV_VALUES = %w[f false no n 0 off].freeze
|
|
8
|
+
|
|
9
|
+
def self.env_to_bool(value, strict: false)
|
|
10
|
+
value = value.to_s
|
|
11
|
+
normalized = value.downcase
|
|
12
|
+
|
|
13
|
+
return false if FALSY_ENV_VALUES.include?(normalized)
|
|
14
|
+
return true if TRUTHY_ENV_VALUES.include?(normalized)
|
|
15
|
+
|
|
16
|
+
strict ? nil : !(value.nil? || value.empty?)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: upfluence-utils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.12.
|
|
4
|
+
version: 0.12.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Upfluence
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-06-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -312,6 +312,7 @@ files:
|
|
|
312
312
|
- lib/upfluence/resources/countries.rb
|
|
313
313
|
- lib/upfluence/thread.rb
|
|
314
314
|
- lib/upfluence/utils.rb
|
|
315
|
+
- lib/upfluence/utils/env_helper.rb
|
|
315
316
|
- lib/upfluence/utils/http/middleware/null.rb
|
|
316
317
|
- lib/upfluence/utils/interval_executor.rb
|
|
317
318
|
- lib/upfluence/utils/semaphore.rb
|