convenient_service 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/.github/contributing.md +15 -0
  3. data/.github/workflows/cd.yml +5 -4
  4. data/.github/workflows/ci.yml +5 -5
  5. data/.gitignore +10 -1
  6. data/.ruby-version +1 -1
  7. data/.tool-versions +1 -1
  8. data/.yardopts +1 -1
  9. data/CHANGELOG.md +37 -0
  10. data/COMM-LICENSE.txt +99 -0
  11. data/LICENSE.txt +7 -19
  12. data/README.md +1 -1
  13. data/ROADMAP.md +14 -7
  14. data/convenient_service.gemspec +24 -5
  15. data/docs/.gitkeep +0 -0
  16. data/docs/api/.gitkeep +0 -0
  17. data/lib/convenient_service/common/plugins/can_have_user_provided_entity/commands/find_or_create_entity.rb +7 -2
  18. data/lib/convenient_service/common/plugins/can_have_user_provided_entity/exceptions.rb +4 -4
  19. data/lib/convenient_service/common/plugins/has_around_callbacks/exceptions.rb +2 -2
  20. data/lib/convenient_service/common/plugins/has_around_callbacks/middleware.rb +2 -2
  21. data/lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class.rb +83 -0
  22. data/lib/convenient_service/common/plugins/has_instance_proxy/commands.rb +3 -0
  23. data/lib/convenient_service/common/plugins/has_instance_proxy/concern.rb +22 -0
  24. data/lib/convenient_service/common/plugins/has_instance_proxy/entities/instance_proxy.rb +76 -0
  25. data/lib/convenient_service/common/plugins/has_instance_proxy/entities.rb +3 -0
  26. data/lib/convenient_service/common/plugins/has_instance_proxy/middleware.rb +20 -0
  27. data/lib/convenient_service/common/plugins/has_instance_proxy.rb +6 -0
  28. data/lib/convenient_service/common/plugins.rb +1 -0
  29. data/lib/convenient_service/core/concern/class_methods.rb +7 -2
  30. data/lib/convenient_service/core/concern/instance_methods.rb +7 -2
  31. data/lib/convenient_service/core/entities/config/commands/track_method_missing_commit_trigger.rb +1 -1
  32. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/caller/commands/define_method_middlewares_caller.rb +2 -2
  33. data/lib/convenient_service/core/entities/config/entities/method_middlewares/entities/middlewares/base/commands/create_observable_middleware.rb +3 -0
  34. data/lib/convenient_service/core/entities/config/exceptions.rb +4 -4
  35. data/lib/convenient_service/core/entities/config.rb +1 -1
  36. data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner/backtrace_cleaner.rb +28 -8
  37. data/lib/convenient_service/dependencies/extractions/active_support_backtrace_cleaner.rb +3 -3
  38. data/lib/convenient_service/dependencies/extractions/b.rb +2 -0
  39. data/lib/convenient_service/dependencies/extractions/ce.rb +16 -0
  40. data/lib/convenient_service/dependencies/extractions.rb +1 -0
  41. data/lib/convenient_service/dependencies.rb +6 -1
  42. data/lib/convenient_service/examples/dry/gemfile.rb +3 -1
  43. data/lib/convenient_service/examples/dry/v1/gemfile.rb +3 -1
  44. data/lib/convenient_service/examples/rails/gemfile.rb +3 -1
  45. data/lib/convenient_service/examples/rails/v1/gemfile.rb +3 -1
  46. data/lib/convenient_service/examples/standard/cowsay.rb +3 -1
  47. data/lib/convenient_service/examples/standard/date_time.rb +3 -1
  48. data/lib/convenient_service/examples/standard/factorial.rb +3 -1
  49. data/lib/convenient_service/examples/standard/gemfile.rb +3 -1
  50. data/lib/convenient_service/examples/standard/request_params.rb +3 -2
  51. data/lib/convenient_service/examples/standard/v1/request_params.rb +0 -1
  52. data/lib/convenient_service/exception.rb +98 -10
  53. data/lib/convenient_service/feature/configs/standard.rb +8 -0
  54. data/lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb +49 -0
  55. data/lib/convenient_service/feature/plugins/can_have_entries/commands/define_entry.rb +29 -3
  56. data/lib/convenient_service/feature/plugins/can_have_entries/commands.rb +1 -0
  57. data/lib/convenient_service/feature/plugins/can_have_entries/concern.rb +14 -5
  58. data/lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb +45 -0
  59. data/lib/convenient_service/feature/plugins/can_have_entries.rb +1 -0
  60. data/lib/convenient_service/logger.rb +4 -1
  61. data/lib/convenient_service/rspec/helpers/classes/stub_service/entities/result_spec.rb +0 -8
  62. data/lib/convenient_service/rspec/helpers/classes/wrap_method/entities/wrapped_method.rb +5 -5
  63. data/lib/convenient_service/rspec/helpers/classes/wrap_method/exceptions.rb +2 -2
  64. data/lib/convenient_service/rspec/matchers/classes/results/base/entities/validator/commands/validate_result_step.rb +1 -1
  65. data/lib/convenient_service/rspec/matchers/classes/results/base/exceptions.rb +2 -2
  66. data/lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception/exceptions.rb +2 -2
  67. data/lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb +1 -1
  68. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings/sub_matchers/arguments/commands/apply_stub_to_track_delegations.rb +4 -0
  69. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings_collection/exceptions.rb +7 -7
  70. data/lib/convenient_service/rspec/primitive_matchers/classes/delegate_to/entities/matcher/entities/chainings_collection.rb +3 -3
  71. data/lib/convenient_service/service/plugins/can_have_fallbacks/concern.rb +2 -2
  72. data/lib/convenient_service/service/plugins/can_have_fallbacks/exceptions.rb +4 -4
  73. data/lib/convenient_service/service/plugins/can_have_fallbacks/middleware.rb +1 -1
  74. data/lib/convenient_service/service/plugins/can_have_steps/concern.rb +3 -3
  75. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/commands/define_method_in_container.rb +2 -2
  76. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/concern/instance_methods.rb +1 -1
  77. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/alias.rb +2 -2
  78. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/proc.rb +1 -1
  79. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/raw.rb +1 -1
  80. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/reassignment.rb +2 -2
  81. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/callers/usual.rb +2 -2
  82. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/input.rb +2 -2
  83. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/entities/directions/output.rb +1 -1
  84. data/lib/convenient_service/service/plugins/can_have_steps/entities/method/exceptions.rb +26 -26
  85. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/concern/instance_methods.rb +1 -1
  86. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/exceptions.rb +2 -2
  87. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/exceptions.rb +2 -2
  88. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/can_be_result_step/can_be_executed/middleware.rb +1 -1
  89. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value/exceptions.rb +2 -2
  90. data/lib/convenient_service/service/plugins/can_have_steps/entities/step/plugins/raises_on_not_result_return_value/middleware.rb +1 -1
  91. data/lib/convenient_service/service/plugins/has_inspect/concern.rb +0 -1
  92. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/concern/instance_methods.rb +7 -0
  93. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/code/concern/instance_methods.rb +24 -0
  94. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/data/concern/instance_methods.rb +1 -1
  95. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/entities/status/concern/instance_methods.rb +14 -0
  96. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/has_j_send_status_and_attributes/exceptions.rb +2 -2
  97. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/exceptions.rb +2 -2
  98. data/lib/convenient_service/service/plugins/has_j_send_result/entities/result/plugins/raises_on_not_checked_result_status/middleware.rb +1 -1
  99. data/lib/convenient_service/service/plugins/has_j_send_result/exceptions.rb +2 -2
  100. data/lib/convenient_service/service/plugins/has_j_send_result.rb +39 -0
  101. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/exceptions.rb +6 -6
  102. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/error/middleware.rb +3 -3
  103. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/exceptions.rb +6 -6
  104. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/failure/middleware.rb +3 -3
  105. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/commands/refute_kwargs_contain_j_send_and_extra_keys.rb +1 -1
  106. data/lib/convenient_service/service/plugins/has_j_send_result_short_syntax/success/exceptions.rb +2 -2
  107. data/lib/convenient_service/service/plugins/has_j_send_result_status_check_short_syntax/concern.rb +0 -8
  108. data/lib/convenient_service/service/plugins/has_result/concern.rb +1 -1
  109. data/lib/convenient_service/service/plugins/has_result/exceptions.rb +2 -2
  110. data/lib/convenient_service/service/plugins/raises_on_double_result/exceptions.rb +2 -2
  111. data/lib/convenient_service/service/plugins/raises_on_double_result/middleware.rb +1 -1
  112. data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/exceptions.rb +2 -2
  113. data/lib/convenient_service/service/plugins/raises_on_not_result_return_value/middleware.rb +1 -1
  114. data/lib/convenient_service/support/abstract_method/exceptions.rb +2 -2
  115. data/lib/convenient_service/support/abstract_method.rb +1 -1
  116. data/lib/convenient_service/support/backtrace_cleaner.rb +123 -0
  117. data/lib/convenient_service/support/cache/exceptions.rb +2 -2
  118. data/lib/convenient_service/support/cache.rb +1 -1
  119. data/lib/convenient_service/support/castable/exceptions.rb +4 -4
  120. data/lib/convenient_service/support/castable.rb +1 -1
  121. data/lib/convenient_service/support/command.rb +3 -3
  122. data/lib/convenient_service/support/counter.rb +6 -6
  123. data/lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb +1 -1
  124. data/lib/convenient_service/support/dependency_container/commands/assert_valid_method.rb +1 -1
  125. data/lib/convenient_service/support/dependency_container/commands/assert_valid_scope.rb +1 -1
  126. data/lib/convenient_service/support/dependency_container/exceptions.rb +8 -8
  127. data/lib/convenient_service/support/dependency_container/export.rb +1 -1
  128. data/lib/convenient_service/support/finite_loop.rb +6 -6
  129. data/lib/convenient_service/support.rb +1 -0
  130. data/lib/convenient_service/utils/array/exceptions.rb +2 -2
  131. data/lib/convenient_service/utils/array/merge.rb +1 -1
  132. data/lib/convenient_service/utils/hash/assert_valid_keys.rb +1 -1
  133. data/lib/convenient_service/version.rb +1 -1
  134. data/lib/convenient_service.rb +98 -0
  135. metadata +28 -42
  136. data/lib/convenient_service/examples/standard/v1/gemfile/services/print_shell_command.rb +0 -47
