convenient_service 0.18.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -3
- data/lib/convenient_service/commands/is_service.rb +28 -0
- data/lib/convenient_service/commands/is_service_class.rb +30 -0
- data/lib/convenient_service/commands.rb +4 -0
- data/lib/convenient_service/common/plugins.rb +2 -3
- data/lib/convenient_service/core/concern/class_methods.rb +3 -0
- data/lib/convenient_service/core/entities/config/entities/concerns/entities/stack.rb +22 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/container/concern/instance_methods.rb +1 -1
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middleware_creators/observable/entities/event.rb +13 -15
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands/normalize_env.rb +55 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/commands.rb +1 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/chain/concern/instance_methods.rb +3 -3
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/classic.rb +14 -0
- data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/stack.rb +22 -0
- data/lib/convenient_service/dependencies/built_in.rb +0 -7
- data/lib/convenient_service/dependencies/extractions/ds.rb +45 -0
- data/lib/convenient_service/dependencies/only_queries.rb +29 -0
- data/lib/convenient_service/dependencies/queries/gems/active_model.rb +38 -0
- data/lib/convenient_service/dependencies/queries/gems/logger.rb +39 -0
- data/lib/convenient_service/dependencies/queries/gems/paint.rb +39 -0
- data/lib/convenient_service/dependencies/queries/gems/rspec.rb +60 -0
- data/lib/convenient_service/dependencies/queries/ruby.rb +103 -0
- data/lib/convenient_service/dependencies/queries/version/null_version.rb +87 -0
- data/lib/convenient_service/dependencies/queries/version.rb +87 -0
- data/lib/convenient_service/dependencies/queries.rb +536 -0
- data/lib/convenient_service/dependencies.rb +2 -438
- data/lib/convenient_service/feature/configs/standard.rb +0 -2
- data/lib/convenient_service/service/configs/amazing_print_inspect/aliases.rb +7 -0
- data/lib/convenient_service/service/configs/amazing_print_inspect.rb +61 -0
- data/lib/convenient_service/service/configs/awesome_print_inspect.rb +1 -1
- data/lib/convenient_service/service/configs/{minimal.rb → essential.rb} +2 -107
- data/lib/convenient_service/service/configs/standard/v1.rb +5 -10
- data/lib/convenient_service/service/configs/standard.rb +19 -31
- data/lib/convenient_service/service/configs.rb +1 -1
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/and.rb +4 -1
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/expressions/empty.rb +4 -4
- data/lib/convenient_service/service/plugins/can_have_connected_steps/entities/step_collection.rb +7 -0
- data/lib/convenient_service/service/plugins/can_have_fallbacks/concern.rb +18 -0
- data/lib/convenient_service/service/plugins/can_have_fallbacks/exceptions.rb +22 -4
- data/lib/convenient_service/service/plugins/can_have_fallbacks/middleware.rb +3 -3
- data/lib/convenient_service/service/plugins/can_have_rollbacks/middleware.rb +66 -0
- data/lib/convenient_service/service/plugins/can_have_rollbacks.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_sequential_steps/entities/step_collection.rb +7 -0
- data/lib/convenient_service/service/plugins/can_have_steps/commands/is_step.rb +34 -0
- data/lib/convenient_service/service/plugins/can_have_steps/commands.rb +1 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb +22 -14
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_method_step/can_be_executed/middleware.rb +1 -15
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/exceptions.rb +53 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/middleware.rb +60 -15
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks.rb +1 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_awesome_print_inspect/concern.rb +3 -2
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/has_result/middleware.rb +26 -1
- data/lib/convenient_service/service/plugins/can_have_steps.rb +41 -0
- data/lib/convenient_service/service/plugins/can_have_stubbed_results/commands/fetch_all_services_stubbed_results_cache.rb +2 -2
- data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/exceptions.rb +53 -0
- data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments/middleware.rb +108 -0
- data/lib/convenient_service/service/plugins/forbids_convenient_service_entities_as_constructor_arguments.rb +4 -0
- data/lib/convenient_service/service/plugins/has_amazing_print_inspect/concern.rb +39 -0
- data/lib/convenient_service/service/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_from_exception/concern.rb +32 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_be_from_exception.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/can_have_step/concern.rb +7 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect/concern.rb +41 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_awesome_print_inspect/concern.rb +2 -2
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/concern/instance_methods.rb +0 -140
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/message/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_amazing_print_inspect/concern.rb +46 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/plugins/has_amazing_print_inspect.rb +3 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/concern/instance_methods.rb +161 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/concern.rb +27 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects/exceptions.rb +34 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/helps_to_learn_similarities_with_common_objects.rb +4 -0
- data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins.rb +2 -0
- data/lib/convenient_service/service/plugins/has_mermaid_flowchart/concern.rb +6 -1
- data/lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/middleware.rb +1 -0
- data/lib/convenient_service/service/plugins.rb +3 -1
- data/lib/convenient_service/support/counter.rb +2 -0
- data/lib/convenient_service/support/middleware/stack_builder.rb +37 -0
- data/lib/convenient_service/support/thread_safe_counter.rb +1 -0
- data/lib/convenient_service/support.rb +0 -3
- data/lib/convenient_service/utils/object/get_own_method.rb +54 -0
- data/lib/convenient_service/utils/object/safe_send.rb +84 -0
- data/lib/convenient_service/utils/object.rb +24 -0
- data/lib/convenient_service/utils/string/enclose.rb +52 -0
- data/lib/convenient_service/utils/string.rb +5 -0
- data/lib/convenient_service/version.rb +1 -1
- data/lib/convenient_service.rb +62 -0
- metadata +149 -16
- data/lib/convenient_service/common/plugins/normalizes_env/middleware.rb +0 -31
- data/lib/convenient_service/common/plugins/normalizes_env.rb +0 -3
- data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_have_fallbacks/result.rb +0 -3
- data/lib/convenient_service/services.rb +0 -4
- data/lib/convenient_service/support/gems/active_model.rb +0 -36
- data/lib/convenient_service/support/gems/logger.rb +0 -37
- data/lib/convenient_service/support/gems/paint.rb +0 -37
- data/lib/convenient_service/support/gems/rspec.rb +0 -58
- data/lib/convenient_service/support/ruby.rb +0 -53
- data/lib/convenient_service/support/version/null_version.rb +0 -85
- data/lib/convenient_service/support/version.rb +0 -75
- /data/lib/convenient_service/{support → dependencies/queries}/gems.rb +0 -0
@@ -1,85 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ConvenientService
|
4
|
-
module Support
|
5
|
-
class Version
|
6
|
-
##
|
7
|
-
# @api private
|
8
|
-
#
|
9
|
-
# @internal
|
10
|
-
# - https://thoughtbot.com/blog/rails-refactoring-example-introduce-null-object
|
11
|
-
# - https://avdi.codes/null-objects-and-falsiness/
|
12
|
-
#
|
13
|
-
class NullVersion
|
14
|
-
##
|
15
|
-
# @return [Boolean]
|
16
|
-
#
|
17
|
-
def null_version?
|
18
|
-
true
|
19
|
-
end
|
20
|
-
|
21
|
-
##
|
22
|
-
# @return [nil]
|
23
|
-
#
|
24
|
-
def gem_version
|
25
|
-
nil
|
26
|
-
end
|
27
|
-
|
28
|
-
##
|
29
|
-
# @param other [Object] Can be any type.
|
30
|
-
# @return [nil]
|
31
|
-
#
|
32
|
-
def <=>(other)
|
33
|
-
nil
|
34
|
-
end
|
35
|
-
|
36
|
-
##
|
37
|
-
# @param other [Object] Can be any type.
|
38
|
-
# @return [nil]
|
39
|
-
#
|
40
|
-
def <(other)
|
41
|
-
nil
|
42
|
-
end
|
43
|
-
|
44
|
-
##
|
45
|
-
# @param other [Object] Can be any type.
|
46
|
-
# @return [nil]
|
47
|
-
#
|
48
|
-
def <=(other)
|
49
|
-
nil
|
50
|
-
end
|
51
|
-
|
52
|
-
##
|
53
|
-
# @param other [Object] Can be any type.
|
54
|
-
# @return [nil]
|
55
|
-
#
|
56
|
-
def ==(other)
|
57
|
-
nil
|
58
|
-
end
|
59
|
-
|
60
|
-
##
|
61
|
-
# @param other [Object] Can be any type.
|
62
|
-
# @return [nil]
|
63
|
-
#
|
64
|
-
def >(other)
|
65
|
-
nil
|
66
|
-
end
|
67
|
-
|
68
|
-
##
|
69
|
-
# @param other [Object] Can be any type.
|
70
|
-
# @return [nil]
|
71
|
-
#
|
72
|
-
def >=(other)
|
73
|
-
nil
|
74
|
-
end
|
75
|
-
|
76
|
-
##
|
77
|
-
# @return [String]
|
78
|
-
#
|
79
|
-
def to_s
|
80
|
-
""
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "version/null_version"
|
4
|
-
|
5
|
-
module ConvenientService
|
6
|
-
module Support
|
7
|
-
class Version
|
8
|
-
include ::Comparable
|
9
|
-
|
10
|
-
undef_method :between?
|
11
|
-
|
12
|
-
undef_method :clamp
|
13
|
-
|
14
|
-
##
|
15
|
-
# @param value [String]
|
16
|
-
# @return [void]
|
17
|
-
#
|
18
|
-
def initialize(value)
|
19
|
-
@value = value
|
20
|
-
end
|
21
|
-
|
22
|
-
class << self
|
23
|
-
##
|
24
|
-
# @return [ConvenientService::Support::Version::NullVersion]
|
25
|
-
#
|
26
|
-
def null_version
|
27
|
-
@null_version ||= Support::Version::NullVersion.new
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
##
|
32
|
-
# @return [Boolean]
|
33
|
-
#
|
34
|
-
def null_version?
|
35
|
-
false
|
36
|
-
end
|
37
|
-
|
38
|
-
##
|
39
|
-
# @return [Gem::Version, nil]
|
40
|
-
#
|
41
|
-
def gem_version
|
42
|
-
cast_gem_version(value)
|
43
|
-
end
|
44
|
-
|
45
|
-
##
|
46
|
-
# @param other [Object] Can be any type.
|
47
|
-
# @return [Boolean, nil]
|
48
|
-
#
|
49
|
-
def <=>(other)
|
50
|
-
gem_version <=> cast_gem_version(other)
|
51
|
-
end
|
52
|
-
|
53
|
-
##
|
54
|
-
# @return [String]
|
55
|
-
#
|
56
|
-
def to_s
|
57
|
-
gem_version.to_s
|
58
|
-
end
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
|
-
##
|
63
|
-
# @return [String]
|
64
|
-
#
|
65
|
-
attr_reader :value
|
66
|
-
|
67
|
-
##
|
68
|
-
# @return [Gem::Version, nil]
|
69
|
-
#
|
70
|
-
def cast_gem_version(value)
|
71
|
-
::Gem::Version.create(value.to_s) if ::Gem::Version.correct?(value.to_s)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
File without changes
|