light-services 2.0 → 2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/Gemfile +3 -2
- data/Gemfile.lock +12 -7
- data/README.md +1 -1
- data/lib/light/services/base.rb +9 -3
- data/lib/light/services/collection/arguments.rb +1 -1
- data/lib/light/services/settings/argument.rb +1 -1
- data/lib/light/services/version.rb +1 -1
- data/light-services.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e777268364638a43bc06d7daab56a5cd8a70e302f782df56e657de079c370f9
|
4
|
+
data.tar.gz: 7b04287f111ded9b9ead0ae46b5c6696fa8f32c8e4c39c6658e6538008c25b51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d88dd74e63c77525cb7d3771133a6afab9303bce64039255ef74d8a8e6104469e90a315e6fa6f917562d8d6f615a65f7d75e51ecfeac278968e373cd6b84f0ec
|
7
|
+
data.tar.gz: 2e05b2f401f9e7a93a95081e91cc160c923cab2bff2f2f7a3193c114edea26bc8cc624d9fb4d5af27faa1fab474bc3994f9d71bf4884de78ceda16293255fc50
|
data/.rubocop.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require:
|
2
|
+
- rubocop-rake
|
2
3
|
- rubocop-rspec
|
3
4
|
- rubocop-performance
|
4
5
|
|
@@ -19,6 +20,9 @@ Security/Eval:
|
|
19
20
|
Style/Documentation:
|
20
21
|
Enabled: false
|
21
22
|
|
23
|
+
Style/ClassVars:
|
24
|
+
Enabled: false
|
25
|
+
|
22
26
|
Style/StringLiterals:
|
23
27
|
EnforcedStyle: double_quotes
|
24
28
|
|
data/Gemfile
CHANGED
@@ -14,7 +14,8 @@ group :test do
|
|
14
14
|
gem "rspec", "~> 3.13"
|
15
15
|
gem "simplecov", "~> 0.21"
|
16
16
|
|
17
|
-
gem "rubocop", "~> 1.
|
18
|
-
gem "rubocop-rspec", "~> 2.29", require: false
|
17
|
+
gem "rubocop", "~> 1.64", require: false
|
19
18
|
gem "rubocop-performance", "~> 1.21", require: false
|
19
|
+
gem "rubocop-rake", "~> 0.6.0", require: false
|
20
|
+
gem "rubocop-rspec", "~> 2.30", require: false
|
20
21
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
light-services (2.
|
4
|
+
light-services (2.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -50,8 +50,9 @@ GEM
|
|
50
50
|
racc (1.7.3)
|
51
51
|
rainbow (3.1.1)
|
52
52
|
rake (13.2.1)
|
53
|
-
regexp_parser (2.9.
|
54
|
-
rexml (3.2.
|
53
|
+
regexp_parser (2.9.2)
|
54
|
+
rexml (3.2.8)
|
55
|
+
strscan (>= 3.0.9)
|
55
56
|
rspec (3.13.0)
|
56
57
|
rspec-core (~> 3.13.0)
|
57
58
|
rspec-expectations (~> 3.13.0)
|
@@ -65,7 +66,7 @@ GEM
|
|
65
66
|
diff-lcs (>= 1.2.0, < 2.0)
|
66
67
|
rspec-support (~> 3.13.0)
|
67
68
|
rspec-support (3.13.1)
|
68
|
-
rubocop (1.
|
69
|
+
rubocop (1.64.1)
|
69
70
|
json (~> 2.3)
|
70
71
|
language_server-protocol (>= 3.17.0)
|
71
72
|
parallel (~> 1.10)
|
@@ -85,7 +86,9 @@ GEM
|
|
85
86
|
rubocop-performance (1.21.0)
|
86
87
|
rubocop (>= 1.48.1, < 2.0)
|
87
88
|
rubocop-ast (>= 1.31.1, < 2.0)
|
88
|
-
rubocop-
|
89
|
+
rubocop-rake (0.6.0)
|
90
|
+
rubocop (~> 1.0)
|
91
|
+
rubocop-rspec (2.30.0)
|
89
92
|
rubocop (~> 1.40)
|
90
93
|
rubocop-capybara (~> 2.17)
|
91
94
|
rubocop-factory_bot (~> 2.22)
|
@@ -101,6 +104,7 @@ GEM
|
|
101
104
|
simplecov_json_formatter (0.1.4)
|
102
105
|
sqlite3 (1.7.3)
|
103
106
|
mini_portile2 (~> 2.8.0)
|
107
|
+
strscan (3.1.0)
|
104
108
|
timeout (0.4.1)
|
105
109
|
tzinfo (2.0.6)
|
106
110
|
concurrent-ruby (~> 1.0)
|
@@ -116,9 +120,10 @@ DEPENDENCIES
|
|
116
120
|
light-services!
|
117
121
|
rake (~> 13.2)
|
118
122
|
rspec (~> 3.13)
|
119
|
-
rubocop (~> 1.
|
123
|
+
rubocop (~> 1.64)
|
120
124
|
rubocop-performance (~> 1.21)
|
121
|
-
rubocop-
|
125
|
+
rubocop-rake (~> 0.6.0)
|
126
|
+
rubocop-rspec (~> 2.30)
|
122
127
|
simplecov (~> 0.21)
|
123
128
|
sqlite3 (~> 1.7)
|
124
129
|
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# 🚀 Light Services
|
2
2
|
|
3
|
-
|
3
|
+
A streamlined Service Object implementation for Ruby and Rails, tested in multiple SaaS applications with hundreds of service objects. This gem offers a reliable framework for organizing business logic effectively.
|
4
4
|
|
5
5
|
## 👀 Table of Contents
|
6
6
|
1. [Simple Example](#simple-example)
|
data/lib/light/services/base.rb
CHANGED
@@ -36,7 +36,7 @@ module Light
|
|
36
36
|
attr_reader :outputs, :arguments, :errors, :warnings
|
37
37
|
|
38
38
|
def initialize(args = {}, config = {}, parent_service = nil)
|
39
|
-
@config = Light::Services.config.merge(config)
|
39
|
+
@config = Light::Services.config.merge(self.class.class_config || {}).merge(config)
|
40
40
|
@parent_service = parent_service
|
41
41
|
|
42
42
|
@outputs = Collection::Outputs.new(self)
|
@@ -95,12 +95,18 @@ module Light
|
|
95
95
|
end
|
96
96
|
|
97
97
|
class << self
|
98
|
+
attr_accessor :class_config
|
99
|
+
|
100
|
+
def config(config = {})
|
101
|
+
self.class_config = config
|
102
|
+
end
|
103
|
+
|
98
104
|
def run(args = {}, config = {})
|
99
105
|
new(args, config).tap(&:call)
|
100
106
|
end
|
101
107
|
|
102
|
-
def run!(args = {})
|
103
|
-
run(args, raise_on_error: true)
|
108
|
+
def run!(args = {}, config = {})
|
109
|
+
run(args, config.merge(raise_on_error: true))
|
104
110
|
end
|
105
111
|
|
106
112
|
def with(service_or_config = {}, config = {})
|
data/light-services.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = "Streamlined Service Object Implementation for Ruby and Rails"
|
13
13
|
spec.homepage = "https://github.com/light-ruby/light-services"
|
14
14
|
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
16
16
|
|
17
17
|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
18
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: light-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '2.
|
4
|
+
version: '2.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kodkod
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Streamlined Service Object Implementation for Ruby and Rails
|
14
14
|
email:
|
@@ -66,7 +66,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 2.
|
69
|
+
version: 2.7.0
|
70
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - ">="
|