@@ -9,14 +9,14 @@ module ConvenientService
9
9
  # @param scope [Object]
10
10
  # @return [void]
11
11
  #
12
- def initialize(scope:)
12
+ def initialize_with_kwargs(scope:)
13
13
  message = <<~TEXT
14
14
  Scope `#{scope.inspect}` is NOT valid.
15
15
 
16
16
  Valid options are #{printable_valid_scopes}.
17
17
  TEXT
18
18
 
19
- super(message)
19
+ initialize(message)
20
20
  end
21
21
 
22
22
  private
@@ -34,14 +34,14 @@ module ConvenientService
34
34
  # @param mod [Module]
35
35
  # @return [void]
36
36
  #
37
- def initialize(mod:)
37
+ def initialize_with_kwargs(mod:)
38
38
  message = <<~TEXT
39
39
  Module `#{mod}` can NOT export methods.
40
40
 
41
41
  Did you forget to include `ConvenientService::DependencyContainer::Export` into it?
42
42
  TEXT
43
43
 
44
- super(message)
44
+ initialize(message)
45
45
  end
46
46
  end
47
47
 
@@ -52,7 +52,7 @@ module ConvenientService
52
52
  # @param mod [Module]
53
53
  # @return [void]
54
54
  #
55
- def initialize(method_name:, method_scope:, mod:)
55
+ def initialize_with_kwargs(method_name:, method_scope:, mod:)
56
56
  message = <<~TEXT
