cmdx 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.cursor/prompts/llms.md +3 -13
- data/.cursor/prompts/yardoc.md +1 -0
- data/CHANGELOG.md +16 -0
- data/LLM.md +436 -374
- data/README.md +7 -2
- data/docs/basics/setup.md +17 -0
- data/docs/callbacks.md +1 -1
- data/docs/getting_started.md +22 -2
- data/docs/index.md +13 -1
- data/docs/retries.md +121 -0
- data/docs/tips_and_tricks.md +2 -1
- data/examples/stoplight_circuit_breaker.md +36 -0
- data/lib/cmdx/attribute.rb +82 -1
- data/lib/cmdx/attribute_registry.rb +20 -0
- data/lib/cmdx/attribute_value.rb +25 -0
- data/lib/cmdx/callback_registry.rb +19 -0
- data/lib/cmdx/chain.rb +34 -1
- data/lib/cmdx/coercion_registry.rb +18 -0
- data/lib/cmdx/coercions/array.rb +2 -0
- data/lib/cmdx/coercions/big_decimal.rb +3 -0
- data/lib/cmdx/coercions/boolean.rb +5 -0
- data/lib/cmdx/coercions/complex.rb +2 -0
- data/lib/cmdx/coercions/date.rb +4 -0
- data/lib/cmdx/coercions/date_time.rb +5 -0
- data/lib/cmdx/coercions/float.rb +2 -0
- data/lib/cmdx/coercions/hash.rb +2 -0
- data/lib/cmdx/coercions/integer.rb +2 -0
- data/lib/cmdx/coercions/rational.rb +2 -0
- data/lib/cmdx/coercions/string.rb +2 -0
- data/lib/cmdx/coercions/symbol.rb +2 -0
- data/lib/cmdx/coercions/time.rb +5 -0
- data/lib/cmdx/configuration.rb +126 -3
- data/lib/cmdx/context.rb +36 -0
- data/lib/cmdx/deprecator.rb +3 -0
- data/lib/cmdx/errors.rb +22 -0
- data/lib/cmdx/executor.rb +71 -11
- data/lib/cmdx/faults.rb +14 -0
- data/lib/cmdx/identifier.rb +2 -0
- data/lib/cmdx/locale.rb +3 -0
- data/lib/cmdx/log_formatters/json.rb +2 -0
- data/lib/cmdx/log_formatters/key_value.rb +2 -0
- data/lib/cmdx/log_formatters/line.rb +2 -0
- data/lib/cmdx/log_formatters/logstash.rb +2 -0
- data/lib/cmdx/log_formatters/raw.rb +2 -0
- data/lib/cmdx/middleware_registry.rb +20 -0
- data/lib/cmdx/middlewares/correlate.rb +11 -0
- data/lib/cmdx/middlewares/runtime.rb +4 -0
- data/lib/cmdx/middlewares/timeout.rb +4 -0
- data/lib/cmdx/pipeline.rb +20 -1
- data/lib/cmdx/railtie.rb +4 -0
- data/lib/cmdx/result.rb +123 -1
- data/lib/cmdx/task.rb +91 -1
- data/lib/cmdx/utils/call.rb +2 -0
- data/lib/cmdx/utils/condition.rb +3 -0
- data/lib/cmdx/utils/format.rb +5 -0
- data/lib/cmdx/validator_registry.rb +18 -0
- data/lib/cmdx/validators/exclusion.rb +2 -0
- data/lib/cmdx/validators/format.rb +2 -0
- data/lib/cmdx/validators/inclusion.rb +2 -0
- data/lib/cmdx/validators/length.rb +14 -0
- data/lib/cmdx/validators/numeric.rb +14 -0
- data/lib/cmdx/validators/presence.rb +2 -0
- data/lib/cmdx/version.rb +4 -1
- data/lib/cmdx/workflow.rb +10 -0
- data/lib/cmdx.rb +8 -0
- data/lib/generators/cmdx/locale_generator.rb +0 -1
- data/mkdocs.yml +3 -1
- metadata +3 -1
    
        data/lib/cmdx/utils/format.rb
    CHANGED
    
    | @@ -8,6 +8,7 @@ module CMDx | |
