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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87f3143772cbfb27b9714d3d92542d07fb949e3ee99213f8e6674e70e3aed4a2
4
- data.tar.gz: 0f5443f6e200c0421c9c176610c7068d7dde55b9d23799ed6713411c04c83088
3
+ metadata.gz: 38e4a0f496e63ba78279cf3f1f1b671e838eb1509f4c59f4ee9694c831d64c13
4
+ data.tar.gz: 8019b013bcef53aa1e9be21818dcb0ab21095d4f1db539b6c891967dc22afabd
5
5
  SHA512:
6
- metadata.gz: 2c6adacbe7c8e00c5dc5891a65d86644cdc583805966f3792528aa802540f8e9c81333a3d72cbe8d55383a05799e33a804881ed6554d9d3e695e9c2192fc725c
7
- data.tar.gz: 2f672d7d41608a9b6f19fa8368c1774f82e7f98075df042efcc15a502f60fd4498eac4b02190615aeba01dcd8e3ad930d38799ec2741ae250382b37d46d153b9
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.beta1)
4
+ light-services (2.0.0.rc2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- activemodel (6.0.3.2)
10
- activesupport (= 6.0.3.2)
11
- activerecord (6.0.3.2)
12
- activemodel (= 6.0.3.2)
13
- activesupport (= 6.0.3.2)
14
- activesupport (6.0.3.2)
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 (>= 0.7, < 2)
17
- minitest (~> 5.1)
18
- tzinfo (~> 1.1)
19
- zeitwerk (~> 2.2, >= 2.2.2)
20
- ast (2.4.1)
21
- codecov (0.1.17)
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
- url
25
- concurrent-ruby (1.1.6)
26
- database_cleaner (1.8.5)
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.8.0)
30
- diff-lcs (1.4.2)
31
- docile (1.3.2)
32
- i18n (1.8.3)
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.3.0)
35
- minitest (5.14.1)
36
- parallel (1.19.2)
37
- parser (2.7.1.4)
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.1)
41
- regexp_parser (1.7.1)
42
- rexml (3.2.4)
43
- rspec (3.9.0)
44
- rspec-core (~> 3.9.0)
45
- rspec-expectations (~> 3.9.0)
46
- rspec-mocks (~> 3.9.0)
47
- rspec-core (3.9.2)
48
- rspec-support (~> 3.9.3)
49
- rspec-expectations (3.9.2)
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.9.0)
52
- rspec-mocks (3.9.1)
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.9.0)
55
- rspec-support (3.9.3)
56
- rubocop (0.86.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.0.1)
57
+ parser (>= 2.7.1.5)
59
58
  rainbow (>= 2.2.2, < 4.0)
60
- regexp_parser (>= 1.7)
59
+ regexp_parser (>= 1.8)
61
60
  rexml
62
- rubocop-ast (>= 0.0.3, < 1.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 (0.0.3)
66
- parser (>= 2.7.0.1)
67
- rubocop-performance (1.6.1)
68
- rubocop (>= 0.71.0)
69
- rubocop-rspec (1.40.0)
70
- rubocop (>= 0.68.1)
71
- ruby-progressbar (1.10.1)
72
- simplecov (0.18.5)
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
- simplecov-html (0.12.2)
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
- thread_safe (0.3.6)
78
- tzinfo (1.2.7)
79
- thread_safe (~> 0.1)
80
+ tzinfo (2.0.4)
81
+ concurrent-ruby (~> 1.0)
80
82
  unicode-display_width (1.7.0)
81
- url (0.3.2)
82
- zeitwerk (2.3.1)
83
+ zeitwerk (2.4.2)
83
84
 
84
85
  PLATFORMS
85
86
  ruby
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Light
4
4
  module Services
5
- VERSION = "2.0.0.rc2"
5
+ VERSION = "2.0.0.rc3"
6
6
  end
7
7
  end
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.rc2
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-15 00:00:00.000000000 Z
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: