services 7.3.3 → 8.0.0
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/Appraisals +6 -6
- data/README.md +1 -1
- data/gemfiles/{rails_4.2.gemfile → rails_5.2.gemfile} +1 -1
- data/gemfiles/{rails_5.0.gemfile → rails_6.0.gemfile} +1 -1
- data/gemfiles/{rails_5.1.gemfile → rails_6.1.gemfile} +1 -1
- data/lib/services/asyncable.rb +6 -7
- data/lib/services/base.rb +1 -1
- data/lib/services/modules/call_logger.rb +2 -2
- data/lib/services/modules/exception_wrapper.rb +1 -1
- data/lib/services/modules/uniqueness_checker.rb +1 -1
- data/lib/services/version.rb +1 -1
- data/spec/support/test_services.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 968f73b837027e7a1fd1d445b18073fec9e4fa449c5975086551c51c58dccf8b
|
4
|
+
data.tar.gz: 92f3ada6ce7a8617e8a50ddf4a5f11827722845dd952c244547f93e76853c283
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d8931cc9b545291cd231cdec1ede213e0838261d3fdcfe19dfd3f71b70c0f83dbf11798573ead47238041bb889e9943abed244cc78661febee80c5ddac9b2ed
|
7
|
+
data.tar.gz: 3438431663f57852b0167a85ad4dd9f895198f7854090b4d06e8844c2eba01089d3c0a743a4ff37adf8abe9b4cb02395d9bde6fb8bc17923f95a71b9d5007086
|
data/Appraisals
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
appraise '
|
2
|
-
gem 'rails', '~>
|
1
|
+
appraise 'rails_5.2' do
|
2
|
+
gem 'rails', '~> 5.2.0'
|
3
3
|
end
|
4
4
|
|
5
|
-
appraise '
|
6
|
-
gem 'rails', '~>
|
5
|
+
appraise 'rails_6.0' do
|
6
|
+
gem 'rails', '~> 6.0.0'
|
7
7
|
end
|
8
8
|
|
9
|
-
appraise '
|
10
|
-
gem 'rails', '~>
|
9
|
+
appraise 'rails_6.1' do
|
10
|
+
gem 'rails', '~> 6.1.0'
|
11
11
|
end
|
data/README.md
CHANGED
data/lib/services/asyncable.rb
CHANGED
@@ -46,10 +46,6 @@ module Services
|
|
46
46
|
GlobalID::Locator.locate(arg) || arg
|
47
47
|
end
|
48
48
|
|
49
|
-
# If the `call` method takes any kwargs and the last argument is a hash, symbolize the hash keys,
|
50
|
-
# otherwise they won't be recognized as kwards when splatted.
|
51
|
-
# Since the arguments to `perform` are serialized to the database before Sidekiq picks them up,
|
52
|
-
# symbol keys are converted to strings.
|
53
49
|
call_method = method(:call)
|
54
50
|
|
55
51
|
# Find the first class that inherits from `Services::Base`.
|
@@ -57,11 +53,14 @@ module Services
|
|
57
53
|
call_method = call_method.super_method
|
58
54
|
end
|
59
55
|
|
60
|
-
|
61
|
-
|
56
|
+
# If the `call` method takes any kwargs and the last argument is a hash, pass them to the method as kwargs.
|
57
|
+
kwargs = if call_method.parameters.map(&:first).grep(/\Akey/).any? && args.last.is_a?(Hash)
|
58
|
+
args.pop.symbolize_keys
|
59
|
+
else
|
60
|
+
{}
|
62
61
|
end
|
63
62
|
|
64
|
-
call *args
|
63
|
+
call *args, **kwargs
|
65
64
|
end
|
66
65
|
end
|
67
66
|
end
|
data/lib/services/base.rb
CHANGED
@@ -27,9 +27,9 @@ module Services
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
def call(*args)
|
30
|
+
def call(*args, **kwargs)
|
31
31
|
unless self.class.call_logging_disabled
|
32
|
-
log "START with args: #{args}", caller: caller
|
32
|
+
log "START with args: #{args}, kwargs: #{kwargs}", caller: caller
|
33
33
|
start = Time.now
|
34
34
|
end
|
35
35
|
begin
|
data/lib/services/version.rb
CHANGED
@@ -81,14 +81,14 @@ module Services
|
|
81
81
|
end
|
82
82
|
|
83
83
|
class EmptyService < Services::Base
|
84
|
-
def call(*args)
|
84
|
+
def call(*args, **kwargs)
|
85
85
|
end
|
86
86
|
end
|
87
87
|
|
88
88
|
class EmptyServiceWithoutCallLogging < Services::Base
|
89
89
|
disable_call_logging
|
90
90
|
|
91
|
-
def call(*args)
|
91
|
+
def call(*args, **kwargs)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Meurer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -193,9 +193,9 @@ files:
|
|
193
193
|
- LICENSE.txt
|
194
194
|
- README.md
|
195
195
|
- Rakefile
|
196
|
-
- gemfiles/
|
197
|
-
- gemfiles/
|
198
|
-
- gemfiles/
|
196
|
+
- gemfiles/rails_5.2.gemfile
|
197
|
+
- gemfiles/rails_6.0.gemfile
|
198
|
+
- gemfiles/rails_6.1.gemfile
|
199
199
|
- lib/services.rb
|
200
200
|
- lib/services/asyncable.rb
|
201
201
|
- lib/services/base.rb
|
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
246
|
- !ruby/object:Gem::Version
|
247
247
|
version: '0'
|
248
248
|
requirements: []
|
249
|
-
rubygems_version: 3.
|
249
|
+
rubygems_version: 3.2.11
|
250
250
|
signing_key:
|
251
251
|
specification_version: 4
|
252
252
|
summary: A nifty service layer for your Rails app
|