57
57
  Module `#{mod}` does NOT export method `#{method_name}` with `#{method_scope}` scope.
58
58
 
@@ -65,7 +65,7 @@ module ConvenientService
65
65
  end
66
66
  TEXT
67
67
 
68
- super(message)
68
+ initialize(message)
69
69
  end
70
70
  end
71
71
 
@@ -74,12 +74,12 @@ module ConvenientService
74
74
  # @param klass [Class]
75
75
  # @return [void]
76
76
  #
77
- def initialize(klass:)
77
+ def initialize_with_kwargs(klass:)
78
78
  message = <<~TEXT
79
79
  `#{klass.inspect}` is NOT a Module.
80
80
  TEXT
81
81
 
82
- super(message)
82
+ initialize(message)
83
83
  end
84
84
  end
85
85
  end
@@ -11,7 +11,7 @@ module ConvenientService
11
11
  # @return [Module]
12
12
  #
13
13
  included do |klass|
14
- raise Exceptions::NotModule.new(klass: klass) unless klass.instance_of?(::Module)
14
+ ::ConvenientService.raise Exceptions::NotModule.new(klass: klass) unless klass.instance_of?(::Module)
15
15
  end
16
16
 
17
17
  class_methods do
@@ -14,14 +14,14 @@ module ConvenientService
14
14
  # @param limit [Integer]
