light-services 2.0.0.rc2 → 2.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +58 -57
- data/lib/light/services/base.rb +9 -0
- data/lib/light/services/collection/base.rb +8 -0
- data/lib/light/services/settings/step.rb +6 -0
- data/lib/light/services/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38e4a0f496e63ba78279cf3f1f1b671e838eb1509f4c59f4ee9694c831d64c13
|
4
|
+
data.tar.gz: 8019b013bcef53aa1e9be21818dcb0ab21095d4f1db539b6c891967dc22afabd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7f9f99835b0151b1f98016ad4af7767b17e49c3d65a1e991fe8522055a17f58301c183706bc30e2cebc40bd94990d21da70f66f01b17e104b2ed08c56a8a27e
|
7
|
+
data.tar.gz: e2d2b02ca50631518a02329d4b439f253e59ce648cdb4e37448b7a43209a6d2379272c083516862e0dbe38e8999e6419f2d9ece538f0d8a4a15e73e292211dba
|
data/Gemfile.lock
CHANGED
@@ -1,85 +1,86 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
light-services (2.0.0.
|
4
|
+
light-services (2.0.0.rc2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
activemodel (6.
|
10
|
-
activesupport (= 6.
|
11
|
-
activerecord (6.
|
12
|
-
activemodel (= 6.
|
13
|
-
activesupport (= 6.
|
14
|
-
activesupport (6.
|
9
|
+
activemodel (6.1.4)
|
10
|
+
activesupport (= 6.1.4)
|
11
|
+
activerecord (6.1.4)
|
12
|
+
activemodel (= 6.1.4)
|
13
|
+
activesupport (= 6.1.4)
|
14
|
+
activesupport (6.1.4)
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
|
-
i18n (>=
|
17
|
-
minitest (
|
18
|
-
tzinfo (~>
|
19
|
-
zeitwerk (~> 2.
|
20
|
-
ast (2.4.
|
21
|
-
codecov (0.1.
|
16
|
+
i18n (>= 1.6, < 2)
|
17
|
+
minitest (>= 5.1)
|
18
|
+
tzinfo (~> 2.0)
|
19
|
+
zeitwerk (~> 2.3)
|
20
|
+
ast (2.4.2)
|
21
|
+
codecov (0.1.21)
|
22
22
|
json
|
23
23
|
simplecov
|
24
|
-
|
25
|
-
|
26
|
-
database_cleaner (1.
|
27
|
-
database_cleaner-active_record (1.8.0)
|
24
|
+
concurrent-ruby (1.1.9)
|
25
|
+
database_cleaner (1.99.0)
|
26
|
+
database_cleaner-active_record (1.99.0)
|
28
27
|
activerecord
|
29
|
-
database_cleaner (~> 1.
|
30
|
-
diff-lcs (1.4.
|
31
|
-
docile (1.
|
32
|
-
i18n (1.8.
|
28
|
+
database_cleaner (~> 1.99.0)
|
29
|
+
diff-lcs (1.4.4)
|
30
|
+
docile (1.4.0)
|
31
|
+
i18n (1.8.10)
|
33
32
|
concurrent-ruby (~> 1.0)
|
34
|
-
json (2.
|
35
|
-
minitest (5.14.
|
36
|
-
parallel (1.
|
37
|
-
parser (
|
33
|
+
json (2.5.1)
|
34
|
+
minitest (5.14.4)
|
35
|
+
parallel (1.20.1)
|
36
|
+
parser (3.0.2.0)
|
38
37
|
ast (~> 2.4.1)
|
39
38
|
rainbow (3.0.0)
|
40
|
-
rake (13.0.
|
41
|
-
regexp_parser (1.
|
42
|
-
rexml (3.2.
|
43
|
-
rspec (3.
|
44
|
-
rspec-core (~> 3.
|
45
|
-
rspec-expectations (~> 3.
|
46
|
-
rspec-mocks (~> 3.
|
47
|
-
rspec-core (3.
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-expectations (3.
|
39
|
+
rake (13.0.6)
|
40
|
+
regexp_parser (2.1.1)
|
41
|
+
rexml (3.2.5)
|
42
|
+
rspec (3.10.0)
|
43
|
+
rspec-core (~> 3.10.0)
|
44
|
+
rspec-expectations (~> 3.10.0)
|
45
|
+
rspec-mocks (~> 3.10.0)
|
46
|
+
rspec-core (3.10.1)
|
47
|
+
rspec-support (~> 3.10.0)
|
48
|
+
rspec-expectations (3.10.1)
|
50
49
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-mocks (3.
|
50
|
+
rspec-support (~> 3.10.0)
|
51
|
+
rspec-mocks (3.10.2)
|
53
52
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
-
rspec-support (~> 3.
|
55
|
-
rspec-support (3.
|
56
|
-
rubocop (0.
|
53
|
+
rspec-support (~> 3.10.0)
|
54
|
+
rspec-support (3.10.2)
|
55
|
+
rubocop (0.93.1)
|
57
56
|
parallel (~> 1.10)
|
58
|
-
parser (>= 2.7.
|
57
|
+
parser (>= 2.7.1.5)
|
59
58
|
rainbow (>= 2.2.2, < 4.0)
|
60
|
-
regexp_parser (>= 1.
|
59
|
+
regexp_parser (>= 1.8)
|
61
60
|
rexml
|
62
|
-
rubocop-ast (>= 0.
|
61
|
+
rubocop-ast (>= 0.6.0)
|
63
62
|
ruby-progressbar (~> 1.7)
|
64
63
|
unicode-display_width (>= 1.4.0, < 2.0)
|
65
|
-
rubocop-ast (
|
66
|
-
parser (>=
|
67
|
-
rubocop-performance (1.
|
68
|
-
rubocop (>= 0.
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
64
|
+
rubocop-ast (1.8.0)
|
65
|
+
parser (>= 3.0.1.1)
|
66
|
+
rubocop-performance (1.10.2)
|
67
|
+
rubocop (>= 0.90.0, < 2.0)
|
68
|
+
rubocop-ast (>= 0.4.0)
|
69
|
+
rubocop-rspec (1.44.1)
|
70
|
+
rubocop (~> 0.87)
|
71
|
+
rubocop-ast (>= 0.7.1)
|
72
|
+
ruby-progressbar (1.11.0)
|
73
|
+
simplecov (0.21.2)
|
73
74
|
docile (~> 1.1)
|
74
75
|
simplecov-html (~> 0.11)
|
75
|
-
|
76
|
+
simplecov_json_formatter (~> 0.1)
|
77
|
+
simplecov-html (0.12.3)
|
78
|
+
simplecov_json_formatter (0.1.3)
|
76
79
|
sqlite3 (1.4.2)
|
77
|
-
|
78
|
-
|
79
|
-
thread_safe (~> 0.1)
|
80
|
+
tzinfo (2.0.4)
|
81
|
+
concurrent-ruby (~> 1.0)
|
80
82
|
unicode-display_width (1.7.0)
|
81
|
-
|
82
|
-
zeitwerk (2.3.1)
|
83
|
+
zeitwerk (2.4.2)
|
83
84
|
|
84
85
|
PLATFORMS
|
85
86
|
ruby
|
data/lib/light/services/base.rb
CHANGED
@@ -45,6 +45,7 @@ module Light
|
|
45
45
|
@outputs = Collection::Outputs.new(self)
|
46
46
|
@arguments = Collection::Arguments.new(self, args)
|
47
47
|
|
48
|
+
@done = false
|
48
49
|
@launched_steps = []
|
49
50
|
|
50
51
|
initialize_errors
|
@@ -67,6 +68,14 @@ module Light
|
|
67
68
|
@warnings.any?
|
68
69
|
end
|
69
70
|
|
71
|
+
def done!
|
72
|
+
@done = true
|
73
|
+
end
|
74
|
+
|
75
|
+
def done?
|
76
|
+
@done
|
77
|
+
end
|
78
|
+
|
70
79
|
def call
|
71
80
|
time = Benchmark.ms do
|
72
81
|
run_steps
|
@@ -28,6 +28,14 @@ module Light
|
|
28
28
|
@storage[key]
|
29
29
|
end
|
30
30
|
|
31
|
+
def [](key)
|
32
|
+
get(key)
|
33
|
+
end
|
34
|
+
|
35
|
+
def []=(key, value)
|
36
|
+
set(key, value)
|
37
|
+
end
|
38
|
+
|
31
39
|
def load_defaults
|
32
40
|
settings_collection.each do |name, settings|
|
33
41
|
next if !settings.default_exists || key?(name)
|
@@ -20,6 +20,10 @@ module Light
|
|
20
20
|
raise Light::Services::TwoConditions, "#{service_class} `if` and `unless` cannot be specified " \
|
21
21
|
"for the step `#{name}` at the same time"
|
22
22
|
end
|
23
|
+
|
24
|
+
if @always && (@if || @unless)
|
25
|
+
raise Light::Services::Error, "#{service_class} `always` cannot be combined with `if` and `unless`"
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
def run(instance, benchmark: false)
|
@@ -45,6 +49,8 @@ module Light
|
|
45
49
|
private
|
46
50
|
|
47
51
|
def run?(instance)
|
52
|
+
return false if instance.done?
|
53
|
+
|
48
54
|
if @if
|
49
55
|
check_condition(@if, instance)
|
50
56
|
elsif @unless
|
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.0.0.
|
4
|
+
version: 2.0.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Emelianenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Powerful implementation of Service Object pattern for Ruby and Rails
|
14
14
|
email:
|