| 8 8 |  | 
| 9 9 | 
             
                  extend self
         | 
| 10 10 |  | 
| 11 | 
            +
                  # @rbs FORMATTER: Proc
         | 
| 11 12 | 
             
                  FORMATTER = proc do |key, value|
         | 
| 12 13 | 
             
                    "#{key}=#{value.inspect}"
         | 
| 13 14 | 
             
                  end.freeze
         | 
| @@ -28,6 +29,8 @@ module CMDx | |
| 28 29 | 
             
                  # @example CMDx object
         | 
| 29 30 | 
             
                  #   Format.to_log(CMDx::Task.new(name: "task1"))
         | 
| 30 31 | 
             
                  #   # => {name: "task1"}
         | 
| 32 | 
            +
                  #
         | 
| 33 | 
            +
                  # @rbs (untyped message) -> untyped
         | 
| 31 34 | 
             
                  def to_log(message)
         | 
| 32 35 | 
             
                    if message.respond_to?(:to_h) && message.class.ancestors.any? { |a| a.to_s.start_with?("CMDx") }
         | 
| 33 36 | 
             
                      message.to_h
         | 
| @@ -51,6 +54,8 @@ module CMDx | |
| 51 54 | 
             
                  # @example Custom formatter
         | 
| 52 55 | 
             
                  #   Format.to_str({count: 5, total: 100}) { |k, v| "#{k}:#{v}" }
         | 
| 53 56 | 
             
                  #   # => "count:5 total:100"
         | 
| 57 | 
            +
                  #
         | 
| 58 | 
            +
                  # @rbs (Hash[untyped, untyped] hash) ?{ (untyped, untyped) -> String } -> String
         | 
| 54 59 | 
             
                  def to_str(hash, &block)
         | 
| 55 60 | 
             
                    block ||= FORMATTER
         | 
| 56 61 | 
             
                    hash.map(&block).join(" ")
         | 
| @@ -7,6 +7,14 @@ module CMDx | |
| 7 7 |  | 
| 8 8 | 
             
                extend Forwardable
         | 
| 9 9 |  | 
| 10 | 
            +
                # Returns the internal registry mapping validator types to classes.
         | 
| 11 | 
            +
                #
         | 
| 12 | 
            +
                # @return [Hash{Symbol => Class}] Hash of validator type names to validator classes
         | 
| 13 | 
            +
                #
         | 
| 14 | 
            +
                # @example
         | 
| 15 | 
            +
                #   registry.registry # => { presence: Validators::Presence, format: Validators::Format }
         | 
| 16 | 
            +
                #
         | 
| 17 | 
            +
                # @rbs @registry: Hash[Symbol, Class]
         | 
| 10 18 | 
             
                attr_reader :registry
         | 
| 11 19 | 
             
                alias to_h registry
         | 
| 12 20 |  | 
| @@ -17,6 +25,8 @@ module CMDx | |
| 17 25 | 
             
                # @param registry [Hash, nil] Optional hash mapping validator names to validator classes
         | 
| 18 26 | 
             
                #
         | 
| 19 27 | 
             
                # @return [ValidatorRegistry] A new validator registry instance
         | 
| 28 | 
            +
                #
         | 
| 29 | 
            +
                # @rbs (?Hash[Symbol, Class]? registry) -> void
         | 
| 20 30 | 
             
                def initialize(registry = nil)
         | 
