on_strum-service 1.0.1 → 1.1.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d777a3659a501c17e784ff331b152e5dad518a57a19da6b9ba073051fa7b35e
|
4
|
+
data.tar.gz: 7c6d10faaadbe712b2fa3e1721fc311369697cf8a7f7c52005e72e9f29092fde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 137d0b95b48b72a11e00882ccd42cd73e6ba977a255f35af6484631b5904c7bd325b1dcaa566c8d516bc5be660c21d2212f5ed8927983a5a20e47ba5f7c8962f
|
7
|
+
data.tar.gz: 78f4c9f1c777e2aecf531640be2665dea8645bff9dfe3599420708d551b05c3d194ffdc356617d9599236d6cea13996c40ae0358765ce623cedb770b2174ce10
|
@@ -3,8 +3,11 @@
|
|
3
3
|
module OnStrum
|
4
4
|
module Service
|
5
5
|
module ClassMethods
|
6
|
-
def call(
|
7
|
-
|
6
|
+
def call(*args, **kwargs, &block)
|
7
|
+
# For Ruby 2.7: call({key: 'value'}) -> args=[], kwargs={key: 'value'}
|
8
|
+
# For Ruby 3.0: call({key: 'value'}) -> args=[{key: 'value'}], kwargs={}
|
9
|
+
ctx = ::RUBY_VERSION < '3.0' && args.empty? ? kwargs : args.first
|
10
|
+
new(ctx || {}, **kwargs).execute(&block)
|
8
11
|
end
|
9
12
|
end
|
10
13
|
end
|
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
module OnStrum
|
4
4
|
module Service
|
5
|
+
WARNING = <<~MESSAGE
|
6
|
+
📢 Note: You have both Strum::Service and OnStrum::Service installed.
|
7
|
+
You can safely migrate your services by replacing:
|
8
|
+
include Strum::Service
|
9
|
+
with:
|
10
|
+
include OnStrum::Service
|
11
|
+
|
12
|
+
All public APIs and behavior are fully compatible!
|
13
|
+
MESSAGE
|
14
|
+
|
5
15
|
module Error
|
6
16
|
require_relative 'error/runtime'
|
7
17
|
end
|
data/lib/on_strum/service.rb
CHANGED
@@ -6,10 +6,10 @@ module OnStrum
|
|
6
6
|
module Service
|
7
7
|
def self.included(base)
|
8
8
|
base.extend(OnStrum::Service::ClassMethods)
|
9
|
-
base.
|
10
|
-
end
|
9
|
+
base.include(OnStrum::Service::InstanceMethods)
|
11
10
|
|
12
|
-
|
11
|
+
::Kernel.warn(OnStrum::Service::WARNING) if defined?(Strum::Service)
|
12
|
+
end
|
13
13
|
|
14
14
|
def call
|
15
15
|
raise OnStrum::Service::Error::Runtime, OnStrum::Service::Error::Runtime::NOT_IMPLEMENTED
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: on_strum-service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Serhiy Nazarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|