servactory 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/locales/en.yml +1 -2
- data/config/locales/ru.yml +1 -2
- data/lib/servactory/actions/tools/runner.rb +0 -35
- data/lib/servactory/result.rb +6 -4
- data/lib/servactory/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: d6c205eaf58dfc9f10040d0b5a60324ee63ed72dfc1643df149646232ce73c46
|
4
|
+
data.tar.gz: b88daadf5ed2d8645eca11d1d4ea9bdd86175b52a3297f57f232b068239a070b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f08e497b7044ab6c6ec5c53d2e87538ef7666cea055cdd3fac5d86c8ff699367ca606b508eebc25c022e9f8ad9c44d70a9bd5ce8d4d0b48634c5268aea88f29
|
7
|
+
data.tar.gz: 5b3bdb880e5251115e21ddf47f66350cd1f1f86ae434080190d04277c8d60d8e9c0d3628c5f84c91d4a31f4c7a3df3266d5f35bfe88fadc842a4c9596d9e4554
|
data/config/locales/en.yml
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
en:
|
2
2
|
servactory:
|
3
3
|
common:
|
4
|
-
undefined_local_variable_or_method: "[%{service_class_name}] Undefined local variable or method `%{method_name}`"
|
5
4
|
undefined_method:
|
6
|
-
missing_name: "[%{service_class_name}]
|
5
|
+
missing_name: "[%{service_class_name}] %{error_text}"
|
7
6
|
methods:
|
8
7
|
call:
|
9
8
|
not_used: "[%{service_class_name}] Nothing to perform. Use `make` or create a `call` method."
|
data/config/locales/ru.yml
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
ru:
|
2
2
|
servactory:
|
3
3
|
common:
|
4
|
-
undefined_local_variable_or_method: "[%{service_class_name}] Неопределенная локальная переменная или метод `%{method_name}`"
|
5
4
|
undefined_method:
|
6
|
-
missing_name: "[%{service_class_name}]
|
5
|
+
missing_name: "[%{service_class_name}] %{error_text}"
|
7
6
|
methods:
|
8
7
|
call:
|
9
8
|
not_used: "[%{service_class_name}] Нечего выполнять. Используйте `make` или создайте метод `call`."
|
@@ -57,10 +57,6 @@ module Servactory
|
|
57
57
|
|
58
58
|
def call_method(method)
|
59
59
|
@context.send(method.name)
|
60
|
-
rescue NoMethodError => e
|
61
|
-
rescue_no_method_error_with(exception: e)
|
62
|
-
rescue NameError
|
63
|
-
rescue_name_error_with(method: method)
|
64
60
|
end
|
65
61
|
|
66
62
|
def unnecessary_for_stage?(stage)
|
@@ -87,37 +83,6 @@ module Servactory
|
|
87
83
|
|
88
84
|
!condition.call(context: @context)
|
89
85
|
end
|
90
|
-
|
91
|
-
########################################################################
|
92
|
-
|
93
|
-
def rescue_no_method_error_with(exception:) # rubocop:disable Metrics/MethodLength
|
94
|
-
raise @context.class.config.failure_class.new(
|
95
|
-
type: :base,
|
96
|
-
message: I18n.t(
|
97
|
-
"servactory.common.undefined_method.missing_name",
|
98
|
-
service_class_name: @context.class.name,
|
99
|
-
method_name: exception.name,
|
100
|
-
missing_name: if exception.missing_name.nil?
|
101
|
-
exception.missing_name.inspect
|
102
|
-
elsif exception.missing_name == "NilClass"
|
103
|
-
nil.inspect
|
104
|
-
else
|
105
|
-
exception.missing_name
|
106
|
-
end
|
107
|
-
)
|
108
|
-
)
|
109
|
-
end
|
110
|
-
|
111
|
-
def rescue_name_error_with(method:)
|
112
|
-
raise @context.class.config.failure_class.new(
|
113
|
-
type: :base,
|
114
|
-
message: I18n.t(
|
115
|
-
"servactory.common.undefined_local_variable_or_method",
|
116
|
-
service_class_name: @context.class.name,
|
117
|
-
method_name: method.name
|
118
|
-
)
|
119
|
-
)
|
120
|
-
end
|
121
86
|
end
|
122
87
|
end
|
123
88
|
end
|
data/lib/servactory/result.rb
CHANGED
@@ -93,7 +93,7 @@ module Servactory
|
|
93
93
|
|
94
94
|
########################################################################
|
95
95
|
|
96
|
-
def rescue_no_method_error_with(exception:)
|
96
|
+
def rescue_no_method_error_with(exception:) # rubocop:disable Metrics/MethodLength
|
97
97
|
raise exception if @context.blank?
|
98
98
|
|
99
99
|
raise @context.class.config.failure_class.new(
|
@@ -101,9 +101,11 @@ module Servactory
|
|
101
101
|
message: I18n.t(
|
102
102
|
"servactory.common.undefined_method.missing_name",
|
103
103
|
service_class_name: @context.class.name,
|
104
|
-
|
105
|
-
|
106
|
-
|
104
|
+
error_text: exception.message
|
105
|
+
),
|
106
|
+
meta: {
|
107
|
+
original_exception: exception
|
108
|
+
}
|
107
109
|
)
|
108
110
|
end
|
109
111
|
end
|
data/lib/servactory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Sokolov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|