| 21 31 | 
             
                  @registry = registry || {
         | 
| 22 32 | 
             
                    exclusion: Validators::Exclusion,
         | 
| @@ -31,6 +41,8 @@ module CMDx | |
| 31 41 | 
             
                # Create a duplicate of the registry with copied internal state.
         | 
| 32 42 | 
             
                #
         | 
| 33 43 | 
             
                # @return [ValidatorRegistry] A new validator registry with duplicated registry hash
         | 
| 44 | 
            +
                #
         | 
| 45 | 
            +
                # @rbs () -> ValidatorRegistry
         | 
| 34 46 | 
             
                def dup
         | 
| 35 47 | 
             
                  self.class.new(registry.dup)
         | 
| 36 48 | 
             
                end
         | 
| @@ -45,6 +57,8 @@ module CMDx | |
| 45 57 | 
             
                # @example
         | 
| 46 58 | 
             
                #   registry.register(:custom, CustomValidator)
         | 
| 47 59 | 
             
                #   registry.register("email", EmailValidator)
         | 
| 60 | 
            +
                #
         | 
| 61 | 
            +
                # @rbs ((String | Symbol) name, Class validator) -> self
         | 
| 48 62 | 
             
                def register(name, validator)
         | 
| 49 63 | 
             
                  registry[name.to_sym] = validator
         | 
| 50 64 | 
             
                  self
         | 
| @@ -59,6 +73,8 @@ module CMDx | |
| 59 73 | 
             
                # @example
         | 
| 60 74 | 
             
                #   registry.deregister(:format)
         | 
| 61 75 | 
             
                #   registry.deregister("presence")
         | 
| 76 | 
            +
                #
         | 
| 77 | 
            +
                # @rbs ((String | Symbol) name) -> self
         | 
| 62 78 | 
             
                def deregister(name)
         | 
| 63 79 | 
             
                  registry.delete(name.to_sym)
         | 
| 64 80 | 
             
                  self
         | 
| @@ -77,6 +93,8 @@ module CMDx | |
| 77 93 | 
             
                # @example
         | 
| 78 94 | 
             
                #   registry.validate(:presence, task, user.name, presence: true)
         | 
| 79 95 | 
             
                #   registry.validate(:length, task, password, { min: 8, allow_nil: false })
         | 
| 96 | 
            +
                #
         | 
| 97 | 
            +
                # @rbs (Symbol type, Task task, untyped value, untyped options) -> untyped
         | 
| 80 98 | 
             
                def validate(type, task, value, options = {})
         | 
| 81 99 | 
             
                  raise TypeError, "unknown validator type #{type.inspect}" unless registry.key?(type)
         | 
| 82 100 |  | 
| @@ -32,6 +32,8 @@ module CMDx | |
| 32 32 | 
             
                  #   # => raises ValidationError if value is 5 (within 1..10)
         | 
| 33 33 | 
             
                  # @example Exclude with custom message
         | 
| 34 34 | 
             
                  #   Exclusion.call("test", in: ["test", "demo"], message: "value %{values} is forbidden")
         | 
| 35 | 
            +
                  #
         | 
| 36 | 
            +
                  # @rbs (untyped value, Hash[Symbol, untyped] options) -> nil
         | 
| 35 37 | 
             
                  def call(value, options = {})
         | 
| 36 38 | 
             
                    values = options[:in] || options[:within]
         | 
| 37 39 |  | 
| @@ -38,6 +38,8 @@ module CMDx | |
| 38 38 | 
             
                  # @example Validate with custom message
         | 
| 39 39 | 
             
                  #   Format.call("invalid", with: /\A\d+\z/, message: "Must contain only digits")
         | 
| 40 40 | 
             
                  #   # => raises ValidationError with custom message
         | 
| 41 | 
            +
                  #
         | 
| 42 | 
            +
                  # @rbs (untyped value, (Hash[Symbol, untyped] | Regexp) options) -> nil
         | 
| 41 43 | 
             
                  def call(value, options = {})
         | 
| 42 44 | 
             
                    match =
         | 
| 43 45 | 
             
                      if options.is_a?(Regexp)
         | 
| @@ -34,6 +34,8 @@ module CMDx | |
| 34 34 | 
             
                  #   # => nil (validation passes - 5 is within 1..10)
         | 
| 35 35 | 
             
                  # @example Include with custom message
         | 
| 36 36 | 
             
                  #   Inclusion.call("test", in: ["admin", "user"], message: "must be one of: %{values}")
         | 
| 37 | 
            +
                  #
         | 
| 38 | 
            +
                  # @rbs (untyped value, Hash[Symbol, untyped] options) -> nil
         | 
| 37 39 | 
             
                  def call(value, options = {})
         | 
| 38 40 | 
             
                    values = options[:in] || options[:within]
         | 
| 39 41 |  | 
| @@ -51,6 +51,8 @@ module CMDx | |
| 51 51 | 
             
                  # @example Exclusion validation
         | 
| 52 52 | 
             
                  #   Length.call("short", not_in: 1..3)
         | 
| 53 53 | 
             
                  #   # => nil (validation passes - length 5 is not in excluded range)
         | 
| 54 | 
            +
                  #
         | 
| 55 | 
            +
                  # @rbs (untyped value, Hash[Symbol, untyped] options) -> nil
         | 
| 54 56 | 
             
                  def call(value, options = {})
         | 
| 55 57 | 
             
                    length = value&.length
         | 
| 56 58 |  | 
| @@ -87,6 +89,8 @@ module CMDx | |
| 87 89 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 88 90 | 
             
                  #
         | 
| 89 91 | 
             
                  # @raise [ValidationError] Always raised with appropriate message
         | 
| 92 | 
            +
                  #
         | 
| 93 | 
            +
                  # @rbs (Integer min, Integer max, Hash[Symbol, untyped] options) -> void
         | 
| 90 94 | 
             
                  def raise_within_validation_error!(min, max, options)
         | 
| 91 95 | 
             
                    message = options[:within_message] || options[:in_message] || options[:message]
         | 
| 92 96 | 
             
                    message %= { min:, max: } unless message.nil?
         | 
| @@ -101,6 +105,8 @@ module CMDx | |
| 101 105 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 102 106 | 
             
                  #
         | 
| 103 107 | 
             
                  # @raise [ValidationError] Always raised with appropriate message
         | 
| 108 | 
            +
                  #
         | 
| 109 | 
            +
                  # @rbs (Integer min, Integer max, Hash[Symbol, untyped] options) -> void
         | 
| 104 110 | 
             
                  def raise_not_within_validation_error!(min, max, options)
         | 
| 105 111 | 
             
                    message = options[:not_within_message] || options[:not_in_message] || options[:message]
         | 
| 106 112 | 
             
                    message %= { min:, max: } unless message.nil?
         | 
| @@ -114,6 +120,8 @@ module CMDx | |
| 114 120 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 115 121 | 
             
                  #
         | 
| 116 122 | 
             
                  # @raise [ValidationError] Always raised with appropriate message
         | 
| 123 | 
            +
                  #
         | 
| 124 | 
            +
                  # @rbs (Integer min, Hash[Symbol, untyped] options) -> void
         | 
| 117 125 | 
             
                  def raise_min_validation_error!(min, options)
         | 
| 118 126 | 
             
                    message = options[:min_message] || options[:message]
         | 
| 119 127 | 
             
                    message %= { min: } unless message.nil?
         | 
| @@ -127,6 +135,8 @@ module CMDx | |
| 127 135 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 128 136 | 
             
                  #
         | 
| 129 137 | 
             
                  # @raise [ValidationError] Always raised with appropriate message
         | 
| 138 | 
            +
                  #
         | 
| 139 | 
            +
                  # @rbs (Integer max, Hash[Symbol, untyped] options) -> void
         | 
| 130 140 | 
             
                  def raise_max_validation_error!(max, options)
         | 
| 131 141 | 
             
                    message = options[:max_message] || options[:message]
         | 
| 132 142 | 
             
                    message %= { max: } unless message.nil?
         | 
| @@ -140,6 +150,8 @@ module CMDx | |
| 140 150 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 141 151 | 
             
                  #
         | 
| 142 152 | 
             
                  # @raise [ValidationError] Always raised with appropriate message
         | 
| 153 | 
            +
                  #
         | 
| 154 | 
            +
                  # @rbs (Integer is, Hash[Symbol, untyped] options) -> void
         | 
| 143 155 | 
             
                  def raise_is_validation_error!(is, options)
         | 
| 144 156 | 
             
                    message = options[:is_message] || options[:message]
         | 
| 145 157 | 
             
                    message %= { is: } unless message.nil?
         | 
| @@ -153,6 +165,8 @@ module CMDx | |
| 153 165 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 154 166 | 
             
                  #
         | 
| 155 167 | 
             
                  # @raise [ValidationError] Always raised with appropriate message
         | 
| 168 | 
            +
                  #
         | 
| 169 | 
            +
                  # @rbs (Integer is_not, Hash[Symbol, untyped] options) -> void
         | 
| 156 170 | 
             
                  def raise_is_not_validation_error!(is_not, options)
         | 
| 157 171 | 
             
                    message = options[:is_not_message] || options[:message]
         | 
| 158 172 | 
             
                    message %= { is_not: } unless message.nil?
         | 
| @@ -48,6 +48,8 @@ module CMDx | |
| 48 48 | 
             
                  # @example Validate value exclusion
         | 
| 49 49 | 
             
                  #   Numeric.call(5, not_in: 1..10)
         | 
| 50 50 | 
             
                  #   # => nil (validation passes - 5 is not in 1..10)
         | 
| 51 | 
            +
                  #
         | 
| 52 | 
            +
                  # @rbs (Numeric value, Hash[Symbol, untyped] options) -> nil
         | 
| 51 53 | 
             
                  def call(value, options = {})
         | 
| 52 54 | 
             
                    case options
         | 
| 53 55 | 
             
                    in within:
         | 
| @@ -82,6 +84,8 @@ module CMDx | |
| 82 84 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 83 85 | 
             
                  #
         | 
| 84 86 | 
             
                  # @raise [ValidationError] With appropriate error message
         | 
| 87 | 
            +
                  #
         | 
| 88 | 
            +
                  # @rbs (Numeric min, Numeric max, Hash[Symbol, untyped] options) -> void
         | 
| 85 89 | 
             
                  def raise_within_validation_error!(min, max, options)
         | 
| 86 90 | 
             
                    message = options[:within_message] || options[:in_message] || options[:message]
         | 
| 87 91 | 
             
                    message %= { min:, max: } unless message.nil?
         | 
| @@ -96,6 +100,8 @@ module CMDx | |
| 96 100 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 97 101 | 
             
                  #
         | 
| 98 102 | 
             
                  # @raise [ValidationError] With appropriate error message
         | 
| 103 | 
            +
                  #
         | 
| 104 | 
            +
                  # @rbs (Numeric min, Numeric max, Hash[Symbol, untyped] options) -> void
         | 
| 99 105 | 
             
                  def raise_not_within_validation_error!(min, max, options)
         | 
| 100 106 | 
             
                    message = options[:not_within_message] || options[:not_in_message] || options[:message]
         | 
| 101 107 | 
             
                    message %= { min:, max: } unless message.nil?
         | 
| @@ -109,6 +115,8 @@ module CMDx | |
| 109 115 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 110 116 | 
             
                  #
         | 
| 111 117 | 
             
                  # @raise [ValidationError] With appropriate error message
         | 
| 118 | 
            +
                  #
         | 
| 119 | 
            +
                  # @rbs (Numeric min, Hash[Symbol, untyped] options) -> void
         | 
| 112 120 | 
             
                  def raise_min_validation_error!(min, options)
         | 
| 113 121 | 
             
                    message = options[:min_message] || options[:message]
         | 
| 114 122 | 
             
                    message %= { min: } unless message.nil?
         | 
| @@ -122,6 +130,8 @@ module CMDx | |
| 122 130 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 123 131 | 
             
                  #
         | 
| 124 132 | 
             
                  # @raise [ValidationError] With appropriate error message
         | 
| 133 | 
            +
                  #
         | 
| 134 | 
            +
                  # @rbs (Numeric max, Hash[Symbol, untyped] options) -> void
         | 
| 125 135 | 
             
                  def raise_max_validation_error!(max, options)
         | 
| 126 136 | 
             
                    message = options[:max_message] || options[:message]
         | 
| 127 137 | 
             
                    message %= { max: } unless message.nil?
         | 
| @@ -135,6 +145,8 @@ module CMDx | |
| 135 145 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 136 146 | 
             
                  #
         | 
| 137 147 | 
             
                  # @raise [ValidationError] With appropriate error message
         | 
| 148 | 
            +
                  #
         | 
| 149 | 
            +
                  # @rbs (Numeric is, Hash[Symbol, untyped] options) -> void
         | 
| 138 150 | 
             
                  def raise_is_validation_error!(is, options)
         | 
| 139 151 | 
             
                    message = options[:is_message] || options[:message]
         | 
| 140 152 | 
             
                    message %= { is: } unless message.nil?
         | 
| @@ -148,6 +160,8 @@ module CMDx | |
| 148 160 | 
             
                  # @param options [Hash] Validation options containing custom messages
         | 
| 149 161 | 
             
                  #
         | 
| 150 162 | 
             
                  # @raise [ValidationError] With appropriate error message
         | 
| 163 | 
            +
                  #
         | 
| 164 | 
            +
                  # @rbs (Numeric is_not, Hash[Symbol, untyped] options) -> void
         | 
| 151 165 | 
             
                  def raise_is_not_validation_error!(is_not, options)
         | 
| 152 166 | 
             
                    message = options[:is_not_message] || options[:message]
         | 
| 153 167 | 
             
                    message %= { is_not: } unless message.nil?
         | 
| @@ -38,6 +38,8 @@ module CMDx | |
| 38 38 | 
             
                  # @example Validate with custom message
         | 
| 39 39 | 
             
                  #   Presence.call(nil, message: "Value cannot be blank")
         | 
| 40 40 | 
             
                  #   # => raises ValidationError with custom message
         | 
| 41 | 
            +
                  #
         | 
| 42 | 
            +
                  # @rbs (untyped value, ?Hash[Symbol, untyped] options) -> nil
         | 
| 41 43 | 
             
                  def call(value, options = {})
         | 
| 42 44 | 
             
                    match =
         | 
| 43 45 | 
             
                      if value.is_a?(String)
         | 
    
        data/lib/cmdx/version.rb
    CHANGED
    
    
    
        data/lib/cmdx/workflow.rb
    CHANGED
    
    | @@ -20,6 +20,8 @@ module CMDx | |
| 20 20 | 
             
                  #     # This would raise an error:
         | 
| 21 21 | 
             
                  #     # def work; end
         | 
| 22 22 | 
             
                  #   end
         | 
| 23 | 
            +
                  #
         | 
| 24 | 
            +
                  # @rbs (Symbol method_name) -> void
         | 
| 23 25 | 
             
                  def method_added(method_name)
         | 
| 24 26 | 
             
                    raise "cannot redefine #{name}##{method_name} method" if method_name == :work
         | 
| 25 27 |  | 
| @@ -37,6 +39,8 @@ module CMDx | |
| 37 39 | 
             
                  #     task Task2
         | 
| 38 40 | 
             
                  #     puts pipeline.size # => 2
         | 
| 39 41 | 
             
                  #   end
         | 
| 42 | 
            +
                  #
         | 
| 43 | 
            +
                  # @rbs () -> Array[ExecutionGroup]
         | 
| 40 44 | 
             
                  def pipeline
         | 
| 41 45 | 
             
                    @pipeline ||= []
         | 
| 42 46 | 
             
                  end
         | 
| @@ -55,6 +59,8 @@ module CMDx | |
| 55 59 | 
             
                  #     include CMDx::Workflow
         | 
| 56 60 | 
             
                  #     tasks ValidateTask, ProcessTask, NotifyTask, breakpoints: [:failure, :halt]
         | 
| 57 61 | 
             
                  #   end
         | 
| 62 | 
            +
                  #
         | 
| 63 | 
            +
                  # @rbs (*untyped tasks, **untyped options) -> void
         | 
| 58 64 | 
             
                  def tasks(*tasks, **options)
         | 
| 59 65 | 
             
                    pipeline << ExecutionGroup.new(
         | 
| 60 66 | 
             
                      tasks.map do |task|
         | 
| @@ -83,6 +89,8 @@ module CMDx | |
| 83 89 | 
             
                #     include CMDx::Workflow
         | 
| 84 90 | 
             
                #     # Now has access to task, tasks, and work methods
         | 
| 85 91 | 
             
                #   end
         | 
| 92 | 
            +
                #
         | 
| 93 | 
            +
                # @rbs (Class base) -> void
         | 
| 86 94 | 
             
                def self.included(base)
         | 
| 87 95 | 
             
                  base.extend(ClassMethods)
         | 
| 88 96 | 
             
                end
         | 
| @@ -100,6 +108,8 @@ module CMDx | |
| 100 108 | 
             
                #
         | 
| 101 109 | 
             
                #   workflow = MyWorkflow.new
         | 
| 102 110 | 
             
                #   result = workflow.work
         | 
| 111 | 
            +
                #
         | 
| 112 | 
            +
                # @rbs () -> void
         | 
| 103 113 | 
             
                def work
         | 
| 104 114 | 
             
                  Pipeline.execute(self)
         | 
| 105 115 | 
             
                end
         | 
    
        data/lib/cmdx.rb
    CHANGED
    
    | @@ -17,6 +17,14 @@ module CMDx | |
| 17 17 |  | 
| 18 18 | 
             
              extend self
         | 
| 19 19 |  | 
| 20 | 
            +
              # Returns the path to the CMDx gem.
         | 
| 21 | 
            +
              #
         | 
| 22 | 
            +
              # @return [Pathname] the path to the CMDx gem
         | 
| 23 | 
            +
              #
         | 
| 24 | 
            +
              # @example
         | 
| 25 | 
            +
              #   CMDx.gem_path # => Pathname.new("/path/to/cmdx")
         | 
| 26 | 
            +
              #
         | 
| 27 | 
            +
              # @rbs return: Pathname
         | 
| 20 28 | 
             
              def gem_path
         | 
| 21 29 | 
             
                @gem_path ||= Pathname.new(__dir__).parent
         | 
| 22 30 | 
             
              end
         | 
    
        data/mkdocs.yml
    CHANGED
    
    | @@ -2,7 +2,7 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            site_name: CMDx
         | 
| 4 4 | 
             
            site_url: https://drexed.github.io/cmdx/
         | 
| 5 | 
            -
            site_description: Build business logic that's powerful, predictable, and  | 
| 5 | 
            +
            site_description: Build business logic that's powerful, predictable, and maintainable.
         | 
| 6 6 | 
             
            site_author: drexed
         | 
| 7 7 | 
             
            repo_name: drexed/cmdx
         | 
| 8 8 | 
             
            repo_url: https://github.com/drexed/cmdx
         | 
| @@ -108,9 +108,11 @@ nav: | |
| 108 108 | 
             
              - Middlewares: middlewares.md
         | 
| 109 109 | 
             
              - Logging: logging.md
         | 
| 110 110 | 
             
              - Internationalization: internationalization.md
         | 
| 111 | 
            +
              - Retries: retries.md
         | 
| 111 112 | 
             
              - Deprecation: deprecation.md
         | 
| 112 113 | 
             
              - Workflows: workflows.md
         | 
| 113 114 | 
             
              - Tips and Tricks: tips_and_tricks.md
         | 
| 115 | 
            +
              - LLM.md: https://raw.githubusercontent.com/drexed/cmdx/refs/heads/main/LLM.md
         | 
| 114 116 |  | 
| 115 117 | 
             
            extra:
         | 
| 116 118 | 
             
              generator: false
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: cmdx
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.10.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Juan Gomez
         | 
| @@ -240,11 +240,13 @@ files: | |
| 240 240 | 
             
            - docs/outcomes/result.md
         | 
| 241 241 | 
             
            - docs/outcomes/states.md
         | 
| 242 242 | 
             
            - docs/outcomes/statuses.md
         | 
| 243 | 
            +
            - docs/retries.md
         | 
| 243 244 | 
             
            - docs/stylesheets/extra.css
         | 
| 244 245 | 
             
            - docs/tips_and_tricks.md
         | 
| 245 246 | 
             
            - docs/workflows.md
         | 
| 246 247 | 
             
            - examples/active_record_query_tagging.md
         | 
| 247 248 | 
             
            - examples/paper_trail_whatdunnit.md
         | 
| 249 | 
            +
            - examples/stoplight_circuit_breaker.md
         | 
| 248 250 | 
             
            - lib/cmdx.rb
         | 
| 249 251 | 
             
            - lib/cmdx/.DS_Store
         | 
| 250 252 | 
             
            - lib/cmdx/attribute.rb
         |