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: 4b4c6a8e472322b835e5b34b9546b5f3f790a5d91ccfa7875a44402c838e07e9
4
- data.tar.gz: 5ac531d3e1e97d42fc5426e6b9d4ff09f390bf069386ea8191b0c3723f4203ed
3
+ metadata.gz: 7d777a3659a501c17e784ff331b152e5dad518a57a19da6b9ba073051fa7b35e
4
+ data.tar.gz: 7c6d10faaadbe712b2fa3e1721fc311369697cf8a7f7c52005e72e9f29092fde
5
5
  SHA512:
6
- metadata.gz: 43bc51add64ffc69e8807322150a00f3ff3aff3983e1d06cb8a1c7500bd9c93b2a2d310864c25c1d6aba4b07938d1b0c66908be66993eaca67c64450692e2765
7
- data.tar.gz: dc3f4de0ebdbdf73c8cb9bfa34eb2384f216c828bd12d708bb72376bae32a8eb9a99f16a268eed0e979b5950430edd6a7986f7ae5a2496514ab7a3aac284c0bd
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(ctx, **args, &block)
7
- new(ctx, **args).execute(&block)
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
@@ -75,6 +75,8 @@ module OnStrum
75
75
  inputs_snapshot[OnStrum::Service::InstanceMethods::DEFAULT_CTX_KEY]
76
76
  end
77
77
 
78
+ def audit; end
79
+
78
80
  def args
79
81
  inputs.slice(*inputs.keys - [OnStrum::Service::InstanceMethods::DEFAULT_CTX_KEY])
80
82
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OnStrum
4
4
  module Service
5
- VERSION = '1.0.1'
5
+ VERSION = '1.1.0'
6
6
  end
7
7
  end
@@ -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.prepend(OnStrum::Service::InstanceMethods)
10
- end
9
+ base.include(OnStrum::Service::InstanceMethods)
11
10
 
12
- def audit; end
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.1
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-03 00:00:00.000000000 Z
11
+ date: 2025-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake