stack-service-base 0.0.72 → 0.0.74
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 679a0bd930fa1400a380ea5631805ccdbab5ff079652acf5a9a506b561d1878a
|
|
4
|
+
data.tar.gz: 9b35e48681c7180c2771e36ed2913645404bd7ba0a82f752ad5a34e5151da7fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 29414e3d8df2788f01595758c0429a14400347bf3d94a0b08910093027009414b9b9dd5a2e31fe70b015afbcc27ea627c7b8b3cdebf6f1847283471c39c6944d
|
|
7
|
+
data.tar.gz: 05a90cc00ae3b2da0c86453d1083cf32d91f0f12fe5b607ee93d4b718f931c43e3610e5753d8e1b3bcb28c12c10328a4d5ab77af909985aeeeb15e3c4e5df159
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
class Sequel::Dataset
|
|
2
|
+
def self.===(obj) = obj.is_a?(DProxy) || super
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
class DProxy
|
|
6
|
+
def initialize(dataset, model, path = [], &block)
|
|
7
|
+
@model, @dataset, @final, @path = model, dataset, block, path
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def indent(str) = puts "\t" * @path.size + str
|
|
11
|
+
def method_missing(name, *args, **kwargs, &block)
|
|
12
|
+
all_args = [*args, **kwargs, block:].reject(&:nil?)
|
|
13
|
+
# indent "DProxy::#{@model} #{name}(#{all_args}) => IN" unless QUIET
|
|
14
|
+
|
|
15
|
+
response = if @final && name.to_sym == :all
|
|
16
|
+
@final.call self, *all_args
|
|
17
|
+
else
|
|
18
|
+
@dataset.send(name, *args, **kwargs, &block)
|
|
19
|
+
end
|
|
20
|
+
# indent "DProxy::#{@model} #{name}(#{all_args}) OUT => #{response.inspect}" unless QUIET
|
|
21
|
+
wrap?(response) ? self.class.new(response, @model, @path + [name => all_args, prev: self], &@final) : response
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def wrap?(r) = r.is_a?(Sequel::Dataset::PlaceholderLiteralizer) || r.is_a?(Sequel::Dataset)
|
|
25
|
+
|
|
26
|
+
def respond_to_missing?(method_name, include_private = false)
|
|
27
|
+
@dataset.respond_to?(method_name, include_private)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
alias_method :_clone, :clone
|
|
31
|
+
|
|
32
|
+
def clone( *args, **kwargs, &block)
|
|
33
|
+
method_missing(:clone, *args, **kwargs, &block)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
|
|
@@ -30,7 +30,7 @@ end
|
|
|
30
30
|
|
|
31
31
|
if defined? Async and OTEL_ENABLED
|
|
32
32
|
module AsyncTaskOTELPatch
|
|
33
|
-
def initialize(parent = Task.current?, finished: nil, **options, &block)
|
|
33
|
+
def initialize(reactor, parent = Async::Task.current?, logger: nil, finished: nil, **options, &block)
|
|
34
34
|
ctx_ = OpenTelemetry::Context.current
|
|
35
35
|
|
|
36
36
|
block_otl = ->(t, *arguments){
|
|
@@ -38,7 +38,7 @@ if defined? Async and OTEL_ENABLED
|
|
|
38
38
|
block.call t, *arguments
|
|
39
39
|
end
|
|
40
40
|
}
|
|
41
|
-
super parent, finished: , **options, &block_otl
|
|
41
|
+
super reactor, parent, logger: , finished: , **options, &block_otl
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stack-service-base
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.74
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Artyom B
|
|
@@ -412,6 +412,7 @@ files:
|
|
|
412
412
|
- lib/stack-service-base/command_init.rb
|
|
413
413
|
- lib/stack-service-base/command_line.rb
|
|
414
414
|
- lib/stack-service-base/database.rb
|
|
415
|
+
- lib/stack-service-base/db_ext/db_proxy.rb
|
|
415
416
|
- lib/stack-service-base/db_ext/geo_ext.rb
|
|
416
417
|
- lib/stack-service-base/debugger.rb
|
|
417
418
|
- lib/stack-service-base/examples/mcp_config.ru
|