cmdx 1.0.0 → 1.0.1
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/.rubocop.yml +3 -0
- data/CHANGELOG.md +86 -49
- data/README.md +1 -0
- data/docs/ai_prompts.md +10 -0
- data/docs/basics/call.md +9 -0
- data/docs/basics/chain.md +9 -0
- data/docs/basics/context.md +9 -0
- data/docs/basics/setup.md +9 -0
- data/docs/callbacks.md +11 -1
- data/docs/configuration.md +11 -16
- data/docs/getting_started.md +11 -0
- data/docs/internationalization.md +148 -0
- data/docs/interruptions/exceptions.md +9 -0
- data/docs/interruptions/faults.md +9 -0
- data/docs/interruptions/halt.md +9 -0
- data/docs/logging.md +11 -1
- data/docs/middlewares.md +10 -0
- data/docs/outcomes/result.md +9 -0
- data/docs/outcomes/states.md +9 -0
- data/docs/outcomes/statuses.md +9 -0
- data/docs/parameters/coercions.md +9 -0
- data/docs/parameters/defaults.md +9 -0
- data/docs/parameters/definitions.md +9 -0
- data/docs/parameters/namespacing.md +9 -0
- data/docs/parameters/validations.md +9 -29
- data/docs/testing.md +12 -2
- data/docs/tips_and_tricks.md +9 -0
- data/docs/workflows.md +10 -0
- data/lib/cmdx/version.rb +1 -1
- data/lib/generators/cmdx/templates/install.rb +43 -11
- data/lib/locales/ar.yml +36 -0
- data/lib/locales/cs.yml +36 -0
- data/lib/locales/da.yml +36 -0
- data/lib/locales/de.yml +36 -0
- data/lib/locales/el.yml +36 -0
- data/lib/locales/en.yml +20 -20
- data/lib/locales/es.yml +20 -20
- data/lib/locales/fi.yml +36 -0
- data/lib/locales/fr.yml +36 -0
- data/lib/locales/he.yml +36 -0
- data/lib/locales/hi.yml +36 -0
- data/lib/locales/it.yml +36 -0
- data/lib/locales/ja.yml +36 -0
- data/lib/locales/ko.yml +36 -0
- data/lib/locales/nl.yml +36 -0
- data/lib/locales/no.yml +36 -0
- data/lib/locales/pl.yml +36 -0
- data/lib/locales/pt.yml +36 -0
- data/lib/locales/ru.yml +36 -0
- data/lib/locales/sv.yml +36 -0
- data/lib/locales/th.yml +36 -0
- data/lib/locales/tr.yml +36 -0
- data/lib/locales/vi.yml +36 -0
- data/lib/locales/zh.yml +36 -0
- metadata +24 -1
data/docs/middlewares.md
CHANGED
@@ -4,6 +4,7 @@ Middleware provides Rack-style wrappers around task execution for cross-cutting
|
|
4
4
|
|
5
5
|
## Table of Contents
|
6
6
|
|
7
|
+
- [TLDR](#tldr)
|
7
8
|
- [Using Middleware](#using-middleware)
|
8
9
|
- [Class Middleware](#class-middleware)
|
9
10
|
- [Instance Middleware](#instance-middleware)
|
@@ -16,6 +17,15 @@ Middleware provides Rack-style wrappers around task execution for cross-cutting
|
|
16
17
|
- [Correlate Middleware](#correlate-middleware)
|
17
18
|
- [Writing Custom Middleware](#writing-custom-middleware)
|
18
19
|
|
20
|
+
## TLDR
|
21
|
+
|
22
|
+
- **Purpose** - Rack-style wrappers for cross-cutting concerns (auth, logging, caching)
|
23
|
+
- **Declaration** - Use `use` method with classes, instances, or procs
|
24
|
+
- **Execution order** - Nested fashion (first declared wraps all others)
|
25
|
+
- **Short-circuiting** - Middleware can halt execution by not calling next callable
|
26
|
+
- **Inheritance** - Middleware is inherited from parent classes
|
27
|
+
- **Built-in** - Includes Timeout and Correlate middleware
|
28
|
+
|
19
29
|
## Using Middleware
|
20
30
|
|
21
31
|
Declare middleware using the `use` method in your task classes:
|
data/docs/outcomes/result.md
CHANGED
@@ -7,6 +7,7 @@ inspecting task execution outcomes and chaining task operations.
|
|
7
7
|
|
8
8
|
## Table of Contents
|
9
9
|
|
10
|
+
- [TLDR](#tldr)
|
10
11
|
- [Core Result Attributes](#core-result-attributes)
|
11
12
|
- [State and Status Information](#state-and-status-information)
|
12
13
|
- [Execution Outcome Analysis](#execution-outcome-analysis)
|
@@ -17,6 +18,14 @@ inspecting task execution outcomes and chaining task operations.
|
|
17
18
|
- [Pattern Matching](#pattern-matching)
|
18
19
|
- [Serialization and Inspection](#serialization-and-inspection)
|
19
20
|
|
21
|
+
## TLDR
|
22
|
+
|
23
|
+
- **Result object** - Comprehensive return value from task execution with `task`, `context`, `chain`, `metadata`
|
24
|
+
- **Status checking** - Use `result.success?`, `result.failed?`, `result.skipped?` for outcomes
|
25
|
+
- **State checking** - Use `result.complete?`, `result.interrupted?`, `result.executed?` for lifecycle
|
26
|
+
- **Callbacks** - Chain with `.on_success`, `.on_failed`, `.on_good`, `.on_bad` for conditional logic
|
27
|
+
- **Failure analysis** - Use `result.caused_failure`, `result.threw_failure` to trace failure chains
|
28
|
+
|
20
29
|
## Core Result Attributes
|
21
30
|
|
22
31
|
Every result provides access to essential execution information:
|
data/docs/outcomes/states.md
CHANGED
@@ -7,6 +7,7 @@ decision making and monitoring.
|
|
7
7
|
|
8
8
|
## Table of Contents
|
9
9
|
|
10
|
+
- [TLDR](#tldr)
|
10
11
|
- [State Definitions](#state-definitions)
|
11
12
|
- [State Transitions](#state-transitions)
|
12
13
|
- [State Predicates](#state-predicates)
|
@@ -15,6 +16,14 @@ decision making and monitoring.
|
|
15
16
|
- [State Inspection and Monitoring](#state-inspection-and-monitoring)
|
16
17
|
- [State Persistence and Logging](#state-persistence-and-logging)
|
17
18
|
|
19
|
+
## TLDR
|
20
|
+
|
21
|
+
- **States** - Track execution lifecycle: `initialized` → `executing` → `complete`/`interrupted`
|
22
|
+
- **Automatic** - States are managed automatically by the framework, never modify manually
|
23
|
+
- **Predicates** - Check with `result.complete?`, `result.interrupted?`, `result.executed?`
|
24
|
+
- **Callbacks** - Use `.on_complete`, `.on_interrupted`, `.on_executed` for lifecycle events
|
25
|
+
- **vs Status** - State = where in lifecycle, Status = how execution ended
|
26
|
+
|
18
27
|
## State Definitions
|
19
28
|
|
20
29
|
| State | Description |
|
data/docs/outcomes/statuses.md
CHANGED
@@ -4,6 +4,7 @@ Statuses represent the outcome of task execution logic, indicating how the task'
|
|
4
4
|
|
5
5
|
## Table of Contents
|
6
6
|
|
7
|
+
- [TLDR](#tldr)
|
7
8
|
- [Status Definitions](#status-definitions)
|
8
9
|
- [Status Characteristics](#status-characteristics)
|
9
10
|
- [Status Predicates](#status-predicates)
|
@@ -14,6 +15,14 @@ Statuses represent the outcome of task execution logic, indicating how the task'
|
|
14
15
|
- [Status Serialization and Inspection](#status-serialization-and-inspection)
|
15
16
|
- [Status vs State vs Outcome](#status-vs-state-vs-outcome)
|
16
17
|
|
18
|
+
## TLDR
|
19
|
+
|
20
|
+
- **Statuses** - Business outcome of execution: `success` (default), `skipped` (via `skip!`), `failed` (via `fail!`)
|
21
|
+
- **One-way transitions** - Only `success` → `skipped`/`failed`, never reverse
|
22
|
+
- **Predicates** - Check with `result.success?`, `result.skipped?`, `result.failed?`
|
23
|
+
- **Outcomes** - `result.good?` = success OR skipped, `result.bad?` = skipped OR failed
|
24
|
+
- **Rich metadata** - Both `skip!()` and `fail!()` accept metadata for context
|
25
|
+
|
17
26
|
## Status Definitions
|
18
27
|
|
19
28
|
| Status | Description |
|
@@ -7,6 +7,7 @@ string-to-integer conversion to complex JSON parsing and custom type handling.
|
|
7
7
|
|
8
8
|
## Table of Contents
|
9
9
|
|
10
|
+
- [TLDR](#tldr)
|
10
11
|
- [Coercion Fundamentals](#coercion-fundamentals)
|
11
12
|
- [Available Coercion Types](#available-coercion-types)
|
12
13
|
- [Basic Type Coercion](#basic-type-coercion)
|
@@ -25,6 +26,14 @@ string-to-integer conversion to complex JSON parsing and custom type handling.
|
|
25
26
|
- [Date/Time Format Options](#datetime-format-options)
|
26
27
|
- [BigDecimal Precision Options](#bigdecimal-precision-options)
|
27
28
|
|
29
|
+
## TLDR
|
30
|
+
|
31
|
+
- **Type coercion** - Automatic conversion using `type:` option (`:integer`, `:boolean`, `:array`, `:hash`, etc.)
|
32
|
+
- **Multiple types** - Fallback with `type: [:float, :integer]` - tries each until one succeeds
|
33
|
+
- **No conversion** - Default `:virtual` type returns values unchanged
|
34
|
+
- **Before validation** - Coercion happens automatically before parameter validation
|
35
|
+
- **Rich types** - Supports all Ruby built-ins plus JSON parsing for arrays/hashes
|
36
|
+
|
28
37
|
## Coercion Fundamentals
|
29
38
|
|
30
39
|
> [!NOTE]
|
data/docs/parameters/defaults.md
CHANGED
@@ -7,6 +7,7 @@ Defaults work seamlessly with coercion, validation, and nested parameters.
|
|
7
7
|
|
8
8
|
## Table of Contents
|
9
9
|
|
10
|
+
- [TLDR](#tldr)
|
10
11
|
- [Default Value Fundamentals](#default-value-fundamentals)
|
11
12
|
- [Fixed Value Defaults](#fixed-value-defaults)
|
12
13
|
- [Callable Defaults](#callable-defaults)
|
@@ -14,6 +15,14 @@ Defaults work seamlessly with coercion, validation, and nested parameters.
|
|
14
15
|
- [Defaults with Validation](#defaults-with-validation)
|
15
16
|
- [Nested Parameter Defaults](#nested-parameter-defaults)
|
16
17
|
|
18
|
+
## TLDR
|
19
|
+
|
20
|
+
- **Defaults** - Provide fallback values when parameters not provided or are `nil`
|
21
|
+
- **Fixed values** - `default: "normal"`, `default: true`, `default: []`
|
22
|
+
- **Dynamic values** - `default: -> { Time.now }`, `default: :method_name` for callable defaults
|
23
|
+
- **With coercion** - Defaults are subject to same type coercion as provided values
|
24
|
+
- **With validation** - Defaults must pass same validation rules as provided values
|
25
|
+
|
17
26
|
## Default Value Fundamentals
|
18
27
|
|
19
28
|
> [!NOTE]
|
@@ -4,12 +4,21 @@ Parameters provide a contract to verify that task execution arguments match expe
|
|
4
4
|
|
5
5
|
## Table of Contents
|
6
6
|
|
7
|
+
- [TLDR](#tldr)
|
7
8
|
- [Parameter Fundamentals](#parameter-fundamentals)
|
8
9
|
- [Parameter Sources](#parameter-sources)
|
9
10
|
- [Nested Parameters](#nested-parameters)
|
10
11
|
- [Parameter Method Generation](#parameter-method-generation)
|
11
12
|
- [Error Handling](#error-handling)
|
12
13
|
|
14
|
+
## TLDR
|
15
|
+
|
16
|
+
- **Required/Optional** - Define with `required :param` and `optional :param` class methods
|
17
|
+
- **Method generation** - Parameters become instance methods for easy access
|
18
|
+
- **Sources** - Default `:context` source, or custom with `source: :user`
|
19
|
+
- **Nested params** - Complex structures with `required :address do ... end`
|
20
|
+
- **Call interface** - Parameters passed as keyword arguments to `TaskClass.call(param: value)`
|
21
|
+
|
13
22
|
## Parameter Fundamentals
|
14
23
|
|
15
24
|
Parameters are defined using `required` and `optional` class methods that automatically create accessor methods within task instances. Parameters are matched from call arguments and made available as instance methods.
|
@@ -7,6 +7,7 @@ same name, namespacing ensures clean method resolution within tasks.
|
|
7
7
|
|
8
8
|
## Table of Contents
|
9
9
|
|
10
|
+
- [TLDR](#tldr)
|
10
11
|
- [Namespacing Fundamentals](#namespacing-fundamentals)
|
11
12
|
- [Fixed Value Namespacing](#fixed-value-namespacing)
|
12
13
|
- [Dynamic Source-Based Namespacing](#dynamic-source-based-namespacing)
|
@@ -14,6 +15,14 @@ same name, namespacing ensures clean method resolution within tasks.
|
|
14
15
|
- [Advanced Namespacing Patterns](#advanced-namespacing-patterns)
|
15
16
|
- [Error Handling with Namespacing](#error-handling-with-namespacing)
|
16
17
|
|
18
|
+
## TLDR
|
19
|
+
|
20
|
+
- **Method naming** - Use `prefix:` and `suffix:` to customize parameter method names
|
21
|
+
- **Fixed prefixes** - `prefix: "user_"` creates `user_name` method for `name` parameter
|
22
|
+
- **Dynamic prefixes** - `prefix: true` uses source name (e.g., `context_name`)
|
23
|
+
- **Conflict resolution** - Avoid conflicts with Ruby methods or multiple same-named parameters
|
24
|
+
- **Call arguments** - Always use original parameter names, namespacing only affects method names
|
25
|
+
|
17
26
|
## Namespacing Fundamentals
|
18
27
|
|
19
28
|
> [!IMPORTANT]
|
@@ -4,6 +4,7 @@ Parameter values can be validated using built-in validators or custom validation
|
|
4
4
|
|
5
5
|
## Table of Contents
|
6
6
|
|
7
|
+
- [TLDR](#tldr)
|
7
8
|
- [Common Options](#common-options)
|
8
9
|
- [Presence](#presence)
|
9
10
|
- [Format](#format)
|
@@ -13,7 +14,14 @@ Parameter values can be validated using built-in validators or custom validation
|
|
13
14
|
- [Numeric](#numeric)
|
14
15
|
- [Custom](#custom)
|
15
16
|
- [Validation Results](#validation-results)
|
16
|
-
|
17
|
+
|
18
|
+
## TLDR
|
19
|
+
|
20
|
+
- **Built-in validators** - `presence`, `format`, `inclusion`, `exclusion`, `length`, `numeric`
|
21
|
+
- **Common options** - All support `:allow_nil`, `:if`, `:unless`, `:message`
|
22
|
+
- **Usage** - Add to parameter definitions: `required :email, presence: true, format: { with: /@/ }`
|
23
|
+
- **Conditional** - Use `:if` and `:unless` for conditional validation
|
24
|
+
- **Custom validators** - Use `custom: { validator: CustomValidator }` for complex logic
|
17
25
|
|
18
26
|
## Common Options
|
19
27
|
|
@@ -303,34 +311,6 @@ result.metadata[:messages][:email] #=> ["format is invalid"]
|
|
303
311
|
result.metadata[:messages][:username] #=> ["cannot be empty"]
|
304
312
|
```
|
305
313
|
|
306
|
-
## Internationalization (i18n)
|
307
|
-
|
308
|
-
All validators support internationalization through Rails i18n. Customize error messages in your locale files:
|
309
|
-
|
310
|
-
```yaml
|
311
|
-
# config/locales/en.yml
|
312
|
-
en:
|
313
|
-
cmdx:
|
314
|
-
validators:
|
315
|
-
presence: "is required"
|
316
|
-
format: "has invalid format"
|
317
|
-
inclusion:
|
318
|
-
of: "must be one of: %{values}"
|
319
|
-
in: "must be within %{min} and %{max}"
|
320
|
-
exclusion:
|
321
|
-
of: "must not be one of: %{values}"
|
322
|
-
in: "must not be within %{min} and %{max}"
|
323
|
-
length:
|
324
|
-
within: "must be between %{min} and %{max} characters"
|
325
|
-
min: "must be at least %{min} characters"
|
326
|
-
max: "must be at most %{max} characters"
|
327
|
-
numeric:
|
328
|
-
within: "must be between %{min} and %{max}"
|
329
|
-
min: "must be at least %{min}"
|
330
|
-
max: "must be at most %{max}"
|
331
|
-
custom: "is invalid"
|
332
|
-
```
|
333
|
-
|
334
314
|
---
|
335
315
|
|
336
316
|
- **Prev:** [Parameters - Coercions](coercions.md)
|
data/docs/testing.md
CHANGED
@@ -4,6 +4,7 @@ CMDx provides a comprehensive suite of custom RSpec matchers designed for expres
|
|
4
4
|
|
5
5
|
## Table of Contents
|
6
6
|
|
7
|
+
- [TLDR](#tldr)
|
7
8
|
- [External Project Setup](#external-project-setup)
|
8
9
|
- [Matcher Organization](#matcher-organization)
|
9
10
|
- [Result Matchers](#result-matchers)
|
@@ -20,7 +21,16 @@ CMDx provides a comprehensive suite of custom RSpec matchers designed for expres
|
|
20
21
|
- [Composable Testing](#composable-testing)
|
21
22
|
- [Best Practices](#best-practices)
|
22
23
|
|
23
|
-
##
|
24
|
+
## TLDR
|
25
|
+
|
26
|
+
- **Custom matchers** - 40+ specialized RSpec matchers for testing CMDx tasks and results
|
27
|
+
- **Setup** - Require `cmdx/rspec/result_matchers` and `cmdx/rspec/task_matchers`
|
28
|
+
- **Result matchers** - `be_successful_task`, `be_failed_task`, `be_skipped_task` with chainable metadata
|
29
|
+
- **Task matchers** - Parameter validation, lifecycle, exception handling, and configuration testing
|
30
|
+
- **Composable** - Chain matchers for complex validation scenarios
|
31
|
+
- **YARD documented** - Complete documentation with examples for all matchers
|
32
|
+
|
33
|
+
## External Project Setup
|
24
34
|
|
25
35
|
To use CMDx's custom matchers in an external RSpec-based project update your `spec/spec_helper.rb` or `spec/rails_helper.rb`:
|
26
36
|
|
@@ -546,5 +556,5 @@ end
|
|
546
556
|
|
547
557
|
---
|
548
558
|
|
549
|
-
- **Prev:** [
|
559
|
+
- **Prev:** [Internationalization (i18n)](internationalization.md)
|
550
560
|
- **Next:** [AI Prompts](ai_prompts.md)
|
data/docs/tips_and_tricks.md
CHANGED
@@ -4,6 +4,7 @@ This guide covers advanced patterns and optimization techniques for getting the
|
|
4
4
|
|
5
5
|
## Table of Contents
|
6
6
|
|
7
|
+
- [TLDR](#tldr)
|
7
8
|
- [Project Organization](#project-organization)
|
8
9
|
- [Directory Structure](#directory-structure)
|
9
10
|
- [Naming Conventions](#naming-conventions)
|
@@ -12,6 +13,14 @@ This guide covers advanced patterns and optimization techniques for getting the
|
|
12
13
|
- [Monitoring and Observability](#monitoring-and-observability)
|
13
14
|
- [ActiveRecord Query Tagging](#activerecord-query-tagging)
|
14
15
|
|
16
|
+
## TLDR
|
17
|
+
|
18
|
+
- **Organization** - Group commands by domain in `/app/commands` with descriptive subdirectories
|
19
|
+
- **Naming** - Tasks use "Verb + Noun + Task", workflows use "Noun + Verb + Workflow"
|
20
|
+
- **Parameter optimization** - Use `with_options` to reduce duplication in parameter definitions
|
21
|
+
- **Monitoring** - Enable ActiveRecord query tagging for better debugging and observability
|
22
|
+
- **Base classes** - Create `ApplicationTask` and `ApplicationWorkflow` for shared configuration
|
23
|
+
|
15
24
|
## Project Organization
|
16
25
|
|
17
26
|
### Directory Structure
|
data/docs/workflows.md
CHANGED
@@ -6,6 +6,7 @@ Workflows inherit from Task, gaining all task capabilities including callbacks,
|
|
6
6
|
|
7
7
|
## Table of Contents
|
8
8
|
|
9
|
+
- [TLDR](#tldr)
|
9
10
|
- [Basic Usage](#basic-usage)
|
10
11
|
- [Task Declaration](#task-declaration)
|
11
12
|
- [Context Propagation](#context-propagation)
|
@@ -21,6 +22,15 @@ Workflows inherit from Task, gaining all task capabilities including callbacks,
|
|
21
22
|
- [Task Settings Integration](#task-settings-integration)
|
22
23
|
- [Generator](#generator)
|
23
24
|
|
25
|
+
## TLDR
|
26
|
+
|
27
|
+
- **Purpose** - Orchestrate sequential execution of multiple tasks in linear pipeline
|
28
|
+
- **Declaration** - Use `process` method to declare tasks in execution order
|
29
|
+
- **Context sharing** - Context object shared across all tasks for data pipeline
|
30
|
+
- **Conditional execution** - Support `:if` and `:unless` options for conditional tasks
|
31
|
+
- **Halt behavior** - Configurable stopping on failed/skipped results (default: halt on failed only)
|
32
|
+
- **No call method** - Workflows automatically provide execution logic, don't define `call`
|
33
|
+
|
24
34
|
## Basic Usage
|
25
35
|
|
26
36
|
> [!WARNING]
|
data/lib/cmdx/version.rb
CHANGED
@@ -1,19 +1,51 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
CMDx.configure do |config|
|
4
|
-
#
|
5
|
-
|
4
|
+
# Task halt configuration - controls when call! raises faults
|
5
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/outcomes/statuses.md for more details
|
6
|
+
#
|
7
|
+
# Available statuses: "success", "skipped", "failed"
|
8
|
+
# If set to an empty array, task will never halt
|
9
|
+
config.task_halt = %w[failed]
|
6
10
|
|
7
|
-
#
|
11
|
+
# Workflow halt configuration - controls when workflows stop execution
|
12
|
+
# When a task returns these statuses, subsequent workflow tasks won't execute
|
13
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/workflow.md for more details
|
14
|
+
#
|
15
|
+
# Available statuses: "success", "skipped", "failed"
|
16
|
+
# If set to an empty array, workflow will never halt
|
17
|
+
config.workflow_halt = %w[failed]
|
8
18
|
|
9
|
-
#
|
10
|
-
#
|
11
|
-
|
19
|
+
# Logger configuration - choose from multiple formatters
|
20
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/logging.md for more details
|
21
|
+
#
|
22
|
+
# Available formatters:
|
23
|
+
# - CMDx::LogFormatters::Line
|
24
|
+
# - CMDx::LogFormatters::PrettyLine
|
25
|
+
# - CMDx::LogFormatters::Json
|
26
|
+
# - CMDx::LogFormatters::PrettyJson
|
27
|
+
# - CMDx::LogFormatters::KeyValue
|
28
|
+
# - CMDx::LogFormatters::PrettyKeyValue
|
29
|
+
# - CMDx::LogFormatters::Logstash
|
30
|
+
# - CMDx::LogFormatters::Raw
|
31
|
+
config.logger = Logger.new($stdout, formatter: CMDx::LogFormatters::Line.new)
|
12
32
|
|
13
|
-
# Global
|
14
|
-
#
|
33
|
+
# Global middlewares - automatically applied to all tasks
|
34
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/middlewares.md for more details
|
35
|
+
#
|
36
|
+
# config.middlewares.use CMDx::Middlewares::Timeout, seconds: 30
|
37
|
+
# config.middlewares.use CMDx::Middlewares::Correlate
|
38
|
+
# config.middlewares.use CustomAuthMiddleware, role: "admin"
|
39
|
+
# config.middlewares.use PerformanceMiddleware.new(threshold: 5.0)
|
15
40
|
|
16
|
-
#
|
17
|
-
# https://github.com/drexed/cmdx/
|
18
|
-
|
41
|
+
# Global callbacks - automatically applied to all tasks
|
42
|
+
# See https://github.com/drexed/cmdx/blob/main/docs/callbacks.md for more details
|
43
|
+
#
|
44
|
+
# config.callbacks.register :before_execution, :log_task_start
|
45
|
+
# config.callbacks.register :after_execution, :log_task_end
|
46
|
+
# config.callbacks.register :on_success, NotificationCallback.new([:email])
|
47
|
+
# config.callbacks.register :on_failure, :alert_support, if: :critical?
|
48
|
+
# config.callbacks.register :on_complete, proc { |task, callback_type|
|
49
|
+
# Metrics.increment("task.#{task.class.name.underscore}.completed")
|
50
|
+
# }
|
19
51
|
end
|
data/lib/locales/ar.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
ar:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "لا يمكن تحويل إلى %{type}"
|
5
|
+
into_an: "لا يمكن تحويل إلى %{type}"
|
6
|
+
into_any: "لا يمكن تحويل إلى أي من: %{values}"
|
7
|
+
unknown: "نوع التحويل %{type} غير معروف"
|
8
|
+
faults:
|
9
|
+
unspecified: "لم يتم تحديد سبب"
|
10
|
+
parameters:
|
11
|
+
required: "معامل مطلوب"
|
12
|
+
undefined: "يفوض لطريقة غير معرفة %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "غير صالح"
|
15
|
+
exclusion:
|
16
|
+
of: "يجب ألا يكون أحد: %{values}"
|
17
|
+
within: "يجب ألا يكون بين %{min} و %{max}"
|
18
|
+
format: "له تنسيق غير صالح"
|
19
|
+
inclusion:
|
20
|
+
of: "يجب أن يكون أحد: %{values}"
|
21
|
+
within: "يجب أن يكون بين %{min} و %{max}"
|
22
|
+
length:
|
23
|
+
is: "يجب أن يكون الطول %{is}"
|
24
|
+
is_not: "يجب ألا يكون الطول %{is_not}"
|
25
|
+
min: "يجب أن يكون الطول على الأقل %{min}"
|
26
|
+
max: "يجب أن يكون الطول على الأكثر %{max}"
|
27
|
+
not_within: "يجب ألا يكون الطول بين %{min} و %{max}"
|
28
|
+
within: "يجب أن يكون الطول بين %{min} و %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "يجب أن يكون %{is}"
|
31
|
+
is_not: "يجب ألا يكون %{is_not}"
|
32
|
+
min: "يجب أن يكون على الأقل %{min}"
|
33
|
+
max: "يجب أن يكون على الأكثر %{max}"
|
34
|
+
not_within: "يجب ألا يكون بين %{min} و %{max}"
|
35
|
+
within: "يجب أن يكون بين %{min} و %{max}"
|
36
|
+
presence: "لا يمكن أن يكون فارغاً"
|
data/lib/locales/cs.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
cs:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "nelze převést na %{type}"
|
5
|
+
into_an: "nelze převést na %{type}"
|
6
|
+
into_any: "nelze převést na jeden z: %{values}"
|
7
|
+
unknown: "neznámý typ převodu %{type}"
|
8
|
+
faults:
|
9
|
+
unspecified: "nebyl uveden důvod"
|
10
|
+
parameters:
|
11
|
+
required: "je povinný parametr"
|
12
|
+
undefined: "deleguje na nedefinovanou metodu %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "není platný"
|
15
|
+
exclusion:
|
16
|
+
of: "nesmí být jeden z: %{values}"
|
17
|
+
within: "nesmí být mezi %{min} a %{max}"
|
18
|
+
format: "má neplatný formát"
|
19
|
+
inclusion:
|
20
|
+
of: "musí být jeden z: %{values}"
|
21
|
+
within: "musí být mezi %{min} a %{max}"
|
22
|
+
length:
|
23
|
+
is: "délka musí být %{is}"
|
24
|
+
is_not: "délka nesmí být %{is_not}"
|
25
|
+
min: "délka musí být alespoň %{min}"
|
26
|
+
max: "délka může být nejvýše %{max}"
|
27
|
+
not_within: "délka nesmí být mezi %{min} a %{max}"
|
28
|
+
within: "délka musí být mezi %{min} a %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "musí být %{is}"
|
31
|
+
is_not: "nesmí být %{is_not}"
|
32
|
+
min: "musí být alespoň %{min}"
|
33
|
+
max: "může být nejvýše %{max}"
|
34
|
+
not_within: "nesmí být mezi %{min} a %{max}"
|
35
|
+
within: "musí být mezi %{min} a %{max}"
|
36
|
+
presence: "nemůže být prázdný"
|
data/lib/locales/da.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
da:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "kunne ikke konvertere til en %{type}"
|
5
|
+
into_an: "kunne ikke konvertere til en %{type}"
|
6
|
+
into_any: "kunne ikke konvertere til en af: %{values}"
|
7
|
+
unknown: "ukendt %{type} konverteringstype"
|
8
|
+
faults:
|
9
|
+
unspecified: "ingen grund angivet"
|
10
|
+
parameters:
|
11
|
+
required: "er en påkrævet parameter"
|
12
|
+
undefined: "delegerer til udefineret metode %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "er ikke gyldig"
|
15
|
+
exclusion:
|
16
|
+
of: "må ikke være en af: %{values}"
|
17
|
+
within: "må ikke være mellem %{min} og %{max}"
|
18
|
+
format: "har et ugyldigt format"
|
19
|
+
inclusion:
|
20
|
+
of: "skal være en af: %{values}"
|
21
|
+
within: "skal være mellem %{min} og %{max}"
|
22
|
+
length:
|
23
|
+
is: "længde skal være %{is}"
|
24
|
+
is_not: "længde må ikke være %{is_not}"
|
25
|
+
min: "længde skal være mindst %{min}"
|
26
|
+
max: "længde må være højst %{max}"
|
27
|
+
not_within: "længde må ikke være mellem %{min} og %{max}"
|
28
|
+
within: "længde skal være mellem %{min} og %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "skal være %{is}"
|
31
|
+
is_not: "må ikke være %{is_not}"
|
32
|
+
min: "skal være mindst %{min}"
|
33
|
+
max: "må være højst %{max}"
|
34
|
+
not_within: "må ikke være mellem %{min} og %{max}"
|
35
|
+
within: "skal være mellem %{min} og %{max}"
|
36
|
+
presence: "kan ikke være tom"
|
data/lib/locales/de.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
de:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "konnte nicht in einen %{type} konvertiert werden"
|
5
|
+
into_an: "konnte nicht in einen %{type} konvertiert werden"
|
6
|
+
into_any: "konnte nicht in einen von: %{values} konvertiert werden"
|
7
|
+
unknown: "unbekannter %{type} Konvertierungstyp"
|
8
|
+
faults:
|
9
|
+
unspecified: "kein Grund angegeben"
|
10
|
+
parameters:
|
11
|
+
required: "ist ein erforderlicher Parameter"
|
12
|
+
undefined: "delegiert an undefinierte Methode %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "ist nicht gültig"
|
15
|
+
exclusion:
|
16
|
+
of: "darf nicht einer von: %{values} sein"
|
17
|
+
within: "darf nicht zwischen %{min} und %{max} liegen"
|
18
|
+
format: "hat ein ungültiges Format"
|
19
|
+
inclusion:
|
20
|
+
of: "muss einer von: %{values} sein"
|
21
|
+
within: "muss zwischen %{min} und %{max} liegen"
|
22
|
+
length:
|
23
|
+
is: "Länge muss %{is} sein"
|
24
|
+
is_not: "Länge darf nicht %{is_not} sein"
|
25
|
+
min: "Länge muss mindestens %{min} sein"
|
26
|
+
max: "Länge darf höchstens %{max} sein"
|
27
|
+
not_within: "Länge darf nicht zwischen %{min} und %{max} liegen"
|
28
|
+
within: "Länge muss zwischen %{min} und %{max} liegen"
|
29
|
+
numeric:
|
30
|
+
is: "muss %{is} sein"
|
31
|
+
is_not: "darf nicht %{is_not} sein"
|
32
|
+
min: "muss mindestens %{min} sein"
|
33
|
+
max: "darf höchstens %{max} sein"
|
34
|
+
not_within: "darf nicht zwischen %{min} und %{max} liegen"
|
35
|
+
within: "muss zwischen %{min} und %{max} liegen"
|
36
|
+
presence: "kann nicht leer sein"
|
data/lib/locales/el.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
el:
|
2
|
+
cmdx:
|
3
|
+
coercions:
|
4
|
+
into_a: "δεν ήταν δυνατή η μετατροπή σε %{type}"
|
5
|
+
into_an: "δεν ήταν δυνατή η μετατροπή σε %{type}"
|
6
|
+
into_any: "δεν ήταν δυνατή η μετατροπή σε κανένα από: %{values}"
|
7
|
+
unknown: "άγνωστος τύπος μετατροπής %{type}"
|
8
|
+
faults:
|
9
|
+
unspecified: "δεν δόθηκε λόγος"
|
10
|
+
parameters:
|
11
|
+
required: "είναι υποχρεωτική παράμετρος"
|
12
|
+
undefined: "αναθέτει σε μη ορισμένη μέθοδο %{source}"
|
13
|
+
validators:
|
14
|
+
custom: "δεν είναι έγκυρο"
|
15
|
+
exclusion:
|
16
|
+
of: "δεν πρέπει να είναι ένα από: %{values}"
|
17
|
+
within: "δεν πρέπει να είναι μεταξύ %{min} και %{max}"
|
18
|
+
format: "έχει μη έγκυρη μορφή"
|
19
|
+
inclusion:
|
20
|
+
of: "πρέπει να είναι ένα από: %{values}"
|
21
|
+
within: "πρέπει να είναι μεταξύ %{min} και %{max}"
|
22
|
+
length:
|
23
|
+
is: "το μήκος πρέπει να είναι %{is}"
|
24
|
+
is_not: "το μήκος δεν πρέπει να είναι %{is_not}"
|
25
|
+
min: "το μήκος πρέπει να είναι τουλάχιστον %{min}"
|
26
|
+
max: "το μήκος πρέπει να είναι το πολύ %{max}"
|
27
|
+
not_within: "το μήκος δεν πρέπει να είναι μεταξύ %{min} και %{max}"
|
28
|
+
within: "το μήκος πρέπει να είναι μεταξύ %{min} και %{max}"
|
29
|
+
numeric:
|
30
|
+
is: "πρέπει να είναι %{is}"
|
31
|
+
is_not: "δεν πρέπει να είναι %{is_not}"
|
32
|
+
min: "πρέπει να είναι τουλάχιστον %{min}"
|
33
|
+
max: "πρέπει να είναι το πολύ %{max}"
|
34
|
+
not_within: "δεν πρέπει να είναι μεταξύ %{min} και %{max}"
|
35
|
+
within: "πρέπει να είναι μεταξύ %{min} και %{max}"
|
36
|
+
presence: "δεν μπορεί να είναι κενό"
|
data/lib/locales/en.yml
CHANGED
@@ -6,31 +6,31 @@ en:
|
|
6
6
|
into_any: "could not coerce into one of: %{values}"
|
7
7
|
unknown: "unknown %{type} coercion type"
|
8
8
|
faults:
|
9
|
-
unspecified: no reason given
|
9
|
+
unspecified: "no reason given"
|
10
10
|
parameters:
|
11
|
-
required: is a required parameter
|
12
|
-
undefined: delegates to undefined method %{source}
|
11
|
+
required: "is a required parameter"
|
12
|
+
undefined: "delegates to undefined method %{source}"
|
13
13
|
validators:
|
14
|
-
custom: is not valid
|
14
|
+
custom: "is not valid"
|
15
15
|
exclusion:
|
16
16
|
of: "must not be one of: %{values}"
|
17
|
-
within: must not be within %{min} and %{max}
|
18
|
-
format: is an invalid format
|
17
|
+
within: "must not be within %{min} and %{max}"
|
18
|
+
format: "is an invalid format"
|
19
19
|
inclusion:
|
20
20
|
of: "must be one of: %{values}"
|
21
|
-
within: must be within %{min} and %{max}
|
21
|
+
within: "must be within %{min} and %{max}"
|
22
22
|
length:
|
23
|
-
is: length must be %{is}
|
24
|
-
is_not: length must not be %{is_not}
|
25
|
-
min: length must be at least %{min}
|
26
|
-
max: length must be at most %{max}
|
27
|
-
not_within: length must not be within %{min} and %{max}
|
28
|
-
within: length must be within %{min} and %{max}
|
23
|
+
is: "length must be %{is}"
|
24
|
+
is_not: "length must not be %{is_not}"
|
25
|
+
min: "length must be at least %{min}"
|
26
|
+
max: "length must be at most %{max}"
|
27
|
+
not_within: "length must not be within %{min} and %{max}"
|
28
|
+
within: "length must be within %{min} and %{max}"
|
29
29
|
numeric:
|
30
|
-
is: must be %{is}
|
31
|
-
is_not: must not be %{is_not}
|
32
|
-
min: must be at least %{min}
|
33
|
-
max: must be at most %{max}
|
34
|
-
not_within: must not be within %{min} and %{max}
|
35
|
-
within: must be within %{min} and %{max}
|
36
|
-
presence: cannot be empty
|
30
|
+
is: "must be %{is}"
|
31
|
+
is_not: "must not be %{is_not}"
|
32
|
+
min: "must be at least %{min}"
|
33
|
+
max: "must be at most %{max}"
|
34
|
+
not_within: "must not be within %{min} and %{max}"
|
35
|
+
within: "must be within %{min} and %{max}"
|
36
|
+
presence: "cannot be empty"
|