15
15
  # @return [void]
16
16
  #
17
- def initialize(limit:)
17
+ def initialize_with_kwargs(limit:)
18
18
  message = <<~TEXT
19
19
  Max iteration count is exceeded. Current limit is #{limit}.
20
20
 
21
21
  Consider using `max_iteration_count` or `raise_on_exceedance` options if that is not the expected behavior.
22
22
  TEXT
23
23
 
24
- super(message)
24
+ initialize(message)
25
25
  end
26
26
  end
27
27
 
@@ -29,12 +29,12 @@ module ConvenientService
29
29
  ##
30
30
  # @return [void]
31
31
  #
32
- def initialize
32
+ def initialize_without_arguments
33
33
  message = <<~TEXT
34
34
  `finite_loop` always expects a block to be given.
35
35
  TEXT
36
36
 
37
- super(message)
37
+ initialize(message)
38
38
  end
39
39
  end
40
40
  end
@@ -67,13 +67,13 @@ module ConvenientService
67
67
  # end
68
68
  #
69
69
  def finite_loop(default: nil, max_iteration_count: MAX_ITERATION_COUNT, raise_on_exceedance: true, &block)
70
- raise Exceptions::NoBlockGiven.new unless block
70
+ ::ConvenientService.raise Exceptions::NoBlockGiven.new unless block
71
71
 
72
72
  loop.with_index do |_, index|
73
73
  if index >= max_iteration_count
74
74
  break default unless raise_on_exceedance
75
75
 
76
- raise Exceptions::MaxIterationCountExceeded.new(limit: max_iteration_count)
76
+ ::ConvenientService.raise Exceptions::MaxIterationCountExceeded.new(limit: max_iteration_count)
77
77
  end
78
78
 
79
79
  yield(index)
@@ -9,6 +9,7 @@ require_relative "support/concern"
9
9
 
10
10
  require_relative "support/abstract_method"
11
11
  require_relative "support/arguments"
12
+ require_relative "support/backtrace_cleaner"
12
13
  require_relative "support/cache"
13
14
  require_relative "support/castable"
14
15
  require_relative "support/command"
@@ -5,12 +5,12 @@ module ConvenientService
5
5
  module Array
6
6
  module Exceptions
7
7
  class NonIntegerIndex < ::ConvenientService::Exception
8
- def initialize(index:)
8
+ def initialize_with_kwargs(index:)
9
9
  message = <<~TEXT
10
10
  Index `#{index.inspect}` is NOT an integer.
11
11
  TEXT
12
12
 
13
- super(message)
13
+ initialize(message)
14
14
  end
15
15
  end
16
16
  end
@@ -55,7 +55,7 @@ module ConvenientService
55
55
 
56
56
  return if overrides.size == integer_key_overrides.size
57
57
 
58
- raise Exceptions::NonIntegerIndex.new(index: non_integer_index)
58
+ ::ConvenientService.raise Exceptions::NonIntegerIndex.new(index: non_integer_index)
59
59
  end
60
60
 
61
61
  ##
@@ -41,7 +41,7 @@ module ConvenientService
41
41
  hash.each_key do |key|
42
42
  next if valid_keys.include?(key)
43
43
 
44
- raise ::ArgumentError.new("Unknown key: #{key.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(", ")}")
44
+ ::ConvenientService.raise ::ArgumentError.new("Unknown key: #{key.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(", ")}")
45
45
  end
46
46
  end
47
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConvenientService
4
- VERSION = "0.15.0"
4
+ VERSION = "0.17.0"
5
5
  end
@@ -51,5 +51,103 @@ module ConvenientService
51
51
  def logger
52
52
  Logger.instance
53
53
  end
