lavin 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/lavin/error.rb +4 -0
- data/lib/lavin/hook.rb +6 -4
- data/lib/lavin/step.rb +5 -1
- data/lib/lavin/success.rb +15 -0
- data/lib/lavin/user.rb +2 -0
- data/lib/lavin/version.rb +1 -1
- data/lib/lavin/worker.rb +2 -2
- data.tar.gz.sig +0 -0
- metadata +3 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b997f41b4113bbae1335913c59e6788e28b324128e26359b30877127d3423dcd
|
4
|
+
data.tar.gz: 3dafac5a638eab3e505422a0777e3debdfd8f52af0c51fabaf0b2259b9f62504
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 828a5a27fe2eb5efabd4f17253ce583865fb7177121a2128122261f7e1e816f13c37dc60eb1686c8885b95f9c228b5df301bbd952d23cab2f32df3f8fc1befde
|
7
|
+
data.tar.gz: f84b6e46eb8b66572de9053160a247df65958476f9ab00b933d02d1a12ffcd4f07b162c2f44bcce68174f67822947254bceecdf4d36e5440387e7043240ecc51
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/lavin/error.rb
CHANGED
data/lib/lavin/hook.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'lavin/error'
|
4
|
+
|
3
5
|
module Lavin
|
4
6
|
class Hook
|
5
7
|
attr_reader :user, :block, :type
|
@@ -19,11 +21,11 @@ module Lavin
|
|
19
21
|
report_statistics = context.client.report_statistics
|
20
22
|
context.client.report_statistics = false
|
21
23
|
context.instance_exec(&block)
|
22
|
-
rescue RecoverableError
|
24
|
+
rescue SuccessfulStep, RecoverableError
|
25
|
+
rescue SuccessfulUser, IrrecoverableError
|
26
|
+
throw :stop_user
|
23
27
|
rescue => error
|
24
|
-
puts "
|
25
|
-
puts error.backtrace unless error.is_a? IrrecoverableError
|
26
|
-
throw :failure
|
28
|
+
puts "Exception in #{user.name}.#{type} block - #{error.class}: #{error.message}"
|
27
29
|
ensure
|
28
30
|
context.client.report_statistics = report_statistics
|
29
31
|
end
|
data/lib/lavin/step.rb
CHANGED
@@ -23,10 +23,14 @@ module Lavin
|
|
23
23
|
def call(context:)
|
24
24
|
context.instance_exec(&block)
|
25
25
|
Statistics.register_step(user: user.name, step_name: name)
|
26
|
+
rescue SuccessfulStep, SuccessfulUser => error
|
27
|
+
Statistics.register_step(user: user.name, step_name: name)
|
28
|
+
throw :stop_user if error.is_a? SuccessfulUser
|
26
29
|
rescue IrrecoverableError => error
|
27
30
|
Statistics.register_step(user: user.name, step_name: name, failure: error.message)
|
28
|
-
throw :
|
31
|
+
throw :stop_user
|
29
32
|
rescue => error
|
33
|
+
puts "Exception in #{user.name}.#{name} - #{error.class}: #{error.message}"
|
30
34
|
Statistics.register_step(user: user.name, step_name: name, failure: error.message)
|
31
35
|
end
|
32
36
|
end
|
data/lib/lavin/user.rb
CHANGED
@@ -5,6 +5,7 @@ require "lavin/user_config"
|
|
5
5
|
require "lavin/worker"
|
6
6
|
require "lavin/http_client"
|
7
7
|
require "lavin/failure"
|
8
|
+
require "lavin/success"
|
8
9
|
|
9
10
|
module Lavin
|
10
11
|
class User
|
@@ -14,6 +15,7 @@ module Lavin
|
|
14
15
|
subclass.include Worker
|
15
16
|
subclass.include HttpClient
|
16
17
|
subclass.include Failure
|
18
|
+
subclass.include Success
|
17
19
|
all_personas << subclass
|
18
20
|
end
|
19
21
|
|
data/lib/lavin/version.rb
CHANGED
data/lib/lavin/worker.rb
CHANGED
@@ -40,13 +40,13 @@ module Lavin
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def run
|
43
|
-
catch(:
|
43
|
+
catch(:stop_user) do
|
44
44
|
self.class.before.run(context: self).then { Runner.yield } if self.class.before
|
45
45
|
|
46
46
|
run_step until finished?
|
47
47
|
end
|
48
48
|
|
49
|
-
catch(:
|
49
|
+
catch(:stop_user) do
|
50
50
|
self.class.after.run(context: self).then { Runner.yield } if self.class.after
|
51
51
|
end
|
52
52
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lavin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sammy Henningsson
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
DVzXaUnsmwP+jQ1PkDa5q8ibBzMd2c6Hmm87UDqPxZtML0bF9SjrpbyLMjwtXaMA
|
30
30
|
WDPp0ajpdUZ9GPHsrVNYXiOfQIqcmlmpYVsH1o7vuneUIcIDMrnMDChh
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2022-11-
|
32
|
+
date: 2022-11-04 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: async
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/lavin/statistics.rb
|
121
121
|
- lib/lavin/stats.rb
|
122
122
|
- lib/lavin/step.rb
|
123
|
+
- lib/lavin/success.rb
|
123
124
|
- lib/lavin/user.rb
|
124
125
|
- lib/lavin/user_config.rb
|
125
126
|
- lib/lavin/version.rb
|
metadata.gz.sig
CHANGED
Binary file
|