54
+
55
+ ##
56
+ # Returns Convenient Service root folder. Inspired by `Rails.root`.
57
+ # For example, it may return something like: `/Users/user/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/convenient_service-0.16.0`.
58
+ #
59
+ # @api public
60
+ #
61
+ # @return [Pathname]
62
+ #
63
+ # @see https://ruby-doc.org/core-2.7.1/Kernel.html#method-i-__dir__
64
+ # @see https://api.rubyonrails.org/classes/Rails.html#method-c-root
65
+ #
66
+ def root
67
+ @root ||= ::Pathname.new(::File.expand_path(::File.join(__dir__, "..")))
68
+ end
69
+
70
+ ##
71
+ # Returns Convenient Service Examples folder.
72
+ # For example, it may return something like: `/Users/user/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/convenient_service-0.16.0/lib/convenient_service/examples`.
73
+ #
74
+ # @api private
75
+ #
76
+ # @return [Pathname]
77
+ #
78
+ def examples_root
79
+ @examples_root ||= ::Pathname.new(::File.join(root, "lib", "convenient_service", "examples"))
80
+ end
81
+
82
+ ##
83
+ # @api public
84
+ #
85
+ # @return [ConvenientService::Support::BacktraceCleaner]
86
+ #
87
+ def backtrace_cleaner
88
+ @backtrace_cleaner ||= Support::BacktraceCleaner.new
89
+ end
90
+
91
+ ##
92
+ # @api public
93
+ #
94
+ # @param original_exception [StandardError]
95
+ #
96
+ # @raise [StandardError]
97
+ #
98
+ # @internal
99
+ # NOTE: `rescue ::StandardError => exception` is the same as `rescue => exception`.
100
+ #
101
+ # IMPORTANT: CRuby `Kernel.raise` supports `cause` keyword starting from 2.6.
102
+ # JRuby 9.4 says that it is Ruby 3.1 compatible, but it still does NOT support `cause` keyword.
103
+ # - https://ruby-doc.org/core-2.5.0/Kernel.html#method-i-raise
104
+ # - https://ruby-doc.org/core-2.6/Kernel.html#method-i-raise
105
+ # - https://github.com/jruby/jruby/blob/9.4.0.0/core/src/main/java/org/jruby/RubyKernel.java#L881
106
+ # - https://github.com/ruby/spec/blob/master/core/kernel/raise_spec.rb#L5
107
+ #
108
+ if Dependencies.ruby.jruby?
109
+ def raise(original_exception)
110
+ ::Kernel.raise original_exception
111
+ rescue => exception
112
+ ::Kernel.raise exception.class, exception.message, backtrace_cleaner.clean(exception.backtrace)
113
+ end
114
+ else
115
+ def raise(original_exception)
116
+ ::Kernel.raise original_exception
117
+ rescue => exception
118
+ ::Kernel.raise exception.class, exception.message, backtrace_cleaner.clean(exception.backtrace), cause: exception.cause
119
+ end
120
+ end
121
+
122
+ ##
123
+ # @api public
124
+ #
125
+ # @return [Object] Can be any type.
126
+ #
127
+ # @raise [StandardError]
128
+ #
129
+ # @internal
130
+ # NOTE: `rescue ::StandardError => exception` is the same as `rescue => exception`.
131
+ #
132
+ # IMPORTANT: CRuby `Kernel.raise` supports `cause` keyword starting from 2.6.
133
+ # JRuby 9.4 says that it is Ruby 3.1 compatible, but it still does NOT support `cause` keyword.
134
+ # - https://ruby-doc.org/core-2.5.0/Kernel.html#method-i-raise
135
+ # - https://ruby-doc.org/core-2.6/Kernel.html#method-i-raise
136
+ # - https://github.com/jruby/jruby/blob/9.4.0.0/core/src/main/java/org/jruby/RubyKernel.java#L881
137
+ # - https://github.com/ruby/spec/blob/master/core/kernel/raise_spec.rb#L5
138
+ #
139
+ if Dependencies.ruby.jruby?
140
+ def reraise
141
+ yield
142
+ rescue => exception
143
+ ::Kernel.raise exception.class, exception.message, backtrace_cleaner.clean(exception.backtrace)
144
+ end
145
+ else
146
+ def reraise
147
+ yield
148
+ rescue => exception
149
+ ::Kernel.raise exception.class, exception.message, backtrace_cleaner.clean(exception.backtrace), cause: exception.cause
150
+ end
151
+ end
54
152
  end
55
153
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convenient_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marian Kostyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-20 00:00:00.000000000 Z
11
+ date: 2024-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: commonmarker
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 0.23.10
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 0.23.10
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: debug
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -192,34 +192,6 @@ dependencies:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
194
  version: 5.18.0
195
- - !ruby/object:Gem::Dependency
196
- name: mutant
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: 0.11.21
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - "~>"
207
- - !ruby/object:Gem::Version
208
- version: 0.11.21
209
- - !ruby/object:Gem::Dependency
210
- name: mutant-rspec
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - "~>"
214
- - !ruby/object:Gem::Version
215
- version: 0.11.21
216
- type: :development
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - "~>"
221
- - !ruby/object:Gem::Version
222
- version: 0.11.21
223
195
  - !ruby/object:Gem::Dependency
224
196
  name: paint
225
197
  requirement: !ruby/object:Gem::Requirement
@@ -450,28 +422,28 @@ dependencies:
450
422
  requirements:
451
423
  - - "~>"
452
424
  - !ruby/object:Gem::Version
453
- version: 0.9.28
425
+ version: 0.9.34
454
426
  type: :development
455
427
  prerelease: false
456
428
  version_requirements: !ruby/object:Gem::Requirement
457
429
  requirements:
458
430
  - - "~>"
459
431
  - !ruby/object:Gem::Version
460
- version: 0.9.28
432
+ version: 0.9.34
461
433
  - !ruby/object:Gem::Dependency
462
434
  name: yard-junk
463
435
  requirement: !ruby/object:Gem::Requirement
464
436
  requirements:
465
- - - ">="
437
+ - - "~>"
466
438
  - !ruby/object:Gem::Version
467
- version: '0'
439
+ version: 0.0.9
468
440
  type: :development
469
441
  prerelease: false
470
442
  version_requirements: !ruby/object:Gem::Requirement
471
443
  requirements:
472
- - - ">="
444
+ - - "~>"
473
445
  - !ruby/object:Gem::Version
474
- version: '0'
446
+ version: 0.0.9
475
447
  - !ruby/object:Gem::Dependency
476
448
  name: service_actor
477
449
  requirement: !ruby/object:Gem::Requirement
@@ -570,6 +542,7 @@ files:
570
542
  - ".dev/.tmuxinator.yml"
571
543
  - ".dockerignore"
572
544
  - ".gem_release.yml"
545
+ - ".github/contributing.md"
573
546
  - ".github/issue_template.md"
574
547
  - ".github/pull_request_template.md"
575
548
  - ".github/workflows/cd.yml"
@@ -589,6 +562,7 @@ files:
589
562
  - ".yardopts"
590
563
  - Appraisals
591
564
  - CHANGELOG.md
565
+ - COMM-LICENSE.txt
592
566
  - Gemfile
593
567
  - LICENSE.txt
594
568
  - README.md
@@ -608,6 +582,8 @@ files:
608
582
  - docker/3.2/Dockerfile
609
583
  - docker/jruby-9.4/Dockerfile
610
584
  - docker/truffleruby-22.3/Dockerfile
585
+ - docs/.gitkeep
586
+ - docs/api/.gitkeep
611
587
  - env.rb
612
588
  - gemfiles/.gitkeep
613
589
  - lib/convenient_service.rb
@@ -658,6 +634,13 @@ files:
658
634
  - lib/convenient_service/common/plugins/has_constructor/concern.rb
659
635
  - lib/convenient_service/common/plugins/has_constructor_without_initialize.rb
660
636
  - lib/convenient_service/common/plugins/has_constructor_without_initialize/concern.rb
637
+ - lib/convenient_service/common/plugins/has_instance_proxy.rb
638
+ - lib/convenient_service/common/plugins/has_instance_proxy/commands.rb
639
+ - lib/convenient_service/common/plugins/has_instance_proxy/commands/create_instance_proxy_class.rb
640
+ - lib/convenient_service/common/plugins/has_instance_proxy/concern.rb
641
+ - lib/convenient_service/common/plugins/has_instance_proxy/entities.rb
642
+ - lib/convenient_service/common/plugins/has_instance_proxy/entities/instance_proxy.rb
643
+ - lib/convenient_service/common/plugins/has_instance_proxy/middleware.rb
661
644
  - lib/convenient_service/common/plugins/has_internals.rb
662
645
  - lib/convenient_service/common/plugins/has_internals/commands.rb
663
646
  - lib/convenient_service/common/plugins/has_internals/commands/create_internals_class.rb
@@ -746,6 +729,7 @@ files:
746
729
  - lib/convenient_service/dependencies/extractions/active_support_concern/concern.rb
747
730
  - lib/convenient_service/dependencies/extractions/b.rb
748
731
  - lib/convenient_service/dependencies/extractions/byebug_syntax_highlighting.rb
732
+ - lib/convenient_service/dependencies/extractions/ce.rb
749
733
  - lib/convenient_service/dependencies/extractions/ruby_middleware.rb
750
734
  - lib/convenient_service/dependencies/extractions/ruby_middleware/middleware.rb
751
735
  - lib/convenient_service/dependencies/extractions/ruby_middleware/middleware/builder.rb
@@ -928,7 +912,6 @@ files:
928
912
  - lib/convenient_service/examples/standard/v1/gemfile/services/format_header.rb
929
913
  - lib/convenient_service/examples/standard/v1/gemfile/services/merge_sections.rb
930
914
  - lib/convenient_service/examples/standard/v1/gemfile/services/parse_content.rb
931
- - lib/convenient_service/examples/standard/v1/gemfile/services/print_shell_command.rb
932
915
  - lib/convenient_service/examples/standard/v1/gemfile/services/read_file_content.rb
933
916
  - lib/convenient_service/examples/standard/v1/gemfile/services/replace_file_content.rb
934
917
  - lib/convenient_service/examples/standard/v1/gemfile/services/run_shell_command.rb
@@ -980,8 +963,10 @@ files:
980
963
  - lib/convenient_service/feature/plugins/aliases.rb
981
964
  - lib/convenient_service/feature/plugins/can_have_entries.rb
982
965
  - lib/convenient_service/feature/plugins/can_have_entries/commands.rb
966
+ - lib/convenient_service/feature/plugins/can_have_entries/commands/define_entries.rb
983
967
  - lib/convenient_service/feature/plugins/can_have_entries/commands/define_entry.rb
984
968
  - lib/convenient_service/feature/plugins/can_have_entries/concern.rb
969
+ - lib/convenient_service/feature/plugins/can_have_entries/exceptions.rb
985
970
  - lib/convenient_service/logger.rb
986
971
  - lib/convenient_service/rspec.rb
987
972
  - lib/convenient_service/rspec/helpers.rb
@@ -1415,6 +1400,7 @@ files:
1415
1400
  - lib/convenient_service/support/abstract_method/exceptions.rb
1416
1401
  - lib/convenient_service/support/arguments.rb
1417
1402
  - lib/convenient_service/support/arguments/null_arguments.rb
1403
+ - lib/convenient_service/support/backtrace_cleaner.rb
1418
1404
  - lib/convenient_service/support/cache.rb
1419
1405
  - lib/convenient_service/support/cache/constants.rb
1420
1406
  - lib/convenient_service/support/cache/entities.rb
@@ -1540,7 +1526,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1540
1526
  - !ruby/object:Gem::Version
1541
1527
  version: '0'
1542
1528
  requirements: []
1543
- rubygems_version: 3.3.3
1529
+ rubygems_version: 3.4.1
1544
1530
  signing_key:
1545
1531
  specification_version: 4
1546
1532
  summary: Service object pattern implementation in Ruby.
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ##
4
- # Usage example:
5
- #
6
- # ConvenientService::Examples::Standard::V1::Gemfile::Services::PrintShellCommand.result(command: "ls -a")
7
- #
8
- module ConvenientService
9
- module Examples
10
- module Standard
11
- module V1
12
- class Gemfile
13
- module Services
14
- class PrintShellCommand
15
- include ConvenientService::Standard::V1::Config
16
-
17
- attr_reader :command, :skip, :out
18
-
19
- def initialize(command:, skip: false, out: $stdout)
20
- @command = command
21
- @skip = skip
22
- @out = out
23
- end
24
-
25
- def result
26
- return failure(command: "Command is `nil`") if command.nil?
27
- return failure(command: "Command is empty?") if command.empty?
28
-
29
- return error("Printing of shell command `#{command}` is skipped") if skip
30
-
31
- out.puts
32
-
33
- out.puts ::Paint["$ #{command}", :blue, :bold]
34
-
35
- success
36
- end
37
-
38
- def fallback_error_result
39
- success
40
- end
41
- end
42
- end
43
- end
44
- end
45
- end
46
- end
47
- end